Skip to content
Merged
Show file tree
Hide file tree
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
11 changes: 8 additions & 3 deletions docs/setup/bootstrap.md
Original file line number Diff line number Diff line change
Expand Up @@ -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"`.
Expand Down
3 changes: 2 additions & 1 deletion release-please-config.json
Original file line number Diff line number Diff line change
Expand Up @@ -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"
}
24 changes: 17 additions & 7 deletions scripts/bootstrap.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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"
}
Expand Down