Release #11
This file contains hidden or 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
# https://python-semantic-release.readthedocs.io/en/latest/automatic-releases/github-actions.html#examples | |
name: Release | |
on: | |
workflow_dispatch: | |
# Disabled to be able to roll multiple breaking releases into one release | |
# push: | |
# branches: | |
# - master | |
jobs: | |
release: | |
runs-on: ubuntu-latest | |
concurrency: release | |
permissions: | |
id-token: write | |
contents: write | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 | |
ref: ${{ github.ref_name }} | |
persist-credentials: false | |
- name: Setup | Force release branch to be at workflow sha | |
run: | | |
git reset --hard ${{ github.sha }} | |
- name: Python Semantic Release | |
id: release | |
# https://github.com/python-semantic-release/python-semantic-release/releases | |
# https://python-semantic-release.readthedocs.io/en/latest/github-action.html | |
uses: python-semantic-release/[email protected] | |
with: | |
github_token: ${{ secrets.BOT_GITHUB_TOKEN }} | |
- name: Publish | Upload package to PyPI | |
uses: pypa/gh-action-pypi-publish@release/v1 | |
# NOTE: DO NOT wrap the conditional in ${{ }} as it will always evaluate to true. | |
# See https://github.com/actions/runner/issues/1173 | |
if: steps.release.outputs.released == 'true' | |
- name: Publish | Upload to GitHub Release Assets | |
uses: python-semantic-release/[email protected] | |
if: steps.release.outputs.released == 'true' | |
with: | |
github_token: ${{ secrets.BOT_GITHUB_TOKEN }} | |
tag: ${{ steps.release.outputs.tag }} |