Skip to content

Commit

Permalink
update release script with main_v1 branch name
Browse files Browse the repository at this point in the history
  • Loading branch information
slimbuck committed May 21, 2024
1 parent f18375a commit 890ff70
Showing 1 changed file with 8 additions and 6 deletions.
14 changes: 8 additions & 6 deletions release.cjs
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,12 @@ const { execSync } = require('child_process');
const readline = require('readline');
const fs = require('fs');

const devBranchName = 'main_v1';

const releaseBranchName = 'release-';

const printUsage = () => {
console.log(`Run without arguments to perform operation based on current branch (main or release-1.XX branch).
console.log(`Run without arguments to perform operation based on current branch (${devBranchName} or release-1.XX branch).
Or specify the operation as an argument:
create-release - create the next minor release branch '${releaseBranchName}1.XX'. invoke from main branch.
finalize-release - finalize the package version and tag the release. invoke from release branch.
Expand Down Expand Up @@ -112,15 +114,15 @@ const getUserConfirmation = (question, callback) => {
// updates package versions on main and newly created release branch.
const createRelease = (mainBranch) => {
// check branch name
if (mainBranch !== 'main') {
console.log(`warning: source branch is not 'main'.`);
if (mainBranch !== devBranchName) {
console.log(`warning: source branch is not '${devBranchName}'.`);
}

// read current package version. this contains the version we're releasing.
const mainVersion = readPackageVersion();
if (mainVersion.build !== 'main') {
if (mainVersion.build !== devBranchName) {
// say something?
console.warn(`warning: package isn't tagged as 'main' build.`);
console.warn(`warning: package isn't tagged as '${devBranchName}' build.`);
}

// build release branch string
Expand Down Expand Up @@ -198,7 +200,7 @@ const run = () => {
// use current branch to decide operation
const curBranch = getCurrentBranch();

if (curBranch === 'main') {
if (curBranch === devBranchName) {
createRelease(curBranch);
return 0;
} else if (curBranch.startsWith(releaseBranchName)) {
Expand Down

0 comments on commit 890ff70

Please sign in to comment.