diff --git a/.github/workflows/turborepo-release.yml b/.github/workflows/turborepo-release.yml index 2b7a2098e868b..654a8f9d2a741 100644 --- a/.github/workflows/turborepo-release.yml +++ b/.github/workflows/turborepo-release.yml @@ -43,6 +43,10 @@ on: dry_run: description: "Do a dry run, skipping the final publish step." type: boolean + tag-override: + description: "Override default npm dist-tag for the release. Should only be used for backporting" + required: false + type: string jobs: stage: @@ -58,7 +62,7 @@ jobs: git config --global user.email 'turbobot@vercel.com' - name: Version run: | - ./scripts/version.js ${{ inputs.increment }} + ./scripts/version.js ${{ inputs.increment }} ${{ inputs.tag-override }} cat version.txt - name: Stage Commit id: stage diff --git a/scripts/version.js b/scripts/version.js index 5a31b89156a9b..0681828ae04e9 100755 --- a/scripts/version.js +++ b/scripts/version.js @@ -6,6 +6,7 @@ const semver = require("semver"); // These values come from the invocation of release. const increment = process.argv[2]; +const tagOverride = process.argv[3]; // Now we get the current version of the package. const versionFilePath = path.join(__dirname, "..", "version.txt"); @@ -19,6 +20,6 @@ const newVersion = semver.inc(currentVersion, increment, identifier); // Parse the output semver identifier to identify which npm tag to publish to. const parsed = semver.parse(newVersion); -const tag = parsed?.prerelease[0] || "latest"; +const tag = tagOverride || parsed?.prerelease[0] || "latest"; fs.writeFileSync(versionFilePath, `${newVersion}\n${tag}\n`);