From 9a21a17f565588706d8073f7e14c29cf0d65f18b Mon Sep 17 00:00:00 2001 From: Luke Karrys Date: Thu, 23 Mar 2023 11:33:21 -0700 Subject: [PATCH] fix: only show test step for manual publish (#297) --- bin/release-manager.js | 41 ++++++++++++++++++++++++----------------- 1 file changed, 24 insertions(+), 17 deletions(-) diff --git a/bin/release-manager.js b/bin/release-manager.js index 69686c6f..5e29084c 100755 --- a/bin/release-manager.js +++ b/bin/release-manager.js @@ -16,7 +16,17 @@ const args = process.argv.slice(2).reduce((acc, a) => { return acc }, {}) -const PUBLISH_STEPS = ` +/* eslint-disable max-len */ +const MANUAL_PUBLISH_STEPS = ` +1. Checkout the release branch and test + + \`\`\`sh + gh pr checkout --force + npm ${args.lockfile ? 'ci' : 'update'} + npm test + gh pr checks -R {NWO} --watch + \`\`\` + 1. Publish workspaces \`\`\`sh @@ -28,30 +38,26 @@ const PUBLISH_STEPS = ` \`\`\`sh npm publish \`\`\` -` -/* eslint-disable max-len */ -const DEFAULT_RELEASE_PROCESS = ` -1. Checkout the release branch and test +1. Merge release PR \`\`\`sh - gh pr checkout --force - npm ${args.lockfile ? 'ci' : 'update'} - npm test - gh pr checks --watch + gh pr merge -R {NWO} --rebase + git checkout + git fetch + git reset --hard origin/ \`\`\` +` -${!args.publish ? PUBLISH_STEPS : ''} - -1. Merge release PR ${args.publish ? `:rotating_light: Merging this will auto publish :rotating_light:` : ''} +const AUTO_PUBLISH_STEPS = ` +1. Merge release PR :rotating_light: Merging this will auto publish :rotating_light: \`\`\`sh - gh pr merge --rebase - git checkout - git fetch - git reset --hard origin/ + gh pr merge -R {NWO} --rebase \`\`\` +` +const DEFAULT_RELEASE_PROCESS = (args.publish ? AUTO_PUBLISH_STEPS : MANUAL_PUBLISH_STEPS) + ` 1. Check For Release Tags Release Please will run on the just pushed release commit and create GitHub releases and tags for each package. @@ -59,7 +65,8 @@ ${!args.publish ? PUBLISH_STEPS : ''} \`\`\` gh run watch \`gh run list -R {NWO} -w release -b -L 1 --json databaseId -q ".[0].databaseId"\` \`\`\` -` /* eslint-enable max-len */ +` +/* eslint-enable max-len */ const getReleaseProcess = async ({ owner, repo }) => { const RELEASE_LIST_ITEM = /^\d+\.\s/gm