Skip to content

release

release #2

Workflow file for this run

name: release
on:
workflow_dispatch:
inputs:
bump:
type: choice
options: [major, minor, patch]
default: patch
permissions:
contents: write
jobs:
prepare:
if: github.ref == 'refs/heads/main' || github.event_name == 'workflow_dispatch'
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with: { fetch-depth: 0 }
- uses: actions/setup-python@v5
with: { python-version: "3.10" }
- run: |
python -m pip install --upgrade pip requests
chmod +x scripts/bump_version.py
- id: bump
run: |
NEWVER=$(python scripts/bump_version.py "${{ inputs.bump }}")
echo "new_version=$NEWVER" >> $GITHUB_OUTPUT
echo "Version -> $NEWVER"
- name: commit + tag
run: |
git config user.name "github-actions[bot]"
git config user.email "github-actions[bot]@users.noreply.github.com"
git add pyproject.toml || true
git commit -m "chore: bump version to ${{ steps.bump.outputs.new_version }}" || true
git push origin main
git tag -a "v${{ steps.bump.outputs.new_version }}" -m "release v${{ steps.bump.outputs.new_version }}"
git push origin "v${{ steps.bump.outputs.new_version }}"