Skip to content

Commit

Permalink
add pypi publishing
Browse files Browse the repository at this point in the history
  • Loading branch information
gilesknap committed Mar 19, 2024
1 parent 0e139c9 commit 714b0f5
Show file tree
Hide file tree
Showing 2 changed files with 31 additions and 0 deletions.
22 changes: 22 additions & 0 deletions .github/workflows/_pypi.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
on:
workflow_call:
secrets:
PYPI_TOKEN:
required: true

jobs:
upload:
runs-on: ubuntu-latest
environment: release

steps:
- name: Download dist artifact
uses: actions/download-artifact@v4
with:
name: dist
path: dist

- name: Publish to PyPI using trusted publishing
uses: pypa/gh-action-pypi-publish@release/v1
with:
password: ${{ secrets.PYPI_TOKEN }}
9 changes: 9 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,15 @@ jobs:
if: needs.check.outputs.branch-pr == ''
uses: ./.github/workflows/_dist.yml

pypi:
if: github.ref_type == 'tag'
needs: dist
uses: ./.github/workflows/_pypi.yml
permissions:
id-token: write
secrets:
PYPI_TOKEN: ${{ secrets.PYPI_TOKEN }}

release:
if: github.ref_type == 'tag'
needs: [dist]
Expand Down

0 comments on commit 714b0f5

Please sign in to comment.