Skip to content

ci: add release workflow #120

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Jun 27, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
57 changes: 57 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
name: Release

on:
push:
tags:
- "[0-9]+.[0-9]+.[0-9]+"
branches:
- main

permissions:
contents: read

jobs:
packages:
permissions:
attestations: write
id-token: write
contents: read
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4

- run: pip install build==1.2.1

- run: python -m build

- name: generate build provenance
uses: actions/attest-build-provenance@bdd51370e0416ac948727f861e03c2f05d32d78e # v1.3.2
with:
subject-path: "${{ github.workspace }}/dist/*"

- name: Upload Packages
uses: actions/upload-artifact@v4
with:
name: packages
path: |
dist/*.whl
dist/*tar.gz

publish-pypi:
needs:
- packages
runs-on: ubuntu-latest
environment: release
permissions:
id-token: write # IMPORTANT: this permission is mandatory for trusted publishing
steps:
- uses: actions/download-artifact@v4
with:
name: packages
path: dist

- name: Upload pypi.org
if: startsWith(github.ref, 'refs/tags')
uses: pypa/gh-action-pypi-publish@ec4db0b4ddc65acdf4bff5fa45ac92d78b56bdf0
with:
repository-url: https://upload.pypi.org/legacy/