Release #207
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
# This workflow will | |
# 1) Update the version number in pyproject.toml based on the commit history | |
# 2) Create a git tag | |
# 3) Create a release on GitHub | |
# 4) Upload the package to PyPI | |
name: Release | |
on: | |
push: | |
branches: [main] | |
workflow_run: | |
workflows: ["tests"] | |
types: | |
- completed | |
jobs: | |
release: | |
runs-on: ubuntu-latest | |
concurrency: release | |
permissions: | |
id-token: write # IMPORTANT: this permission is mandatory for trusted publishing using PyPI | |
# a guide on how to set it up is available here: https://blog.pypi.org/posts/2023-04-20-introducing-trusted-publishers/ | |
if: ${{ github.ref == 'refs/heads/main' && github.event.workflow_run.conclusion == 'success'}} | |
steps: | |
# Checkout action is required for token to persist | |
- uses: actions/checkout@v3 | |
with: | |
fetch-depth: 0 | |
token: ${{ secrets.PAT }} | |
- name: Python Semantic Release | |
uses: python-semantic-release/[email protected] | |
id: release | |
with: | |
github_token: ${{ secrets.PAT }} | |
- name: Publish package distributions to PyPI | |
uses: pypa/gh-action-pypi-publish@release/v1 | |
if: steps.release.outputs.released == 'true' | |
# This action supports PyPI's trusted publishing implementation, which allows authentication to PyPI without a manually | |
# configured API token or username/password combination. To perform trusted publishing with this action, your project's | |
# publisher must already be configured on PyPI. | |
- name: Publish package distributions to GitHub Releases | |
uses: python-semantic-release/upload-to-gh-release@main | |
if: steps.release.outputs.released == 'true' | |
with: | |
github_token: ${{ secrets.PAT }} |