From 2ecd448afc84de0b1069bcb3459c6cdf23dcc87f Mon Sep 17 00:00:00 2001 From: Claude Date: Thu, 29 Jan 2026 11:38:13 +0000 Subject: [PATCH] Add Codecov token and release workflow for UI-based releases - Add CODECOV_TOKEN secret to the Codecov action in ci.yml - Create cut-release.yml workflow that allows cutting releases from the GitHub UI via workflow_dispatch - The new workflow validates version format, updates pyproject.toml, commits the version bump, and creates/pushes the tag - The pushed tag then triggers the existing release.yml workflow https://claude.ai/code/session_01EbCZH6NCwRCDVVgu68bc9L --- .github/workflows/ci.yml | 1 + .github/workflows/cut-release.yml | 71 +++++++++++++++++++++++++++++++ 2 files changed, 72 insertions(+) create mode 100644 .github/workflows/cut-release.yml diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index e5b3581..8919b8f 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -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 diff --git a/.github/workflows/cut-release.yml b/.github/workflows/cut-release.yml new file mode 100644 index 0000000..15b18f1 --- /dev/null +++ b/.github/workflows/cut-release.yml @@ -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