Skip to content

Commit

Permalink
Fixup publish-to-pypi job
Browse files Browse the repository at this point in the history
  • Loading branch information
tschoonj committed Aug 6, 2024
1 parent 104a5de commit 287a069
Showing 1 changed file with 27 additions and 26 deletions.
53 changes: 27 additions & 26 deletions .github/workflows/build-publish-pypi.yml
Original file line number Diff line number Diff line change
Expand Up @@ -50,35 +50,37 @@ jobs:
path: dist/*.tar.gz
retention-days: 1

publish-to-testpypi:
name: Upload to TestPyPI
needs: [build_wheels, build_sdist]
runs-on: ubuntu-latest
# publish-to-testpypi:
# name: Upload to TestPyPI
# needs: [build_wheels, build_sdist]
# runs-on: ubuntu-latest

environment:
name: testpypi
url: https://test.pypi.org/p/xraylib
# environment:
# name: testpypi
# url: https://test.pypi.org/p/xraylib

permissions:
id-token: write # IMPORTANT: mandatory for trusted publishing
# permissions:
# id-token: write # IMPORTANT: mandatory for trusted publishing

steps:
- uses: actions/download-artifact@v4
with:
# unpacks all CIBW artifacts into dist/
pattern: cibw-*
path: dist
merge-multiple: true
- name: Publish distribution 📦 to TestPyPI
uses: pypa/gh-action-pypi-publish@release/v1
with:
repository-url: https://test.pypi.org/legacy/
# steps:
# - uses: actions/download-artifact@v4
# with:
# # unpacks all CIBW artifacts into dist/
# pattern: cibw-*
# path: dist
# merge-multiple: true
# - name: Publish distribution 📦 to TestPyPI
# uses: pypa/gh-action-pypi-publish@release/v1
# with:
# repository-url: https://test.pypi.org/legacy/

upload_pypi:
publish-to-pypi:
name: Upload to PyPI
needs: [build_wheels, build_sdist]
runs-on: ubuntu-latest
environment: pypi
environment:
name: pypi
url: https://pypi.org/p/xraylib
permissions:
id-token: write
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags/v')
Expand All @@ -89,7 +91,6 @@ jobs:
pattern: cibw-*
path: dist
merge-multiple: true

- uses: pypa/gh-action-pypi-publish@release/v1
# with:
# To test: repository-url: https://test.pypi.org/legacy/
- name: Publish distribution 📦 to TestPyPI
uses: pypa/gh-action-pypi-publish@release/v1

0 comments on commit 287a069

Please sign in to comment.