Skip to content

Commit

Permalink
ci: Update CI/CD workflow for publishing to PyPI
Browse files Browse the repository at this point in the history
- Added environment declaration for release
- Added permissions for trusted publishing
- Updated step for publishing package distributions to PyPI using a GitHub action
  • Loading branch information
ntindle committed Nov 10, 2023
1 parent fe14330 commit af0ee85
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions .github/workflows/cicd.yml
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,10 @@ jobs:
needs: test
if: github.event_name == 'release' && github.event.action == 'published'
runs-on: ubuntu-latest
environment: release
permissions:
# IMPORTANT: this permission is mandatory for trusted publishing
id-token: write
strategy:
matrix:
python-version: [3.12]
Expand All @@ -96,6 +100,5 @@ jobs:
- name: Build
run: |
poetry build
- name: Build and publish
run: |
poetry publish --username ${{ secrets.PYPI_USERNAME }} --password ${{ secrets.PYPI_PASSWORD }}
- name: Publish package distributions to PyPI
uses: pypa/gh-action-pypi-publish@release/v1

0 comments on commit af0ee85

Please sign in to comment.