Skip to content

Commit

Permalink
fix: github CI publish on release
Browse files Browse the repository at this point in the history
  • Loading branch information
carlos-adir committed Feb 25, 2024
1 parent 83489f3 commit 79ce3ad
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions .github/workflows/publish.yaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
name: Publish to PyPI

on:
push:
release:
types: [ published ]
branches: [ main ]
workflow_dispatch:

Expand All @@ -20,7 +21,7 @@ jobs:
python-version: "3.x"

- name: Install pypa/build
run: >-
run: |
python3 -m
pip install
build
Expand All @@ -34,9 +35,8 @@ jobs:
path: dist/

publish-to-pypi:
name: >-
name: |
Publish Python distribution to PyPI
if: startsWith(github.ref, 'refs/tags/') # only publish to PyPI on tag pushes
needs:
- build
runs-on: ubuntu-latest
Expand All @@ -55,7 +55,7 @@ jobs:
uses: pypa/gh-action-pypi-publish@release/v1

github-release:
name: >-
name: |
Sign the Python 🐍 distribution 📦 with Sigstore
and upload them to GitHub Release
needs:
Expand All @@ -75,13 +75,13 @@ jobs:
- name: Sign the dists with Sigstore
uses: sigstore/[email protected]
with:
inputs: >-
inputs: |
./dist/*.tar.gz
./dist/*.whl
- name: Create GitHub Release
env:
GITHUB_TOKEN: ${{ github.token }}
run: >-
run: |
gh release create
'${{ github.ref_name }}'
--repo '${{ github.repository }}'
Expand All @@ -92,7 +92,7 @@ jobs:
# Upload to GitHub Release using the `gh` CLI.
# `dist/` contains the built packages, and the
# sigstore-produced signatures and certificates.
run: >-
run: |
gh release upload
'${{ github.ref_name }}' dist/**
--repo '${{ github.repository }}'
Expand Down

0 comments on commit 79ce3ad

Please sign in to comment.