Skip to content

Commit

Permalink
ci: publish package to PyPI using OIDC (#350)
Browse files Browse the repository at this point in the history
Fixes #349
  • Loading branch information
jooola authored Jan 2, 2024
1 parent d365726 commit 1a0e93b
Showing 1 changed file with 27 additions and 6 deletions.
33 changes: 27 additions & 6 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,11 +25,32 @@ jobs:
run: python3 -m build

- name: Check
run: twine check dist/*
run: twine check --strict dist/*

- name: Publish
- name: Upload packages artifact
if: github.event_name == 'release'
env:
TWINE_USERNAME: ${{ secrets.PYPI_USERNAME }}
TWINE_PASSWORD: ${{ secrets.PYPI_PASSWORD }}
run: twine upload dist/*
uses: actions/upload-artifact@v4
with:
name: python-packages
path: dist/

publish:
if: github.event_name == 'release'
needs: [build]

environment:
name: pypi
url: https://pypi.org/p/hcloud
permissions:
id-token: write

runs-on: ubuntu-latest
steps:
- name: Download packages artifact
uses: actions/download-artifact@v4
with:
name: python-packages
path: dist/

- name: Publish packages to PyPI
uses: pypa/[email protected]

0 comments on commit 1a0e93b

Please sign in to comment.