Skip to content

ci: Release automation with release-please - #1398

Open
wojtas000 wants to merge 10 commits into
google:mainfrom
wojtas000:ci/release-please-version-automation
Open

ci: Release automation with release-please#1398
wojtas000 wants to merge 10 commits into
google:mainfrom
wojtas000:ci/release-please-version-automation

Conversation

@wojtas000

@wojtas000 wojtas000 commented Aug 24, 2026

Copy link
Copy Markdown
Contributor

Problem

internal/version.Version is edited by hand before every release, and nothing fails
when that is missed - so it drifts. main shipped v2.1.0 and v2.2.0 while still
reporting 2.0.0. The value reaches users: it is sent to Gemini in the
google-adk/<version> header, attached to every OTel trace and log as the
instrumentation version, and reported as the MCP client version.

Solution

Adopt Release Please - tool adk-python already releases with - to maintain the constant instead.

On each push to a release line, Release Please keeps a single open release PR that
bumps the annotated constant, regenerates CHANGELOG.md (optional) and updates the manifest.
Merging that PR tags the merge commit and publishes the release, so a tag can only
land on a commit whose constant already matches
.

main and v1 share one workflow but have separate config/manifest pairs, so the two
lines advance independently.

This also corrects the constant to 2.2.0, the current release.

Prerequisites (not in this PR)

  • RELEASE_PAT secret - a GitHub App token or PAT. A PR opened with the
    built-in GITHUB_TOKEN does not trigger other workflows, so the release PR would
    get no CI.
  • Settings → Actions → "Allow GitHub Actions to create and approve pull requests".
  • A follow-up PR porting these files to v1 (keeping its own 1.6.0 constant).
    Until then only main releases through this.
  • TBD - do we want CHANGELOG.md or not (it is optional, Adk Python has it. But if we want it, we also should decide if the first changelog entry is the current release, or we populate it with previous releases also)
  • TBD - naming convention for commits (for now taken from Adk python release-please config)

Testing Plan

Validated end to end on a scratch repository using the same config.
go test -race -mod=readonly -count=1 -shuffle=on work green

Notes

  • Only conventional-commit subjects count toward the version and the changelog; unprefixed commits are silently ignored
  • Majors stay manual: a feat!: would propose v3.0.0, but a Go major bump also
    requires moving the module path to /v3, which the tool cannot do.

internal/version.Version is edited by hand and nothing fails when the bump is
missed, so it drifts from the release tag: main shipped v2.1.0 and v2.2.0 while
still reporting 2.0.0. Approach A fixes this with a bespoke workflow that pushes
the bump to main, which needs github-actions[bot] on the branch-protection
bypass list.

Release Please gets the same result without that grant. It keeps one open
release PR that rewrites the annotated constant, regenerates CHANGELOG.md and
updates the manifest; merging that PR tags the merge commit, so a tag can only
land on a commit whose constant already matches, and the bump goes through
ordinary review. adk-python already releases this way, so this also aligns the
two repos.

Correct the constant to 2.2.0 (the current release) to seed the manifest, and
document the flow, the conventional-commit requirement and the /v3 major-bump
caveat in CONTRIBUTING.md.

This is approach C of the version-drift RFC; approach A is on
approach-a-release-workflow-bump and approach B on
approach-b-derive-version-from-buildinfo.
adk-python stores both files there (.github/release-please-config.json and
.github/.release-please-manifest.json, with a second -v1 pair for the
maintenance line) and keeps the repository root clear of them. Match that layout
so the two repos are configured the same way and the root stays reserved for Go
module files.
The v1 branch is a separate release line on the unsuffixed
google.golang.org/adk module path, with its own tags and its own copy of the
version constant, so it cannot share main's manifest: one manifest holds one
current version per package.

Add .github/release-please-config-v1.json and
.github/.release-please-manifest-v1.json, seeded at 1.6.0, which is where the v1
constant and the latest v1 tag already agree. The workflow now triggers on both
branches, selects the pair from the branch it runs on, and passes target-branch
explicitly so a v1 run cannot open a release PR against main. Concurrency is
keyed per line so the two do not block each other.

This mirrors adk-python, which keeps a -v1 config and manifest pair alongside
the main ones and selects between them in release-cut.yml.
Forks inherit the workflow, so every push to a fork's main would start a release
run: without RELEASE_PLEASE_TOKEN it fails, and with one it would try to cut a
real release from the fork. Guard the job on the repository name, as
adk-python's release-cut.yml does.
The pin was taken from refs/tags/v4's object SHA, but v4 is an annotated tag, so
that SHA identifies the tag object rather than the commit it wraps. zizmor's
ref-version-mismatch check flags the pin as disagreeing with its "# v4" comment,
because the tag actually resolves to 5c625bfb5d1f.

Pin that commit instead, which is also what adk-python pins.
…or-facing

Drop the extra "deps" section: adk-go has no deps-typed commits, because
dependabot writes chore(deps), which maps to the hidden chore section. Removing
it leaves exactly the ten sections adk-python uses, in the same order, so the two
repos produce comparably shaped release notes.

Move the release mechanics out of CONTRIBUTING.md. Only maintainers cut releases,
and the details (token setup, the v1 pair, the /vN major caveat) belong in the
release playbook next to the rest of the procedure. What a contributor needs is
one rule, so state it where PR requirements already live: titles are conventional
commits, they become the squashed commit subject, and an unrecognised type is
silently dropped from the notes and the version calculation.
@wojtas000 wojtas000 changed the title Ci/release please version automation ci: release-please version automation Aug 24, 2026
adk-python stores the equivalent credential as RELEASE_PAT. Using the same name
means whoever provisions or rotates it recognises it across both repositories,
and the release playbook can describe one secret rather than two names for the
same thing.
@wojtas000
wojtas000 force-pushed the ci/release-please-version-automation branch from 45c76cc to 9f4ec4a Compare August 25, 2026 08:36
@wojtas000 wojtas000 changed the title ci: release-please version automation ci: Release automation with release-please Aug 25, 2026
@wojtas000
wojtas000 marked this pull request as ready for review August 25, 2026 08:55
@wojtas000
wojtas000 requested a review from wolo-lab August 25, 2026 11:57
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.

1 participant