Skip to content

Commit

Permalink
automatic release after publish-pypi
Browse files Browse the repository at this point in the history
  • Loading branch information
getzze committed Jun 24, 2024
1 parent 8168072 commit 929424c
Showing 1 changed file with 22 additions and 22 deletions.
44 changes: 22 additions & 22 deletions .github/workflows/publish.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ on:
permissions:
contents: read

# https://packaging.python.org/en/latest/guides/publishing-package-distribution-releases-using-github-actions-ci-cd-workflows/
jobs:
deploy:
runs-on: ubuntu-latest
Expand All @@ -30,11 +31,31 @@ jobs:
name: Packages
path: dist/*

publish-to-pypi:
needs: [deploy]
environment:
name: pypi
url: https://pypi.org/p/subliminal
permissions:
id-token: write
runs-on: ubuntu-latest
if: startsWith(github.ref, 'refs/tags/') # only publish to PyPI on tag pushes
steps:
- uses: actions/download-artifact@v4
with:
name: Packages
path: dist
- name: Publish package
uses: pypa/gh-action-pypi-publish@release/v1
with:
user: __token__
password: ${{ secrets.PYPI_API_TOKEN }}

This comment has been minimized.

Copy link
@Diaoul

Diaoul Jun 25, 2024

Owner

This works? The actual secret name is PYPI_TOKEN 🤔

This comment has been minimized.

Copy link
@getzze

getzze Jun 25, 2024

Author Collaborator

well, it did work 😆


github-release:
name: >-
Sign the Python 🐍 distribution 📦 with Sigstore
and upload them to GitHub Release
needs: [deploy]
needs: [publish-to-pypi]
runs-on: ubuntu-latest

permissions:
Expand All @@ -60,7 +81,6 @@ jobs:
gh release create
'${{ github.ref_name }}'
--repo '${{ github.repository }}'
--draft
--generate-notes
--notes ""
- name: Upload artifact signatures to GitHub Release
Expand All @@ -73,23 +93,3 @@ jobs:
gh release upload
'${{ github.ref_name }}' dist/**
--repo '${{ github.repository }}'
publish-to-pypi:
needs: [github-release]
environment:
name: pypi
url: https://pypi.org/p/subliminal
permissions:
id-token: write
runs-on: ubuntu-latest
if: github.event_name == 'release' && github.event.action == 'published'
steps:
- uses: actions/download-artifact@v4
with:
name: Packages
path: dist
- name: Publish package
uses: pypa/gh-action-pypi-publish@release/v1
with:
user: __token__
password: ${{ secrets.PYPI_API_TOKEN }}

0 comments on commit 929424c

Please sign in to comment.