Skip to content

Commit

Permalink
feat: Add GitHub release pipeline
Browse files Browse the repository at this point in the history
  • Loading branch information
navasvarela committed Sep 18, 2024
1 parent 407e82b commit f608a17
Showing 1 changed file with 22 additions and 4 deletions.
26 changes: 22 additions & 4 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ jobs:

# Generates a Github release with the version taken from the one in pyproject.toml
github-release:
needs: checkversion
needs: [checkversion, build-distribution]
if: needs.checkversion.outputs.local_version_is_higher == 'true'
runs-on: ubuntu-latest
permissions:
Expand All @@ -74,12 +74,32 @@ jobs:
echo "Creating release: ${{ needs.checkversion.outputs.local_version }}"
- name: Checkout code
uses: actions/checkout@v4
- name: Download all the dists
uses: actions/download-artifact@v4
with:
name: python-package-distributions
path: dist/
- name: Sign the dists with Sigstore
uses: sigstore/[email protected]
with:
inputs: >-
./dist/*.tar.gz
./dist/*.whl
- name: Create Release
id: create_release
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # This token is provided by Actions, you do not need to create your own token
run: |
gh release create v${{ needs.checkversion.outputs.local_version }} --generate-notes
- name: Upload artifact signatures to GitHub Release
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
# Upload to GitHub Release using the `gh` CLI.
# `dist/` contains the built packages, and the
# sigstore-produced signatures and certificates.
run: >-
gh release upload
'v${{ needs.checkversion.outputs.local_version }}' dist/**
# Publishes released artifact to PyPI
publish-to-pypi:
needs: [checkversion, build-distribution]
Expand All @@ -100,7 +120,5 @@ jobs:
name: python-package-distributions
path: dist/
- name: Publish distribution 📦 to PyPI
# Publishes using trusted publishers
uses: pypa/gh-action-pypi-publish@release/v1
with:
password: ${{ secrets.PYPI_TOKEN }}
repository-url: https://upload.pypi.org/legacy/

0 comments on commit f608a17

Please sign in to comment.