Skip to content

Commit

Permalink
feat(release): allow {releaseGroupName} to be interpolated in release…
Browse files Browse the repository at this point in the history
…TagPattern (#27190)
  • Loading branch information
JamesHenry committed Jul 29, 2024
1 parent 5e328cb commit ee2c41b
Show file tree
Hide file tree
Showing 7 changed files with 372 additions and 1 deletion.
2 changes: 2 additions & 0 deletions docs/shared/recipes/nx-release/get-started-with-nx-release.md
Original file line number Diff line number Diff line change
Expand Up @@ -270,6 +270,8 @@ For this same example, if you want the commit message to be 'chore(release): 1.2
}
```

When using release groups in which the member projects are versioned together, you can also leverage `{releaseGroupName}` and it will be interpolated appropriately in the commit/tag that gets created for that release group.

## Future Releases

After the first release, the `--first-release` option will no longer be required. Nx Release will expect to find git tags and changelog files for each package. It will also use `npm view` to look up the current version of packages before publishing, ensuring that the package has not already been published and therefore avoid any conflict errors, meaning you can run the same publish action multiple times without any negative side-effects.
Expand Down
2 changes: 2 additions & 0 deletions docs/shared/recipes/nx-release/publish-rust-crates.md
Original file line number Diff line number Diff line change
Expand Up @@ -209,6 +209,8 @@ For this same example, if you want the commit message to be 'chore(release): 1.2
}
```

When using release groups in which the member projects are versioned together, you can also leverage `{releaseGroupName}` and it will be interpolated appropriately in the commit/tag that gets created for that release group.

## Future Releases

After the first release, the `--first-release` option will no longer be required. Nx Release will expect to find git tags and changelog files for each package.
Expand Down
2 changes: 1 addition & 1 deletion docs/shared/reference/nx-json.md
Original file line number Diff line number Diff line change
Expand Up @@ -347,7 +347,7 @@ The `projectsRelationship` property tells Nx whether to release projects indepen

Optionally override the git/release tag pattern to use. This field is the source of truth for changelog generation and release tagging, as well as for conventional commits parsing.

It supports interpolating the version as `{version}` and (if releasing independently or forcing project level version control system releases) the project name as `{projectName}` within the string.
It supports interpolating the version as `{version}` and (if releasing independently or forcing project level version control system releases) the project name as `{projectName}` within the string. When using release groups in which the member projects are versioned together, you can also leverage `{releaseGroupName}` and it will be interpolated appropriately in the commit/tag that gets created for that release group.

The default `"releaseTagPattern"` for fixed/unified releases is: `v{version}`

Expand Down
1 change: 1 addition & 0 deletions packages/nx/src/command-line/release/changelog.ts
Original file line number Diff line number Diff line change
Expand Up @@ -497,6 +497,7 @@ export async function releaseChangelog(
(
await getLatestGitTagForPattern(releaseGroup.releaseTagPattern, {
projectName: project.name,
releaseGroupName: releaseGroup.name,
})
)?.tag;

Expand Down
Loading

0 comments on commit ee2c41b

Please sign in to comment.