Skip to content

Commit

Permalink
Move PyPI publish to a separate step
Browse files Browse the repository at this point in the history
  • Loading branch information
calcmogul committed Jul 9, 2024
1 parent bbd1cde commit 5c5c003
Showing 1 changed file with 24 additions and 7 deletions.
31 changes: 24 additions & 7 deletions .github/workflows/choreolib.yml
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,7 @@ jobs:
path: combiner/products/build/allOutputs

- name: Flatten Artifacts
run: rsync -a --delete combiner/products/build/allOutputs/*/* combiner/products/build/allOutputs/
run: rsync -a --delete combiner/products/build/allOutputs/*/* combiner/products/build/allOutputs

- uses: actions/setup-java@v4
with:
Expand All @@ -157,7 +157,12 @@ jobs:

build-python:
name: "Build Python"
runs-on: ubuntu-22.04
runs-on: ubuntu-24.04
environment:
name: pypi
url: https://pypi.org/p/sleipnirgroup-jormungandr
permissions:
id-token: write
steps:
- uses: actions/checkout@v4
with:
Expand All @@ -179,10 +184,22 @@ jobs:
- uses: actions/upload-artifact@v4
with:
name: dist
path: ./choreolib/py/dist/

path: ./choreolib/py/dist

pypi-publish:
name: Upload release to PyPI
runs-on: ubuntu-24.04
needs: [build-python]
if: github.repository_owner == 'SleipnirGroup' && github.ref == 'refs/heads/main'
environment:
name: pypi
url: https://pypi.org/p/sleipnirgroup-choreolib
permissions:
id-token: write
steps:
- uses: actions/download-artifact@v4
with:
path: dist
pattern: 'dist'
- name: Publish package distributions to PyPI
if: startsWith(github.ref, 'refs/tags/v')
uses: pypa/gh-action-pypi-publish@release/v1
with:
packages_dir: ./choreolib/py/dist/

0 comments on commit 5c5c003

Please sign in to comment.