Skip to content

Commit

Permalink
Modernize PyPI publishing
Browse files Browse the repository at this point in the history
- Use Trusted Publishers
- Do not use "master" version of the GitHub action
  • Loading branch information
JelleZijlstra committed Jan 24, 2024
1 parent a0659f2 commit 0d2672d
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,14 @@ name: Publish Python distributions to PyPI and TestPyPI
on: push

jobs:
build-n-publish:
release:
name: Build and publish Python distributions to PyPI and TestPyPI
runs-on: ubuntu-latest
permissions:
id-token: write # IMPORTANT: this permission is mandatory for trusted publishing
environment:
name: pypi
url: https://pypi.org/project/fastapi-poe/
steps:
- uses: actions/checkout@v3
- name: Set up Python 3.10
Expand All @@ -23,6 +28,4 @@ jobs:
python -m build --sdist --wheel --outdir dist/ .
- name: Publish distribution to PyPI
if: startsWith(github.ref, 'refs/tags')
uses: pypa/gh-action-pypi-publish@master
with:
password: ${{ secrets.PYPI_API_TOKEN }}
uses: pypa/gh-action-pypi-publish@release/v1

0 comments on commit 0d2672d

Please sign in to comment.