Release #26
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
# Trigger this workflow manually while choosing a branch in order to make a release. | |
# | |
# The release tag is inferred by commitizen by looking at the history of commit messages. | |
# It will be a dev release if the branch name matches the regex `DEVRELEASE_PATTERN`. | |
# | |
# This is going to: | |
# - Create the release tag | |
# - Update the package metadata and changelog | |
# | |
# For updating the API docs, see the workflow `api-docs.yml` | |
# For publishing a package, see the workflow `pypi.yml` | |
# | |
name: Release | |
on: | |
workflow_dispatch: | |
inputs: | |
dry-run: | |
type: boolean | |
default: false | |
required: false | |
description: Dry run | |
env: | |
DEVRELEASE_PATTERN: ^(?!main$).+$ # Match any branch name except 'main' | |
jobs: | |
release: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v3 | |
with: | |
fetch-depth: 0 | |
- name: Get metadata | |
id: get-metadata | |
run: | | |
if ! [[ -z $(echo "${GITHUB_REF#refs/heads/}" | grep -xP '${{ env.DEVRELEASE_PATTERN }}') ]] ; then | |
echo "devrelease=${GITHUB_RUN_ID}" >> $GITHUB_OUTPUT | |
else | |
echo "changelog=true" >> $GITHUB_OUTPUT | |
fi | |
- name: Commitizen | |
uses: commitizen-tools/commitizen-action@master | |
with: | |
github_token: ${{ secrets.GITHUB_TOKEN }} | |
dry_run: ${{ github.event.inputs.dry-run }} | |
changelog: ${{ steps.get-metadata.outputs.changelog }} | |
devrelease: ${{ steps.get-metadata.outputs.devrelease }} |