Skip to content

chore: add release automation script and bot-PR workflow#625

Merged
lwshang merged 2 commits into
mainfrom
linwei.shang/release-automation
Jun 25, 2026
Merged

chore: add release automation script and bot-PR workflow#625
lwshang merged 2 commits into
mainfrom
linwei.shang/release-automation

Conversation

@lwshang

@lwshang lwshang commented Jun 24, 2026

Copy link
Copy Markdown
Contributor

Summary

Replaces the agent-driven release skill with a deterministic, local shell script plus one bot-authored-PR workflow. Now that releases are stable-only and the procedure is fixed, an AI agent is overkill; a script is a better fit and needs no new repo/org settings.

.github/workflows/release-pr.yml

A workflow_dispatch workflow that opens a release PR authored by the pr-automation-bot-public GitHub App (the same App + secrets bump-network-launcher.yml already uses). Because the bot authors the PR, a single release driver can approve it without a second reviewer. One kind input handles both:

  • version-bump: bumps the workspace version, cargo update --workspace for Cargo.lock, and promotes # Unreleased# vX.Y.Z in the changelog.
  • docs-versions: adds the new docs version to docs-site/versions.json.

scripts/release.sh

./scripts/release.sh <VERSION> drives the whole release: bump PR → tag + push → cargo-dist Release workflow → npm → homebrew-tap → docs versions. It pauses only for the 2–3 PR approvals (version bump, homebrew-tap, and — for a new minor — docs versions). Clear per-step failure reporting with URLs; no automatic rollback by design. Re-running with the same version reuses any PR/tag that already exists.

Why this works without settings changes

  • The bot-authored bump PR sidesteps the "can't approve your own PR" rule, so one driver approves.
  • The driver pushes the tag locally with their own credentials, so the GITHUB_TOKEN-doesn't-trigger-workflows limitation never applies.
  • The driver's gh auth already spans dfinity/homebrew-tap, so no cross-repo dispatch token is needed.

Before first use

  • Merge this PR firstworkflow_dispatch only works once release-pr.yml is on the default branch.
  • The .claude/skills/release/ skill is intentionally kept for now; remove it after the first successful run of the new script.

Follow-up (deferred)

docs-site/versions.json currently keys by major.minor, matching today's docs.yml deploy path — so a future v1.1.0 would add a /1.1/ entry. Whether the whole 1.x line should collapse to a single /1/ major version (with /2/ next) is a team decision tracked separately; this PR keeps the existing behavior.

Validation

shellcheck clean; YAML parses; the version-bump awk transforms, the docs versions.json jq (new-minor and patch/no-op cases), and both rendered PR bodies were tested against the real repo files.

🤖 Generated with Claude Code

Replaces the agent-driven release skill with a deterministic local script
plus one bot-authored-PR workflow, now that releases are stable-only and the
procedure is fixed.

- .github/workflows/release-pr.yml: opens a release PR (version bump or docs
  versions.json bump) as the pr-automation-bot-public App, so a single release
  driver can approve it without a second reviewer. No new repo/org settings.
- scripts/release.sh: orchestrates the release end to end (bump PR -> tag ->
  Release workflow -> npm -> homebrew-tap -> docs versions), pausing only for
  the 2-3 PR approvals. Clear per-step failure reporting; no auto rollback.

The .claude/skills/release/ skill is left in place and can be removed after the
first successful run of the new script.

Follow-up (deferred): docs versions.json currently keys by major.minor, so a
future v1.1.0 would add a /1.1/ entry. Whether 1.x docs should collapse to a
single /1/ major version is a team decision tracked separately.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@lwshang lwshang marked this pull request as ready for review June 24, 2026 16:16
@lwshang lwshang requested a review from a team as a code owner June 24, 2026 16:16

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR introduces a deterministic release process for icp-cli by replacing the prior agent-driven approach with a local driver script plus a GitHub Actions workflow that opens bot-authored release PRs.

Changes:

  • Add scripts/release.sh to drive the end-to-end stable release flow (bump PR → tag → workflows → npm → homebrew-tap → docs versions).
  • Add .github/workflows/release-pr.yml to open bot-authored PRs for version bumps and docs version updates via workflow_dispatch.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 5 comments.

File Description
scripts/release.sh New local release driver script orchestrating PR creation/approval, tagging, workflow watching, and downstream publish steps.
.github/workflows/release-pr.yml New workflow to open release PRs (version bump or docs versions) authored by the PR automation GitHub App.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread scripts/release.sh
Comment thread scripts/release.sh Outdated
Comment thread scripts/release.sh
Comment thread .github/workflows/release-pr.yml Outdated
Comment thread .github/workflows/release-pr.yml Outdated
Comment thread scripts/release.sh Outdated
- release.sh: skip the version-bump PR when origin/main is already at the
  target version, so re-running after a merged bump no longer re-opens the PR
  (and can't trigger a duplicate CHANGELOG header).
- release.sh: dispatch npm by workflow filename (release-npm.yml) instead of
  the display name, for an unambiguous identifier.
- release.sh: harden the docs versions.json read — fail clearly on a parse
  error or multiple `latest:true` entries instead of silently proceeding.
- release-pr.yml: make CHANGELOG promotion idempotent (skip if a `# vX.Y.Z`
  header already exists) so a re-dispatch can't duplicate the section.
- release-pr.yml: clarify the `cargo update --workspace` comment (it re-locks
  only the workspace members' versions, not dependency versions).

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@lwshang lwshang merged commit d606bc1 into main Jun 25, 2026
90 checks passed
@lwshang lwshang deleted the linwei.shang/release-automation branch June 25, 2026 14:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants