From 6e1f7cd96503f034eef54736dd510e49d4d8ce90 Mon Sep 17 00:00:00 2001 From: Ben Bernard Date: Sun, 22 Feb 2026 06:59:06 -0800 Subject: [PATCH 1/2] fix: bump version to 0.2.0 to unblock release workflow The release GitHub Action was skipping the build and release jobs because the check-version job found that release v0.1.0 already exists. Since multiple changes have been merged since v0.1.0 (multiplex fixes, benchmark improvements, new features), bump to 0.2.0 so the next merge to master triggers a new release. Co-Authored-By: Claude Opus 4.6 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 7ec4f89..c64c78b 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "recs", - "version": "0.1.0", + "version": "0.2.0", "module": "src/index.ts", "type": "module", "private": true, From 7d7b9ec3adca222f2b8184b9da5b6ed527fcf6e4 Mon Sep 17 00:00:00 2001 From: Ben Bernard Date: Sun, 22 Feb 2026 07:01:42 -0800 Subject: [PATCH 2/2] ci: auto-increment patch version on every merge to master Replace the manual version-check approach with automatic patch bumping. The release workflow now determines the next version from the latest git tag (falling back to package.json if no tags exist), stamps it into package.json for the build artifacts, creates the tag, and publishes the GitHub release. No manual version bumps needed. Co-Authored-By: Claude Opus 4.6 --- .github/workflows/release.yml | 73 +++++++++++++++++++---------------- 1 file changed, 39 insertions(+), 34 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 240b168..d5b523d 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -2,8 +2,6 @@ name: Release on: push: - tags: - - 'v*' branches: - master @@ -37,40 +35,45 @@ jobs: - name: Check documentation run: bun run check-docs - check-version: + determine-version: runs-on: ubuntu-latest outputs: - should_release: ${{ steps.check.outputs.should_release }} - version: ${{ steps.check.outputs.version }} + version: ${{ steps.version.outputs.version }} + tag: ${{ steps.version.outputs.tag }} steps: - name: Checkout uses: actions/checkout@v4 + with: + fetch-depth: 0 - - name: Check if release needed - id: check - env: - GH_TOKEN: ${{ github.token }} + - name: Determine next version + id: version run: | - if [[ "${{ github.ref_type }}" == "tag" ]]; then - echo "Triggered by tag push, proceeding with release" - echo "should_release=true" >> "$GITHUB_OUTPUT" - echo "version=${{ github.ref_name }}" >> "$GITHUB_OUTPUT" + # Get the latest version tag (e.g., v0.2.0) + LATEST_TAG=$(git tag --list 'v*' --sort=-version:refname | head -n 1) + + if [ -z "$LATEST_TAG" ]; then + # No tags exist — use package.json version as the starting point + CURRENT=$(jq -r .version package.json) + echo "No existing tags found, using package.json version: $CURRENT" else - VERSION="v$(jq -r .version package.json)" - echo "Version from package.json: $VERSION" - if gh release view "$VERSION" --repo "${{ github.repository }}" >/dev/null 2>&1; then - echo "Release $VERSION already exists, skipping" - echo "should_release=false" >> "$GITHUB_OUTPUT" - else - echo "No release found for $VERSION, proceeding" - echo "should_release=true" >> "$GITHUB_OUTPUT" - fi - echo "version=$VERSION" >> "$GITHUB_OUTPUT" + # Strip the leading 'v' + CURRENT="${LATEST_TAG#v}" + echo "Latest tag: $LATEST_TAG (version: $CURRENT)" fi + # Bump patch version: split on dots, increment the last segment + IFS='.' read -r MAJOR MINOR PATCH <<< "$CURRENT" + NEXT_PATCH=$((PATCH + 1)) + NEXT_VERSION="${MAJOR}.${MINOR}.${NEXT_PATCH}" + NEXT_TAG="v${NEXT_VERSION}" + + echo "Next version: $NEXT_VERSION (tag: $NEXT_TAG)" + echo "version=$NEXT_VERSION" >> "$GITHUB_OUTPUT" + echo "tag=$NEXT_TAG" >> "$GITHUB_OUTPUT" + build: - needs: [ci, check-version] - if: needs.check-version.outputs.should_release == 'true' + needs: [ci, determine-version] strategy: matrix: include: @@ -101,6 +104,11 @@ jobs: - name: Install dependencies run: bun install + - name: Stamp version in package.json + run: | + jq '.version = "${{ needs.determine-version.outputs.version }}"' package.json > package.json.tmp + mv package.json.tmp package.json + - name: Build binary run: bun build ./bin/recs.ts --compile --target=${{ matrix.target }} --outfile=${{ matrix.artifact }} @@ -111,21 +119,17 @@ jobs: path: ${{ matrix.artifact }} release: - needs: [check-version, build] - if: needs.check-version.outputs.should_release == 'true' + needs: [determine-version, build] runs-on: ubuntu-latest steps: - name: Checkout uses: actions/checkout@v4 - - name: Create tag for version - if: github.ref_type != 'tag' - env: - GH_TOKEN: ${{ github.token }} + - name: Create tag run: | - git tag "${{ needs.check-version.outputs.version }}" - git push origin "${{ needs.check-version.outputs.version }}" + git tag "${{ needs.determine-version.outputs.tag }}" + git push origin "${{ needs.determine-version.outputs.tag }}" - name: Download all artifacts uses: actions/download-artifact@v4 @@ -135,7 +139,8 @@ jobs: - name: Create GitHub Release uses: softprops/action-gh-release@v2 with: - tag_name: ${{ needs.check-version.outputs.version }} + tag_name: ${{ needs.determine-version.outputs.tag }} + name: ${{ needs.determine-version.outputs.tag }} generate_release_notes: true files: | artifacts/recs-linux-x64/recs-linux-x64