Skip to content

Commit

Permalink
make PyPI publishing conditional on a release
Browse files Browse the repository at this point in the history
  • Loading branch information
ravnoor committed Dec 25, 2023
1 parent 7389536 commit 6bcca99
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 5 deletions.
4 changes: 1 addition & 3 deletions .github/workflows/wheels-macosx_arm64.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ on:
push:
branches:
- master
- refactor_ci_pypi
pull_request:
branches:
- master
Expand Down Expand Up @@ -127,14 +126,14 @@ jobs:

pypi-publish:
name: Upload release to PyPI
if: github.event_name == 'release'
needs: [build_wheels]
runs-on: ubuntu-latest
permissions:
id-token: write # IMPORTANT: this permission is mandatory for trusted publishing
steps:
# retrieve your distributions here
- name: Download artifacts
# needs: [build_wheels, build_sdist]
uses: actions/download-artifact@v4
with:
# unpacks all CIBW artifacts into dist/
Expand All @@ -144,7 +143,6 @@ jobs:

- name: Publish package to PyPI
uses: pypa/gh-action-pypi-publish@release/v1
# if: ${{ (github.event_name == 'push') && (runner.os == 'Linux') }}
with:
user: __token__
password: ${{ secrets.PYPI_API_TOKEN }}
Expand Down
3 changes: 1 addition & 2 deletions .github/workflows/wheels.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ on:
push:
branches:
- master
- refactor_ci_pypi
pull_request:
branches:
- master
Expand Down Expand Up @@ -217,6 +216,7 @@ jobs:

pypi-publish:
name: Upload release to PyPI
if: github.event_name == 'release'
needs: [build_wheels]
runs-on: ubuntu-latest
permissions:
Expand All @@ -233,7 +233,6 @@ jobs:

- name: Publish package to PyPI
uses: pypa/gh-action-pypi-publish@release/v1
# if: ${{ (github.event_name == 'push') && (runner.os == 'Linux') }}
with:
user: __token__
password: ${{ secrets.PYPI_API_TOKEN }}
Expand Down

0 comments on commit 6bcca99

Please sign in to comment.