Skip to content

Tag and release

Tag and release #56

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@v4
with:
ref: master
fetch-depth: 0
- name: Configure git
run: |
git config user.name "GitHub Actions"
git config user.email "<>"
- uses: actions/setup-python@v5
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@v1
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