diff --git a/.github/workflows/build_and_test_library.yml b/.github/workflows/build_and_test_library.yml index 8ca9e399..7f7a20c8 100644 --- a/.github/workflows/build_and_test_library.yml +++ b/.github/workflows/build_and_test_library.yml @@ -5,9 +5,8 @@ on: push: tags: - "*" - paths: - - "ansys-grantami-serverapi-openapi/**" - - ".github/workflows/build_and_test_library.yml" + branches: + - main pull_request: paths: - "ansys-grantami-serverapi-openapi/**" @@ -86,6 +85,19 @@ jobs: path: ${{ env.LIBRARY_NAME }}/dist/ retention-days: 7 + publish: + name: "Publish" + runs-on: ubuntu-latest + needs: [build-library] + if: github.event_name == 'push' && (github.ref == 'refs/heads/main') + steps: + - name: "Release to private PyPI" + uses: ansys/actions/release-pypi-private@v7 + with: + library-name: ${{ env.LIBRARY_NAME }} + twine-username: "__token__" + twine-token: ${{ secrets.PYANSYS_PYPI_PRIVATE_PAT }} + release: name: "Release" runs-on: ubuntu-latest @@ -104,7 +116,7 @@ jobs: with: library-name: ${{ env.LIBRARY_NAME }} twine-username: "__token__" - twine-token: ${{ secrets.PYPI_TOKEN }} + twine-token: ${{ secrets.PYANSYS_PYPI_PRIVATE_PAT }} - name: "Download distribution artifacts" uses: actions/download-artifact@v4