Skip to content

Pre-release

Pre-release #4

Workflow file for this run

name: Pre-release
on:
workflow_dispatch:
inputs:
bump:
description: "Version bump type"
required: true
type: choice
options:
- auto
- major
- minor
- patch
default: auto
permissions: {}
jobs:
pre-release:
runs-on: ubuntu-latest
environment: release
permissions:
contents: write
steps:
- name: Checkout code
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6
with:
fetch-depth: 0
persist-credentials: false
token: ${{ secrets.GH_RELEASE_TOKEN }}
- name: Install the latest version of uv
uses: astral-sh/setup-uv@37802adc94f370d6bfd71619e3f0bf239e1f3b78 # v7
with:
enable-cache: true
cache-dependency-glob: "pyproject.toml"
github-token: ${{ secrets.GITHUB_TOKEN }}
- name: Set up Python
run: uv python install 3.14
- name: Configure git identity from token owner
env:
GH_TOKEN: ${{ secrets.GH_RELEASE_TOKEN }}
run: |
user_info=$(gh api /user)
git config user.name "$(echo "$user_info" | jq -r '.name // .login')"
git config user.email "$(echo "$user_info" | jq -r '.id')+$(echo "$user_info" | jq -r '.login')@users.noreply.github.com"
- name: Generate release commit and tag
run: uv tool run --with tox-uv tox r -e release -- --version "${{ inputs.bump }}" --no-push
- name: Push release commit and tag
run: |
git remote set-url origin "https://x-access-token:${GH_RELEASE_TOKEN}@github.com/${{ github.repository }}.git"
git push origin HEAD:main
git push origin "$(git describe --tags --abbrev=0)"
env:
GH_RELEASE_TOKEN: ${{ secrets.GH_RELEASE_TOKEN }}