MCPcopy Create free account
hub / github.com/angular/dev-infra / perform

Method perform

ng-dev/release/publish/actions/cut-stable.ts:41–119  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

39 }
40
41 override async perform() {
42 // This should never happen, but we add a sanity check just to be sure.
43 if (this._isNewMajor && this._train === this.active.exceptionalMinor) {
44 throw new FatalReleaseActionError('Unexpected major release of an `exceptional-minor`.');
45 }
46
47 const branchName = this._branch;
48 const newVersion = this._newVersion;
49
50 // When cutting a new stable minor/major or an exceptional minor, we want to build the
51 // notes capturing all changes that have landed in the individual `-next`/RC pre-releases.
52 const compareVersionForReleaseNotes = this.active.latest.version;
53
54 // We always remove a potential exceptional-minor indicator. If we would
55 // publish a stable version of an exceptional minor here- it would leave
56 // the exceptional minor train and the indicator should be removed.
57 const stagingOpts: StagingOptions = {
58 updatePkgJsonFn: (pkgJson) => {
59 pkgJson[exceptionalMinorPackageIndicator] = undefined;
60 },
61 };
62
63 const {pullRequest, releaseNotes, builtPackagesWithInfo, beforeStagingSha} =
64 await this.checkoutBranchAndStageVersion(
65 newVersion,
66 compareVersionForReleaseNotes,
67 branchName,
68 stagingOpts,
69 );
70
71 await this.promptAndWaitForPullRequestMerged(pullRequest);
72
73 await this.publish(
74 builtPackagesWithInfo,
75 releaseNotes,
76 beforeStagingSha,
77 branchName,
78 this._getNpmDistTag(),
79 {showAsLatestOnGitHub: true},
80 );
81
82 // If we turned an exceptional minor into the new patch, the temporary
83 // NPM dist tag for the exceptional minor can be deleted. For more details
84 // see the `CutExceptionalMinorPrereleaseAction` class.
85 if (this._train === this.active.exceptionalMinor) {
86 await ExternalCommands.invokeDeleteNpmDistTag(
87 this.projectDir,
88 'do-not-use-exceptional-minor',
89 );
90 }
91
92 // If a new major version is published and becomes the "latest" release-train, we need
93 // to set the LTS npm dist tag for the previous latest release-train (the current patch).
94 if (this._isNewMajor) {
95 const previousPatch = this.active.latest;
96 const ltsTagForPatch = getLtsNpmDistTagOfMajor(previousPatch.version.major);
97
98 // Instead of directly setting the NPM dist tags, we invoke the ng-dev command for

Callers 1

runMethod · 0.45

Calls 2

_getNpmDistTagMethod · 0.95
getLtsNpmDistTagOfMajorFunction · 0.85

Tested by

no test coverage detected