Skip to content

Commit

Permalink
Merge pull request #187 from pypa/gha-trusted-publish
Browse files Browse the repository at this point in the history
Set up trusted publishing for making releases to PyPI
  • Loading branch information
takluyver authored Apr 23, 2024
2 parents 33953f2 + 79a2edf commit c667aeb
Showing 1 changed file with 10 additions and 5 deletions.
15 changes: 10 additions & 5 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -46,16 +46,21 @@ jobs:
name: Publish release
runs-on: ubuntu-latest
needs: tests
environment: release
permissions:
id-token: write # Needed for trusted publishing

if: ${{ startsWith(github.ref, 'refs/tags/') }}

steps:
- uses: actions/checkout@v3
- uses: actions/setup-python@v4
with:
python-version: "3.10"
python-version: "3.12"

- run: pipx run nox -s release
env:
FLIT_USERNAME: __token__
FLIT_PASSWORD: ${{ secrets.PYPI_TOKEN }}
- run: |
pip install build
python -m build
- name: Publish package distributions to PyPI
uses: pypa/gh-action-pypi-publish@release/v1

0 comments on commit c667aeb

Please sign in to comment.