Skip to content

Commit

Permalink
Publish to PyPI via Trusted Publisher (#39)
Browse files Browse the repository at this point in the history
  • Loading branch information
amureki committed Aug 30, 2024
1 parent dce0fac commit d233273
Showing 1 changed file with 27 additions and 11 deletions.
38 changes: 27 additions & 11 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,19 +3,35 @@ name: Release
on:
release:
types: [published]
workflow_dispatch:

permissions:
id-token: write

jobs:
release-build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: "3.x"
- run: python -m pip install --upgrade pip build wheel
- run: python -m build --sdist --wheel
- uses: actions/upload-artifact@v4
with:
name: release-dists
path: dist/

PyPi:
pypi-publish:
runs-on: ubuntu-latest
needs:
- release-build
permissions:
id-token: write
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: "3.x"
- run: python -m pip install --upgrade pip build wheel twine
- run: python -m build --sdist --wheel
- run: python -m twine upload dist/*
env:
TWINE_USERNAME: __token__
TWINE_PASSWORD: ${{ secrets.PYPI_TOKEN }}
- uses: actions/download-artifact@v4
with:
name: release-dists
path: dist/
- uses: pypa/gh-action-pypi-publish@release/v1

0 comments on commit d233273

Please sign in to comment.