From c98d58a8166882bd9288d2a30ec531f32ee31e4d Mon Sep 17 00:00:00 2001 From: crowlbot Date: Wed, 29 Apr 2026 11:38:55 +0000 Subject: [PATCH] chore: switch version_bump workflow to `deno bump-version` Replaces the dependency on `jsr:@deno/bump-workspaces` with the workspace-aware `deno bump-version` subcommand introduced in denoland/deno#33689. The Rust tool handles the same conventional-commit parsing, jsr: import-map rewriting, and Releases.md generation, while branch creation and PR opening move into this workflow (using `gh pr`). The workflow now: - pins to a Deno version that includes the workspace-aware bump-version, - runs `deno bump-version --import-map import_map.json` at the workspace root (auto-detects workspace mode and conventional-commits mode when no increment is passed), - creates a release branch + PR with the resulting changes. --- .github/workflows/version_bump.yml | 36 ++++++++++++++++++++++++++---- 1 file changed, 32 insertions(+), 4 deletions(-) diff --git a/.github/workflows/version_bump.yml b/.github/workflows/version_bump.yml index bd0a975cd281..2ca13c61bf4e 100644 --- a/.github/workflows/version_bump.yml +++ b/.github/workflows/version_bump.yml @@ -1,6 +1,7 @@ name: version_bump permissions: contents: write + pull-requests: write on: workflow_dispatch jobs: build: @@ -11,17 +12,44 @@ jobs: steps: - name: Clone repository uses: actions/checkout@v6 + with: + token: ${{ secrets.DENOBOT_PAT }} - name: Set up Deno uses: denoland/setup-deno@v2 with: + # Pin to a Deno version that ships the workspace-aware + # `deno bump-version` (see denoland/deno#33689). + deno-version: canary cache: true + - name: Determine release branch + id: branch + run: echo "name=release-$(date -u +%Y-%m-%d-%H-%M-%S)" >> "$GITHUB_OUTPUT" + - name: Run version bump run: | git fetch --unshallow origin - deno run -A jsr:@deno/bump-workspaces@^0.1/cli --import-map import_map.json + deno bump-version --import-map import_map.json + + - name: Commit and push env: - GITHUB_TOKEN: ${{ secrets.DENOBOT_PAT }} - GIT_USER_NAME: ${{ github.actor }} - GIT_USER_EMAIL: ${{ github.actor}}@users.noreply.github.com + GH_TOKEN: ${{ secrets.DENOBOT_PAT }} + BRANCH: ${{ steps.branch.outputs.name }} + run: | + if git diff --quiet; then + echo "No version bumps detected; nothing to do." + exit 0 + fi + git config user.name "${{ github.actor }}" + git config user.email "${{ github.actor }}@users.noreply.github.com" + git checkout -b "$BRANCH" + git add . + git commit -m "chore: update versions" + git push origin "$BRANCH" + gh pr create \ + --base main \ + --head "$BRANCH" \ + --draft \ + --title "chore: release $(date -u +%Y.%m.%d)" \ + --body "Automated release PR generated by \`deno bump-version\`. Review the version bumps and \`Releases.md\` before merging."