From 6e44e54bc5e7c9e3ecbe779ef9af614d856899dc Mon Sep 17 00:00:00 2001 From: TzuHsuan <96853116+TzuH-Hsu@users.noreply.github.com> Date: Tue, 15 Sep 2026 23:46:07 +0800 Subject: [PATCH] chore: replace the stale release-as guidance with initial-version Port of TzuH-Hsu/github-project-os#39 (06662a5). release-please-config.json gains initial-version: 0.1.0 (inert here, the repo already has v0.1.0); docs/setup/bootstrap.md and scripts/bootstrap.sh stop describing a release-as pin that never existed in this repo's config. Co-Authored-By: Claude Opus 5 --- docs/setup/bootstrap.md | 11 ++++++++--- release-please-config.json | 3 ++- scripts/bootstrap.sh | 24 +++++++++++++++++------- 3 files changed, 27 insertions(+), 11 deletions(-) diff --git a/docs/setup/bootstrap.md b/docs/setup/bootstrap.md index b572818..73f4ce4 100644 --- a/docs/setup/bootstrap.md +++ b/docs/setup/bootstrap.md @@ -167,9 +167,14 @@ EOF echo '{".": "0.0.0"}' > .release-please-manifest.json ``` -`release-please-config.json` keeps `"release-as": "0.1.0"` after de-templating -— your first release is v0.1.0. Remove that key once the first release ships -so subsequent releases follow normal Conventional Commit version bumps. +`release-please-config.json` carries `"initial-version": "0.1.0"`, which is +what makes your first release v0.1.0. release-please reads that key only while +the repository has no release at all; after the first one ships it is inert, so +there is nothing to remove. Without it release-please numbers the first release +**1.0.0** — the manifest's `0.0.0` is explicitly ignored as a previous version, +so `bump-minor-pre-major` never gets a chance to run. (Both `bump-minor-pre-major` +and `bump-patch-for-minor-pre-major` apply only once a release exists and its +version is below 1.0.0.) The script checks the key is present and warns if not. The script does not run `git commit`. Review `git status` and commit yourself: `git commit -m "chore: bootstrap repository"`. diff --git a/release-please-config.json b/release-please-config.json index aad8456..a8bfe4c 100644 --- a/release-please-config.json +++ b/release-please-config.json @@ -8,5 +8,6 @@ "include-component-in-tag": false, "pull-request-title-pattern": "chore: release ${version}", "bump-minor-pre-major": true, - "bump-patch-for-minor-pre-major": false + "bump-patch-for-minor-pre-major": false, + "initial-version": "0.1.0" } diff --git a/scripts/bootstrap.sh b/scripts/bootstrap.sh index 95d57f5..ea77f78 100755 --- a/scripts/bootstrap.sh +++ b/scripts/bootstrap.sh @@ -872,13 +872,23 @@ EOF ok "${manifest} rewritten to {\".\": \"0.0.0\"}" fi - cat <<'EOF' - -Note: release-as: 0.1.0 stays in release-please-config.json — your first -release is v0.1.0; remove that key afterwards so subsequent releases -follow normal Conventional Commit bumps. -EOF - manual "Remove the 'release-as: 0.1.0' key from release-please-config.json after your first release ships" + # First-release version. With the manifest at 0.0.0 release-please has no + # latestRelease, so bump-minor-pre-major never runs and it falls through to + # its hardcoded 1.0.0 -- unless the config carries initial-version. That key + # is read only while no release exists, so it needs no cleanup afterwards. + # Read-only: the config is a checked-in file the adopter owns, and gh is the + # only hard dependency (the --jq flags elsewhere are gh's own), so plain sed. + local rp_config='release-please-config.json' + local initial_version="" + if [ -f "$rp_config" ]; then + initial_version="$(sed -n 's/^[[:space:]]*"initial-version"[[:space:]]*:[[:space:]]*"\([^"]*\)".*/\1/p' "$rp_config" | head -n1)" + fi + if [ -n "$initial_version" ]; then + ok "${rp_config} initial-version is ${initial_version} — first release will be v${initial_version}" + else + warn "${rp_config} has no initial-version — release-please will number the first release 1.0.0" + manual "Add '\"initial-version\": \"0.1.0\"' to release-please-config.json so the first release matches the v0.1.0 milestone" + fi record_phase "8. De-template" "ok" }