2024-09-19 01:05:23 +08:00
|
|
|
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
|
|
|
|
|
|
|
|
permissions:
|
2024-10-04 15:11:15 +08:00
|
|
|
# Mandatory for attaching assets to releases
|
2024-09-19 01:05:23 +08:00
|
|
|
contents: write
|
2024-10-04 15:11:15 +08:00
|
|
|
# Mandatory for trusted publishing
|
2024-09-19 01:05:23 +08:00
|
|
|
id-token: write
|
|
|
|
|
|
|
|
steps:
|
|
|
|
- name: Download build artifacts
|
|
|
|
uses: actions/download-artifact@v4
|
|
|
|
with:
|
2024-10-04 23:00:13 +08:00
|
|
|
name: python-package-distributions
|
2024-09-19 01:05:23 +08:00
|
|
|
path: dist/
|
|
|
|
|
2024-10-04 15:11:15 +08:00
|
|
|
# The assets can be attached to an existing release, if a matching tag is found
|
2024-09-19 01:05:23 +08:00
|
|
|
- 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
|