From 7fe207937fb40d0e5f3e0966ae398447f9d28a12 Mon Sep 17 00:00:00 2001 From: Elliot DeNolf Date: Mon, 18 Nov 2024 20:05:55 -0500 Subject: [PATCH] ci: update release script for v3 --- package.json | 2 +- scripts/release.ts | 8 +++++--- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/package.json b/package.json index 68f1957b131..cd5f89129f8 100644 --- a/package.json +++ b/package.json @@ -74,7 +74,7 @@ "prepare-run-test-against-prod": "pnpm bf && rm -rf test/packed && rm -rf test/node_modules && rm -rf app && rm -f test/pnpm-lock.yaml && pnpm run script:pack --all --no-build --dest test/packed && pnpm runts test/setupProd.ts && cd test && pnpm i --ignore-workspace && cd ..", "prepare-run-test-against-prod:ci": "rm -rf test/node_modules && rm -rf app && rm -f test/pnpm-lock.yaml && pnpm run script:pack --all --no-build --dest test/packed && pnpm runts test/setupProd.ts && cd test && pnpm i --ignore-workspace && cd ..", "reinstall": "pnpm clean:all && pnpm install", - "release:alpha": "pnpm runts ./scripts/release.ts --bump prerelease --tag alpha", + "release": "pnpm runts ./scripts/release.ts --tag latest", "release:beta": "pnpm runts ./scripts/release.ts --bump prerelease --tag beta", "runts": "cross-env NODE_OPTIONS=--no-deprecation node --no-deprecation --import @swc-node/register/esm-register", "script:gen-templates": "pnpm runts ./scripts/generate-template-variations.ts", diff --git a/scripts/release.ts b/scripts/release.ts index ebb09be0cd1..382cd34de72 100755 --- a/scripts/release.ts +++ b/scripts/release.ts @@ -29,13 +29,13 @@ const execaOpts: execa.Options = { stdio: 'inherit' } const args = minimist(process.argv.slice(2)) const { - bump = 'patch', // Semver release type + bump, // Semver release type: major, minor, patch, premajor, preminor, prepatch, prerelease changelog = false, // Whether to update the changelog. WARNING: This gets throttled on too many commits 'dry-run': dryRun, 'git-tag': gitTag = true, // Whether to run git tag and commit operations 'git-commit': gitCommit = true, // Whether to run git commit operations versionOverride = undefined, - tag = 'latest', + tag, // Tag to publish to: latest, beta, canary } = args const logPrefix = dryRun ? chalk.bold.magenta('[dry-run] >') : '' @@ -344,7 +344,9 @@ async function question(message: string): Promise { function header(message: string, opts?: { enable?: boolean }) { const { enable } = opts ?? {} - if (!enable) return + if (!enable) { + return + } console.log(chalk.bold.green(`${message}\n`)) }