Skip to content

Release

Release #8

Workflow file for this run

name: Release
on:
workflow_dispatch:
inputs:
release_type:
description: 'Release type'
required: true
default: 'patch'
type: choice
options:
- patch
- minor
- major
permissions:
contents: write
id-token: write
jobs:
test:
uses: ./.github/workflows/test.yml
release:
runs-on: ubuntu-latest
needs: test
steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
fetch-depth: 0
token: ${{ secrets.GITHUB_TOKEN }}
- name: Install uv
uses: astral-sh/setup-uv@v4
with:
version: "latest"
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: "3.12"
- name: Install dependencies
run: uv sync --extra dev
- name: Run linting
run: uv run ruff check .
- name: Run formatting check
run: uv run ruff format --check .
- name: Configure Git
run: |
git config user.name "github-actions[bot]"
git config user.email "github-actions[bot]@users.noreply.github.com"
- name: Bump version and create changelog
run: |
uv run cz bump --increment ${{ inputs.release_type }} --yes
echo "NEW_VERSION=$(uv run cz version --project)" >> $GITHUB_ENV
- name: Push changes and tags
run: |
git push origin master
git push origin --tags
- name: Generate release notes
run: |
uv run cz changelog --dry-run --incremental > RELEASE_NOTES.md
- name: Create GitHub Release
uses: softprops/action-gh-release@v2
with:
tag_name: v${{ env.NEW_VERSION }}
body_path: RELEASE_NOTES.md
generate_release_notes: true
draft: false
prerelease: false
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Release summary
run: |
echo "🚀 Release v${{ env.NEW_VERSION }} completed successfully!"
echo "📝 Release notes: https://github.com/${{ github.repository }}/releases/tag/v${{ env.NEW_VERSION }}"