Skip to content

Tag and release

Tag and release #93

Workflow file for this run

name: Tag and release
on:
workflow_dispatch:
inputs:
version:
description: Version (must have matching CHANGES.rst entry)
required: true
description:
description: Release description (used as tag message and GitHub release body)
required: true
jobs:
release:
name: Tag and release
runs-on: ubuntu-latest
steps:
- name: Checkout repo
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
with:
ref: main
fetch-depth: 0
- name: Configure git
run: |
git config user.name "GitHub Actions"
git config user.email "<>"
- uses: actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405 # v6.2.0
with:
python-version: 3
- name: create new change log entry for release
run: |
pip install towncrier
pip install .
towncrier check
towncrier build --yes --version ${{ inputs.version }}
- name: Commit changelog and tag release
run: |
git add CHANGES.rst
git commit -m "created change log for ${{ inputs.version }}"
git push origin HEAD
git tag -a ${{ github.event.inputs.version }} -m "${{ github.event.inputs.description }}"
git push origin ${{ github.event.inputs.version }}
- name: Create GitHub release (triggers publish-to-pypi workflow)
uses: zendesk/action-create-release@v3 # main
env:
GITHUB_TOKEN: ${{ secrets.GH_RELEASE_TOKEN }}
with:
tag_name: ${{ github.event.inputs.version }}
release_name: ${{ github.event.inputs.version }}
body: ${{ github.event.inputs.description }}
draft: false
prerelease: false