Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: only show test step for manual publish #297

Merged
merged 1 commit into from
Mar 23, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
41 changes: 24 additions & 17 deletions bin/release-manager.js
Original file line number Diff line number Diff line change
Expand Up @@ -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 <PR-NUMBER> --force
npm ${args.lockfile ? 'ci' : 'update'}
npm test
gh pr checks <PR-NUMBER> -R {NWO} --watch
\`\`\`

1. Publish workspaces

\`\`\`sh
Expand All @@ -28,38 +38,35 @@ const PUBLISH_STEPS = `
\`\`\`sh
npm publish <PUBLISH-FLAGS>
\`\`\`
`

/* eslint-disable max-len */
const DEFAULT_RELEASE_PROCESS = `
1. Checkout the release branch and test
1. Merge release PR

\`\`\`sh
gh pr checkout <PR-NUMBER> --force
npm ${args.lockfile ? 'ci' : 'update'}
npm test
gh pr checks --watch
gh pr merge <PR-NUMBER> -R {NWO} --rebase
git checkout <BASE-BRANCH>
git fetch
git reset --hard origin/<BASE-BRANCH>
\`\`\`
`

${!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 <BASE-BRANCH>
git fetch
git reset --hard origin/<BASE-BRANCH>
gh pr merge <PR-NUMBER> -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.

\`\`\`
gh run watch \`gh run list -R {NWO} -w release -b <BASE-BRANCH> -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
Expand Down