Skip to content
Draft
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
36 changes: 32 additions & 4 deletions .github/workflows/version_bump.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
name: version_bump
permissions:
contents: write
pull-requests: write
on: workflow_dispatch
jobs:
build:
Expand All @@ -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."