@@ -45,38 +45,43 @@ For `TARGET_VERSION=12.0.1`, this effectively runs `release-it 12.0.1 --ci`. The
4545
4646## Current and Target Versions
4747
48- The ` . release-it.json ` configuration uses two variables supplied by ` release-it ` :
48+ The release step passes two workflow outputs through its environment :
4949
50- - ` ${latestVersion} ` is the version read from the Android ` VERSION ` file before it is bumped. It
51- is the current completed release, such as ` 12.0.0 ` .
52- - ` ${version} ` is the target version passed to ` release-it ` , such as ` 12.0.1 ` .
50+ - ` $CURRENT_VERSION ` is the version read from the Android ` VERSION ` file before it is bumped. It is
51+ the current completed release, such as ` 12.0.0 ` .
52+ - ` $TARGET_VERSION ` is the version calculated by the workflow and passed to ` release-it ` , such as
53+ ` 12.0.1 ` .
54+
55+ These are workflow environment variables rather than release-it template variables. Release-it
56+ generates ` git.changelog ` before it adds its ` latestVersion ` and ` version ` values to the global
57+ template context, so those template variables are not available when this command is rendered.
5358
5459The ` @release-it/bumper ` plugin's ` in ` configuration makes the Android ` VERSION ` file the source
55- of ` latestVersion ` . Its ` out ` configuration writes ` version ` back to that file during the bump. The
56- plugin does not choose the target version; the workflow passes that version as the positional
57- argument. Without this plugin, release-it would normally read the current version from
58- ` package.json ` or the latest Git tag and persist the target through its corresponding version
59- mechanism.
60+ of release-it's current version . Its ` out ` configuration writes release-it's target version back to
61+ that file during the bump. The plugin does not choose the target version; the workflow passes that
62+ version as the positional argument. Without this plugin, release-it would normally read the current
63+ version from ` package.json ` or the latest Git tag and persist the target through its corresponding
64+ version mechanism.
6065
6166## Release Notes and ` CHANGELOG.md `
6267
6368The two ` auto-changelog ` commands serve different phases of the release:
6469
65701 . ` git.changelog ` runs before the bump and writes release-note text to standard output. The
66- ` --unreleased --latest-version ${latestVersion} ` arguments mean "collect changes after the
67- selected branch's current completed release through ` HEAD ` ." Pinning ` latestVersion ` prevents a
71+ ` --unreleased --latest-version $CURRENT_VERSION ` arguments mean "collect changes after the
72+ selected branch's current completed release through ` HEAD ` ." Pinning ` CURRENT_VERSION ` prevents a
6873 newer tag from another release line, such as ` 12.1.0 ` , from becoming the boundary for a
6974 ` 12.0.1 ` maintenance release.
70- 2 . The ` after:bump ` hook regenerates and stages ` CHANGELOG.md ` . At this point ` ${version} ` is the
71- new target, so ` --latest-version ${version} ` assigns those formerly unreleased changes to the
72- new ` 12.0.1 ` section.
75+ 2 . The ` after:bump ` hook regenerates and stages ` CHANGELOG.md ` . At this point ` $TARGET_VERSION ` is
76+ the new target, so ` --latest-version $TARGET_VERSION ` assigns those formerly unreleased changes
77+ to the new ` 12.0.1 ` section.
7378
7479For a ` 12.0.1 ` maintenance release, the lifecycle is therefore:
7580
7681``` text
7782VERSION contains 12.0.0
78- → latestVersion = 12.0.0
83+ → CURRENT_VERSION = 12.0.0
7984 → collect commits after 12.0.0 as unreleased release notes
80- → bump to version = 12.0.1
85+ → bump to TARGET_VERSION = 12.0.1
8186 → write those commits under 12.0.1 in CHANGELOG.md
8287```
0 commit comments