Skip to content

Draft a release

Draft a release #29

Workflow file for this run

name: Draft a release
on:
workflow_dispatch:
inputs:
version:
description: 'The version number (e.g. 1.2.3) OR one of: patch|minor|major|alpha|beta|rc|post|dev'
required: true
default: 'patch'
jobs:
draft-release:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: ./.github/actions/python-hatch-env
- name: Update version
id: updated_version
shell: bash
run: |
hatch version ${{ github.event.inputs.version }}
version=$(hatch version)
echo "version=$version" >> "$GITHUB_OUTPUT"
- name: Commit changes
uses: EndBug/add-and-commit@v9
with:
add: 'avwx/__about__.py'
message: 'Release ${{ steps.updated_version.outputs.version }}'
- name: Create tag
run: |
git tag ${{ steps.updated_version.outputs.version }}
git push origin ${{ steps.updated_version.outputs.version }}
- name: Create a draft release
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: ${{ steps.updated_version.outputs.version }}
release_name: Release ${{ steps.updated_version.outputs.version }}
draft: true