From becf4d6fea9a77532c0bdaafa0f12fe42bb46faa Mon Sep 17 00:00:00 2001 From: Antoine du Hamel Date: Wed, 6 Jul 2022 18:41:04 +0200 Subject: [PATCH] meta: fix release script for major beta versions --- private/release/choose-semverness.js | 2 +- private/release/commit-and-open-pr.js | 6 ++++-- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/private/release/choose-semverness.js b/private/release/choose-semverness.js index ffce822874..53d4e53c93 100755 --- a/private/release/choose-semverness.js +++ b/private/release/choose-semverness.js @@ -104,7 +104,7 @@ export default async function pickSemverness ( { title: 'Minor', value: 'minor' }, { title: 'Major', value: 'major' }, ], - initial: 0, + initial: 4, }) if (!response.value) { diff --git a/private/release/commit-and-open-pr.js b/private/release/commit-and-open-pr.js index c26072e98f..8280759c1b 100644 --- a/private/release/commit-and-open-pr.js +++ b/private/release/commit-and-open-pr.js @@ -1,7 +1,7 @@ import { spawnSync } from 'node:child_process' import { fileURLToPath } from 'node:url' import prompts from 'prompts' -import { REPO_NAME, REPO_OWNER } from './config.js' +import { REPO_NAME, REPO_OWNER, TARGET_BRANCH } from './config.js' function runProcessOrThrow (...args) { const cp = spawnSync(...args) @@ -81,6 +81,7 @@ export default async function commit (spawnOptions, STABLE_HEAD, ...files) { } } + const mergeSha = getContentFromProcessSync('git', ['rev-parse', 'HEAD'], spawnOptions) runProcessOrThrow('git', ['cherry-pick', releaseSha], spawnOptions) const sha = getContentFromProcessSync('git', ['rev-parse', 'HEAD'], spawnOptions) @@ -91,6 +92,7 @@ export default async function commit (spawnOptions, STABLE_HEAD, ...files) { console.log(`Please run \`git push ${remote} ${sha}:refs/heads/release-beta\`.`) console.log(`An automation will kick off and open a release candidate PR on the GitHub repository. Do not merge it manually! Review the PR (you may need to close and - re-open so the CI and test will run on it). If everything looks good, approve the PR — + re-open so the CI and test will run on it). If everything looks good, run + \`git push ${mergeSha}:refs/heads/${TARGET_BRANCH}\`, and approve the PR — this will publish updated packages to npm, then the PR will be merged.`) }