.github: Add release workflow
Upload a pypi package when a Github release is published. Signed-off-by: Pieter De Gendt <pieter.degendt@basalte.be>
This commit is contained in:
parent
38aae907fd
commit
04b7bcb6d3
|
@ -0,0 +1,40 @@
|
|||
name: Release
|
||||
|
||||
# This workflow follows Pypi guidelines for publishing using trusted publishers
|
||||
# See https://docs.pypi.org/trusted-publishers/using-a-publisher/ for more details.
|
||||
|
||||
on:
|
||||
release:
|
||||
types: [published]
|
||||
|
||||
jobs:
|
||||
package:
|
||||
name: Package
|
||||
uses: ./.github/workflows/package.yml
|
||||
|
||||
release:
|
||||
name: Release
|
||||
needs: [package]
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
# Make the GH environment explicit
|
||||
environment: release
|
||||
|
||||
# Mandatory for trusted publishing
|
||||
permissions:
|
||||
contents: write
|
||||
id-token: write
|
||||
|
||||
steps:
|
||||
- name: Download build artifacts
|
||||
uses: actions/download-artifact@v4
|
||||
with:
|
||||
path: dist/
|
||||
|
||||
- name: Upload release assets
|
||||
uses: softprops/action-gh-release@v2
|
||||
with:
|
||||
files: dist/*.whl
|
||||
|
||||
- name: Publish package to PyPI
|
||||
uses: pypa/gh-action-pypi-publish@release/v1
|
Loading…
Reference in New Issue