Skip to content

Commit

Permalink
chore: Update CircleCI workflow to include approval step before NPM p…
Browse files Browse the repository at this point in the history
…ublish for release branches (#4138)
  • Loading branch information
sedghi committed May 16, 2024
1 parent 19bdcbb commit 4029a84
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 4 deletions.
9 changes: 7 additions & 2 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -495,13 +495,18 @@ workflows:
- BUILD:
filters:
branches:
only: release
- NPM_PUBLISH:
only: /^release\/.*/
- HOLD_FOR_APPROVAL:
type: approval
requires:
- BUILD
- NPM_PUBLISH:
requires:
- HOLD_FOR_APPROVAL
- DOCKER_RELEASE_PUBLISH:
requires:
- NPM_PUBLISH

###
# Unit and E2E tests have already run for PR_CHECKS
# Re-running should not gain us any confidence here
Expand Down
6 changes: 4 additions & 2 deletions version.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,11 @@ async function run() {

let nextVersion;

if (branchName === 'release') {
if (branchName.startsWith('release')) {
console.log('Branch: release');
nextVersion = semver.inc(currentVersion, 'minor');
await fs.writeFile('./commit.txt', currentCommitHash);
console.log('the version is automatically picked up from the version.txt file');
return;
} else {
console.log('Branch: master');
const prereleaseComponents = semver.prerelease(currentVersion);
Expand Down

0 comments on commit 4029a84

Please sign in to comment.