From 4029a8445b0ad35f29b7bfe066805dde6383af3d Mon Sep 17 00:00:00 2001 From: Alireza Date: Thu, 16 May 2024 15:03:45 -0400 Subject: [PATCH] chore: Update CircleCI workflow to include approval step before NPM publish for release branches (#4138) --- .circleci/config.yml | 9 +++++++-- version.mjs | 6 ++++-- 2 files changed, 11 insertions(+), 4 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 88ea0bcd3..410cd92dc 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -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 diff --git a/version.mjs b/version.mjs index 231d13a67..bcd8fb757 100644 --- a/version.mjs +++ b/version.mjs @@ -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);