Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -124,6 +124,7 @@ jobs:
- name: Upload coverage to Codecov
uses: codecov/codecov-action@v5
with:
token: ${{ secrets.CODECOV_TOKEN }}
files: ./coverage.xml
fail_ci_if_error: false
verbose: true
71 changes: 71 additions & 0 deletions .github/workflows/cut-release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,71 @@
name: Cut Release

on:
workflow_dispatch:
inputs:
version:
description: 'Version to release (e.g., v0.2.0 or v0.2.0-beta1)'
required: true
type: string

permissions:
contents: write

jobs:
cut-release:
name: Cut Release
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0

- name: Validate version format
run: |
VERSION="${{ github.event.inputs.version }}"
if [[ ! "$VERSION" =~ ^v[0-9]+\.[0-9]+\.[0-9]+(-[a-zA-Z0-9]+)?$ ]]; then
echo "Error: Version must be in format v0.0.0 or v0.0.0-suffix"
echo "Got: $VERSION"
exit 1
fi
echo "VERSION=$VERSION" >> $GITHUB_ENV
# Strip the 'v' prefix for pyproject.toml
echo "VERSION_NUM=${VERSION#v}" >> $GITHUB_ENV

- name: Check if tag already exists
run: |
if git rev-parse "$VERSION" >/dev/null 2>&1; then
echo "Error: Tag $VERSION already exists"
exit 1
fi

- name: Update version in pyproject.toml
run: |
sed -i "s/^version = \".*\"/version = \"$VERSION_NUM\"/" pyproject.toml
echo "Updated pyproject.toml to version $VERSION_NUM"
grep "^version" pyproject.toml

- name: Configure git
run: |
git config user.name "github-actions[bot]"
git config user.email "github-actions[bot]@users.noreply.github.com"

- name: Commit version bump
run: |
git add pyproject.toml
git commit -m "Bump version to $VERSION"

- name: Create and push tag
run: |
git tag -a "$VERSION" -m "Release $VERSION"
git push origin HEAD:${{ github.ref_name }}
git push origin "$VERSION"

- name: Summary
run: |
echo "## Release $VERSION created!" >> $GITHUB_STEP_SUMMARY
echo "" >> $GITHUB_STEP_SUMMARY
echo "The tag \`$VERSION\` has been pushed and will trigger the release workflow." >> $GITHUB_STEP_SUMMARY
echo "" >> $GITHUB_STEP_SUMMARY
echo "Check the [Release workflow](/${{ github.repository }}/actions/workflows/release.yml) for progress." >> $GITHUB_STEP_SUMMARY