Release #3
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: "Release" | |
on: | |
workflow_dispatch: | |
inputs: | |
tag: | |
description: "The version to tag" | |
type: string | |
sha: | |
description: "The full sha of the commit to be release. If omitted, the most recent commit on the default branch will be used." | |
default: "" | |
type: string | |
jobs: | |
tag-release: | |
name: Tag Release | |
runs-on: ubuntu-latest | |
if: ${{ inputs.tag }} | |
needs: pypi-publish | |
permissions: | |
contents: write | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
ref: ${{ inputs.sha }} | |
- name: Git tag | |
run: | | |
git config user.name "Github Actions" | |
git config user.email "[email protected]" | |
git tag -m "${{ inputs.tag }}" "${{ inputs.tag }}" | |
git push --tags | |
pypi-publish: | |
name: upload release to PyPI | |
runs-on: ubuntu-latest | |
permissions: | |
# IMPORTANT: this permission is mandatory for trusted publishing | |
id-token: write | |
steps: | |
# retrieve your distributions here | |
- uses: actions/checkout@v4 | |
with: | |
ref: ${{ inputs.sha }} | |
- name: Install rye | |
uses: eifinger/setup-rye@v1 | |
with: | |
enable-cache: true | |
- name: Install Dependencies | |
run: rye sync | |
- name: Build Project | |
run: rye build | |
- name: Publish package distributions to PyPI | |
uses: pypa/gh-action-pypi-publish@release/v1 | |
with: | |
skip_existing: true | |
packages_dir: dist | |
verbose: true | |
publish-release: | |
name: Publish to Github | |
runs-on: ubuntu-latest | |
needs: tag-release | |
permissions: | |
contents: write | |
steps: | |
- uses: softprops/action-gh-release@v1 | |
with: | |
draft: true | |
tag_name: ${{ inputs.tag }} | |