Skip to content

Commit 2d23cb7

Browse files
author
Horia Iacos
committed
fix: Release workflow to allow canary releases on develop branch
1 parent c00fd82 commit 2d23cb7

1 file changed

Lines changed: 12 additions & 5 deletions

File tree

scripts/release

Lines changed: 12 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -191,7 +191,7 @@ const build = () => {
191191
*/
192192
const test = () => {
193193
const workers = os.cpus().length || 1;
194-
log(chalk.magenta(`--- STEP 4: TEST ---`));
194+
log(chalk.magenta(`--- STEP 5: TEST ---`));
195195
runCmd(`${binary('jest')} -w ${workers}`);
196196
};
197197

@@ -208,16 +208,23 @@ const test = () => {
208208
* - If the `argv.loglevel` flag is provided, the specified log level will be included in the publishing command.
209209
*/
210210
const release = () => {
211-
log(chalk.magenta('--- STEP 5: VERSION PACKAGES ---'));
211+
if (argv.next) {
212+
log(chalk.magenta('--- STEP 6: NEXT/CANARY RELEASE ---'));
213+
let releaseCmd = 'npx lerna publish --canary --preid next --dist-tag next --include-merged-tags --yes';
214+
if (argv.loglevel) releaseCmd += ` --loglevel ${argv.loglevel}`;
215+
runCmd(releaseCmd);
216+
return;
217+
}
218+
219+
log(chalk.magenta('--- STEP 6: VERSION PACKAGES ---'));
212220
runCmd('npx lerna version --conventional-commits --yes');
213221

214-
log(chalk.magenta('--- STEP 6: PUBLISH PACKAGES ---'));
222+
log(chalk.magenta('--- STEP 7: PUBLISH PACKAGES ---'));
215223
let releaseCmd = 'npx lerna publish from-git --yes';
216-
if (argv.next) releaseCmd += ' --canary --preid next --dist-tag next';
217224
if (argv.loglevel) releaseCmd += ` --loglevel ${argv.loglevel}`;
218225
runCmd(releaseCmd);
219226

220-
log(chalk.magenta('--- STEP 7: PUSH TAGS ---'));
227+
log(chalk.magenta('--- STEP 8: PUSH TAGS ---'));
221228
runCmd(`git push origin ${getCurrentBranch()} --follow-tags`);
222229
};
223230

0 commit comments

Comments
 (0)