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
23 changes: 15 additions & 8 deletions ng-dev/release/publish/actions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -136,6 +136,16 @@ export abstract class ReleaseAction {
}
}

/*
* Get the modified Aspect lock files if `rulesJsInteropMode` is enabled.
*/
protected getAspectLockFiles(): string[] {
// TODO: Remove after `rules_js` migration is complete.
return this.config.rulesJsInteropMode
? glob.sync(['.aspect/**', 'pnpm-lock.yaml'], {cwd: this.projectDir})
: [];
}

/** Gets the most recent commit of a specified branch. */
protected async getLatestCommitOfBranch(branchName: string): Promise<string> {
const {
Expand Down Expand Up @@ -221,14 +231,11 @@ export abstract class ReleaseAction {

// Commit message for the release point.
const commitMessage = getCommitMessageForRelease(newVersion);

const filesToCommit = [workspaceRelativePackageJsonPath, workspaceRelativeChangelogPath];

// Ensure modified Aspect lock files are included in the release commit.
// TODO: Remove after `rules_js` migration is complete.
if (this.config.rulesJsInteropMode) {
filesToCommit.push(...glob.sync(['.aspect/**', 'pnpm-lock.yaml'], {cwd: this.projectDir}));
}
const filesToCommit = [
workspaceRelativePackageJsonPath,
workspaceRelativeChangelogPath,
...this.getAspectLockFiles(),
];

// Create a release staging commit including changelog and version bump.
await this.createCommit(commitMessage, filesToCommit);
Expand Down
2 changes: 2 additions & 0 deletions ng-dev/release/publish/actions/configure-next-as-major.ts
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,10 @@ export class ConfigureNextAsMajorAction extends ReleaseAction {
await this.assertPassingGithubStatus(beforeStagingSha, branchName);
await this.checkoutUpstreamBranch(branchName);
await this.updateProjectVersion(newVersion);

await this.createCommit(getCommitMessageForNextBranchMajorSwitch(newVersion), [
workspaceRelativePackageJsonPath,
...this.getAspectLockFiles(),
]);
const pullRequest = await this.pushChangesToForkAndCreatePullRequest(
branchName,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,9 +48,12 @@ export class PrepareExceptionalMinorAction extends ReleaseAction {
await this.updateProjectVersion(this._newVersion, (pkgJson) => {
pkgJson[exceptionalMinorPackageIndicator] = true;
});

await this.createCommit(`build: prepare exceptional minor branch: ${this._newBranch}`, [
workspaceRelativePackageJsonPath,
...this.getAspectLockFiles(),
]);

await this.pushHeadToRemoteBranch(this._newBranch);

Log.info(green(` ✓ Version branch "${this._newBranch}" created.`));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,10 @@ export abstract class BranchOffNextBranchBaseAction extends CutNpmNextPrerelease

// Create an individual commit for the next version bump. The changelog should go into
// a separate commit that makes it clear where the changelog is cherry-picked from.
await this.createCommit(bumpCommitMessage, [workspaceRelativePackageJsonPath]);
await this.createCommit(bumpCommitMessage, [
workspaceRelativePackageJsonPath,
...this.getAspectLockFiles(),
]);

await this.prependReleaseNotesToChangelog(releaseNotes);

Expand Down
Loading