Skip to content

Commit 83989d0

Browse files
devversionmmalerba
authored andcommitted
build: populate release version placeholder properly (#17245)
Currently we always append the SHA of `HEAD` to the version placeholder. We only want to append the SHA of `HEAD` to the version if we are publishing snapshot build artifacts to the Github build repositories. This also fixes that the SHA is appended twice to snapshot builds release output. e.g. https://github.com/angular/cdk-builds/blob/master/package.json#L3.
1 parent 94cec9f commit 83989d0

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

tools/bazel-stamp-vars.js

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,10 @@ const packageJson = require('../package');
1212

1313
const currentCommitSha = getCurrentCommitSha();
1414

15-
// The "BUILD_SCM_VERSION" will be picked up by the "npm_package" and "ng_package" rule
16-
// in order to replace the "0.0.0-PLACEHOLDER" with a proper version
17-
console.log(`BUILD_SCM_VERSION ${packageJson.version}-${currentCommitSha.substr(0, 7)}`);
15+
// The "BUILD_SCM_VERSION" will be picked up by the "npm_package" and "ng_package"
16+
// rule in order to populate the "0.0.0-PLACEHOLDER". Note that the SHA will be only
17+
// appended for snapshots builds from within the "publish-build-artifacts.sh" script.
18+
console.log(`BUILD_SCM_VERSION ${packageJson.version}`);
1819
console.log(`BUILD_SCM_COMMIT_SHA ${currentCommitSha}`);
1920
console.log(`BUILD_SCM_BRANCH ${getCurrentBranchName()}`);
2021
console.log(`BUILD_SCM_USER ${getCurrentGitUser()}`);

0 commit comments

Comments
 (0)