mirror of
https://github.com/google-gemini/gemini-cli.git
synced 2026-04-28 05:55:17 -07:00
feat: Use PAT for gemini-cli-robot in release workflows (#9804)
Co-authored-by: Gal Zahavi <38544478+galz10@users.noreply.github.com>
This commit is contained in:
@@ -15,37 +15,33 @@ inputs:
|
|||||||
description: 'The branch to merge into.'
|
description: 'The branch to merge into.'
|
||||||
required: true
|
required: true
|
||||||
default: 'main'
|
default: 'main'
|
||||||
app-id:
|
github-token:
|
||||||
description: 'The ID of the GitHub App.'
|
description: 'The GitHub token to use for creating the pull request.'
|
||||||
required: true
|
|
||||||
private-key:
|
|
||||||
description: 'The private key of the GitHub App.'
|
|
||||||
required: true
|
required: true
|
||||||
dry-run:
|
dry-run:
|
||||||
description: 'Whether to run in dry-run mode.'
|
description: 'Whether to run in dry-run mode.'
|
||||||
required: false
|
required: false
|
||||||
default: 'false'
|
default: 'false'
|
||||||
|
working-directory:
|
||||||
|
description: 'The working directory to run the commands in.'
|
||||||
|
required: false
|
||||||
|
default: '.'
|
||||||
|
|
||||||
runs:
|
runs:
|
||||||
using: 'composite'
|
using: 'composite'
|
||||||
steps:
|
steps:
|
||||||
- name: 'Generate GitHub App Token'
|
|
||||||
id: 'generate_token'
|
|
||||||
if: "inputs.dry-run == 'false'"
|
|
||||||
uses: 'actions/create-github-app-token@a8d616148505b5069dccd32f177bb87d7f39123b'
|
|
||||||
with:
|
|
||||||
app-id: '${{ inputs.app-id }}'
|
|
||||||
private-key: '${{ inputs.private-key }}'
|
|
||||||
permission-pull-requests: 'write'
|
|
||||||
permission-contents: 'write'
|
|
||||||
|
|
||||||
- name: 'Create and Approve Pull Request'
|
- name: 'Create and Approve Pull Request'
|
||||||
if: "inputs.dry-run == 'false'"
|
if: "inputs.dry-run == 'false'"
|
||||||
env:
|
env:
|
||||||
GH_TOKEN: '${{ steps.generate_token.outputs.token }}'
|
GH_TOKEN: '${{ inputs.github-token }}'
|
||||||
shell: 'bash'
|
shell: 'bash'
|
||||||
|
working-directory: '${{ inputs.working-directory }}'
|
||||||
run: |
|
run: |
|
||||||
set -e
|
set -e
|
||||||
|
if ! git ls-remote --exit-code --heads origin "${{ inputs.branch-name }}"; then
|
||||||
|
echo "::error::Branch '${{ inputs.branch-name }}' does not exist on the remote repository."
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
PR_URL=$(gh pr create \
|
PR_URL=$(gh pr create \
|
||||||
--title "${{ inputs.pr-title }}" \
|
--title "${{ inputs.pr-title }}" \
|
||||||
--body "${{ inputs.pr-body }}" \
|
--body "${{ inputs.pr-body }}" \
|
||||||
|
|||||||
@@ -14,7 +14,7 @@ on:
|
|||||||
description: 'Select to skip the "Run Tests" step in testing. Prod releases should run tests'
|
description: 'Select to skip the "Run Tests" step in testing. Prod releases should run tests'
|
||||||
required: false
|
required: false
|
||||||
type: 'boolean'
|
type: 'boolean'
|
||||||
default: false
|
default: true
|
||||||
ref:
|
ref:
|
||||||
description: 'The branch, tag, or SHA to release from.'
|
description: 'The branch, tag, or SHA to release from.'
|
||||||
required: false
|
required: false
|
||||||
@@ -31,38 +31,66 @@ jobs:
|
|||||||
pull-requests: 'write'
|
pull-requests: 'write'
|
||||||
steps:
|
steps:
|
||||||
- name: 'Checkout'
|
- name: 'Checkout'
|
||||||
|
uses: 'actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8'
|
||||||
|
with:
|
||||||
|
fetch-depth: 0
|
||||||
|
|
||||||
|
- name: 'Checkout Release Code'
|
||||||
uses: 'actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8'
|
uses: 'actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8'
|
||||||
with:
|
with:
|
||||||
ref: '${{ github.event.inputs.ref }}'
|
ref: '${{ github.event.inputs.ref }}'
|
||||||
|
path: 'release'
|
||||||
fetch-depth: 0
|
fetch-depth: 0
|
||||||
|
|
||||||
- name: 'Setup Node.js'
|
- name: 'Setup Node.js'
|
||||||
uses: 'actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020' # ratchet:actions/setup-node@v4
|
uses: 'actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020' # ratchet:actions/setup-node@v4
|
||||||
with:
|
with:
|
||||||
node-version-file: '.nvmrc'
|
node-version-file: './release/.nvmrc'
|
||||||
cache: 'npm'
|
cache: 'npm'
|
||||||
|
|
||||||
- name: 'Install Dependencies'
|
- name: 'Install Dependencies'
|
||||||
|
working-directory: './release'
|
||||||
run: 'npm ci'
|
run: 'npm ci'
|
||||||
|
|
||||||
|
- name: 'Print Inputs'
|
||||||
|
run: |
|
||||||
|
echo "${{ toJSON(github.event.inputs) }}"
|
||||||
|
|
||||||
- name: 'Run Tests'
|
- name: 'Run Tests'
|
||||||
if: "${{github.event.inputs.force_skip_tests != 'true'}}"
|
if: "${{github.event.inputs.force_skip_tests != 'true'}}"
|
||||||
uses: './.github/actions/run-tests'
|
uses: './.github/actions/run-tests'
|
||||||
with:
|
with:
|
||||||
gemini_api_key: '${{ secrets.GEMINI_API_KEY }}'
|
gemini_api_key: '${{ secrets.GEMINI_API_KEY }}'
|
||||||
|
working-directory: './release'
|
||||||
|
|
||||||
- name: 'Get Nightly Version'
|
- name: 'Get Nightly Version'
|
||||||
id: 'nightly_version'
|
id: 'nightly_version'
|
||||||
|
working-directory: './release'
|
||||||
env:
|
env:
|
||||||
GH_TOKEN: '${{ secrets.GITHUB_TOKEN }}'
|
GH_TOKEN: '${{ secrets.GITHUB_TOKEN }}'
|
||||||
run: |
|
run: |
|
||||||
|
# Calculate the version using the centralized script
|
||||||
VERSION_JSON=$(node scripts/get-release-version.js --type=nightly)
|
VERSION_JSON=$(node scripts/get-release-version.js --type=nightly)
|
||||||
echo "RELEASE_TAG=$(echo "${VERSION_JSON}" | jq -r .releaseTag)" >> "${GITHUB_OUTPUT}"
|
|
||||||
echo "RELEASE_VERSION=$(echo "${VERSION_JSON}" | jq -r .releaseVersion)" >> "${GITHUB_OUTPUT}"
|
# Extract values for logging and outputs
|
||||||
echo "NPM_TAG=$(echo "${VERSION_JSON}" | jq -r .npmTag)" >> "${GITHUB_OUTPUT}"
|
RELEASE_TAG=$(echo "${VERSION_JSON}" | jq -r .releaseTag)
|
||||||
echo "PREVIOUS_TAG=$(echo "${VERSION_JSON}" | jq -r .previousReleaseTag)" >> "${GITHUB_OUTPUT}"
|
RELEASE_VERSION=$(echo "${VERSION_JSON}" | jq -r .releaseVersion)
|
||||||
|
NPM_TAG=$(echo "${VERSION_JSON}" | jq -r .npmTag)
|
||||||
|
PREVIOUS_TAG=$(echo "${VERSION_JSON}" | jq -r .previousReleaseTag)
|
||||||
|
|
||||||
|
# Print calculated values for logging
|
||||||
|
echo "Calculated Release Tag: ${RELEASE_TAG}"
|
||||||
|
echo "Calculated Release Version: ${RELEASE_VERSION}"
|
||||||
|
echo "Calculated Previous Tag: ${PREVIOUS_TAG}"
|
||||||
|
|
||||||
|
# Set outputs for subsequent steps
|
||||||
|
echo "RELEASE_TAG=${RELEASE_TAG}" >> "${GITHUB_OUTPUT}"
|
||||||
|
echo "RELEASE_VERSION=${RELEASE_VERSION}" >> "${GITHUB_OUTPUT}"
|
||||||
|
echo "NPM_TAG=${NPM_TAG}" >> "${GITHUB_OUTPUT}"
|
||||||
|
echo "PREVIOUS_TAG=${PREVIOUS_TAG}" >> "${GITHUB_OUTPUT}"
|
||||||
|
|
||||||
- name: 'Publish Release'
|
- name: 'Publish Release'
|
||||||
|
if: true
|
||||||
uses: './.github/actions/publish-release'
|
uses: './.github/actions/publish-release'
|
||||||
with:
|
with:
|
||||||
release-version: '${{ steps.nightly_version.outputs.RELEASE_VERSION }}'
|
release-version: '${{ steps.nightly_version.outputs.RELEASE_VERSION }}'
|
||||||
@@ -73,6 +101,7 @@ jobs:
|
|||||||
github-token: '${{ secrets.GITHUB_TOKEN }}'
|
github-token: '${{ secrets.GITHUB_TOKEN }}'
|
||||||
dry-run: '${{ github.event.inputs.dry_run }}'
|
dry-run: '${{ github.event.inputs.dry_run }}'
|
||||||
previous-tag: '${{ steps.nightly_version.outputs.PREVIOUS_TAG }}'
|
previous-tag: '${{ steps.nightly_version.outputs.PREVIOUS_TAG }}'
|
||||||
|
working-directory: './release'
|
||||||
|
|
||||||
- name: 'Create and Merge Pull Request'
|
- name: 'Create and Merge Pull Request'
|
||||||
uses: './.github/actions/create-pull-request'
|
uses: './.github/actions/create-pull-request'
|
||||||
@@ -80,9 +109,9 @@ jobs:
|
|||||||
branch-name: 'release/${{ steps.nightly_version.outputs.RELEASE_TAG }}'
|
branch-name: 'release/${{ steps.nightly_version.outputs.RELEASE_TAG }}'
|
||||||
pr-title: 'chore(release): bump version to ${{ steps.nightly_version.outputs.RELEASE_VERSION }}'
|
pr-title: 'chore(release): bump version to ${{ steps.nightly_version.outputs.RELEASE_VERSION }}'
|
||||||
pr-body: 'Automated version bump for nightly release.'
|
pr-body: 'Automated version bump for nightly release.'
|
||||||
app-id: '${{ secrets.APP_ID }}'
|
github-token: '${{ secrets.GEMINI_CLI_ROBOT_GITHUB_PAT }}'
|
||||||
private-key: '${{ secrets.PRIVATE_KEY }}'
|
|
||||||
dry-run: '${{ github.event.inputs.dry_run }}'
|
dry-run: '${{ github.event.inputs.dry_run }}'
|
||||||
|
working-directory: './release'
|
||||||
|
|
||||||
- name: 'Create Issue on Failure'
|
- name: 'Create Issue on Failure'
|
||||||
if: '${{ failure() && github.event.inputs.dry_run == false }}'
|
if: '${{ failure() && github.event.inputs.dry_run == false }}'
|
||||||
|
|||||||
@@ -52,15 +52,6 @@ jobs:
|
|||||||
- name: 'Install Script Dependencies'
|
- name: 'Install Script Dependencies'
|
||||||
run: 'npm install yargs'
|
run: 'npm install yargs'
|
||||||
|
|
||||||
- name: 'Generate GitHub App Token'
|
|
||||||
id: 'generate_token'
|
|
||||||
uses: 'actions/create-github-app-token@a8d616148505b5069dccd32f177bb87d7f39123b'
|
|
||||||
with:
|
|
||||||
app-id: '${{ secrets.APP_ID }}'
|
|
||||||
private-key: '${{ secrets.PRIVATE_KEY }}'
|
|
||||||
permission-pull-requests: 'write'
|
|
||||||
permission-contents: 'write'
|
|
||||||
|
|
||||||
- name: 'Configure Git User'
|
- name: 'Configure Git User'
|
||||||
run: |-
|
run: |-
|
||||||
git config user.name "gemini-cli-robot"
|
git config user.name "gemini-cli-robot"
|
||||||
@@ -72,7 +63,7 @@ jobs:
|
|||||||
id: 'create_patch'
|
id: 'create_patch'
|
||||||
env:
|
env:
|
||||||
GITHUB_TOKEN: '${{ secrets.GITHUB_TOKEN }}'
|
GITHUB_TOKEN: '${{ secrets.GITHUB_TOKEN }}'
|
||||||
GH_TOKEN: '${{ steps.generate_token.outputs.token }}'
|
GH_TOKEN: '${{ secrets.GEMINI_CLI_ROBOT_GITHUB_PAT }}'
|
||||||
continue-on-error: true
|
continue-on-error: true
|
||||||
run: |
|
run: |
|
||||||
# Capture output and display it in logs using tee
|
# Capture output and display it in logs using tee
|
||||||
|
|||||||
@@ -70,10 +70,10 @@ jobs:
|
|||||||
set -e
|
set -e
|
||||||
STABLE_JSON=$(node scripts/get-release-version.js --type=stable ${{ github.event.inputs.stable_version_override && format('--stable_version_override={0}', github.event.inputs.stable_version_override) || '' }})
|
STABLE_JSON=$(node scripts/get-release-version.js --type=stable ${{ github.event.inputs.stable_version_override && format('--stable_version_override={0}', github.event.inputs.stable_version_override) || '' }})
|
||||||
PREVIEW_JSON=$(node scripts/get-release-version.js --type=preview ${{ github.event.inputs.preview_version_override && format('--preview_version_override={0}', github.event.inputs.preview_version_override) || '' }})
|
PREVIEW_JSON=$(node scripts/get-release-version.js --type=preview ${{ github.event.inputs.preview_version_override && format('--preview_version_override={0}', github.event.inputs.preview_version_override) || '' }})
|
||||||
NIGHTLY_JSON=$(node scripts/get-release-version.js --type=nightly)
|
NIGHTLY_JSON=$(node scripts/get-release-version.js --type=promote-nightly)
|
||||||
echo "STABLE_JSON_COMMAND=node scripts/get-release-version.js --type=stable ${{ github.event.inputs.stable_version_override && format('--stable_version_override={0}', github.event.inputs.stable_version_override) || '' }}"
|
echo "STABLE_JSON_COMMAND=node scripts/get-release-version.js --type=stable ${{ github.event.inputs.stable_version_override && format('--stable_version_override={0}', github.event.inputs.stable_version_override) || '' }}"
|
||||||
echo "PREVIEW_JSON_COMMAND=node scripts/get-release-version.js --type=preview ${{ github.event.inputs.preview_version_override && format('--preview_version_override={0}', github.event.inputs.preview_version_override) || '' }}"
|
echo "PREVIEW_JSON_COMMAND=node scripts/get-release-version.js --type=preview ${{ github.event.inputs.preview_version_override && format('--preview_version_override={0}', github.event.inputs.preview_version_override) || '' }}"
|
||||||
echo "NIGHTLY_JSON_COMMAND=node scripts/get-release-version.js --type=nightly"
|
echo "NIGHTLY_JSON_COMMAND=node scripts/get-release-version.js --type=promote-nightly"
|
||||||
echo "STABLE_JSON: ${STABLE_JSON}"
|
echo "STABLE_JSON: ${STABLE_JSON}"
|
||||||
echo "PREVIEW_JSON: ${PREVIEW_JSON}"
|
echo "PREVIEW_JSON: ${PREVIEW_JSON}"
|
||||||
echo "NIGHTLY_JSON: ${NIGHTLY_JSON}"
|
echo "NIGHTLY_JSON: ${NIGHTLY_JSON}"
|
||||||
@@ -320,8 +320,7 @@ jobs:
|
|||||||
branch-name: '${{ steps.release_branch.outputs.BRANCH_NAME }}'
|
branch-name: '${{ steps.release_branch.outputs.BRANCH_NAME }}'
|
||||||
pr-title: 'chore(release): bump version to ${{ needs.calculate-versions.outputs.NEXT_NIGHTLY_VERSION }}'
|
pr-title: 'chore(release): bump version to ${{ needs.calculate-versions.outputs.NEXT_NIGHTLY_VERSION }}'
|
||||||
pr-body: 'Automated version bump to prepare for the next nightly release.'
|
pr-body: 'Automated version bump to prepare for the next nightly release.'
|
||||||
app-id: '${{ secrets.APP_ID }}'
|
github-token: '${{ secrets.GEMINI_CLI_ROBOT_GITHUB_PAT }}'
|
||||||
private-key: '${{ secrets.PRIVATE_KEY }}'
|
|
||||||
dry-run: '${{ github.event.inputs.dry_run }}'
|
dry-run: '${{ github.event.inputs.dry_run }}'
|
||||||
|
|
||||||
- name: 'Create Issue on Failure'
|
- name: 'Create Issue on Failure'
|
||||||
|
|||||||
+109
-107
@@ -8,8 +8,13 @@
|
|||||||
|
|
||||||
import { execSync } from 'node:child_process';
|
import { execSync } from 'node:child_process';
|
||||||
import { fileURLToPath } from 'node:url';
|
import { fileURLToPath } from 'node:url';
|
||||||
|
import { readFileSync } from 'node:fs';
|
||||||
import semver from 'semver';
|
import semver from 'semver';
|
||||||
|
|
||||||
|
function readJson(filePath) {
|
||||||
|
return JSON.parse(readFileSync(filePath, 'utf-8'));
|
||||||
|
}
|
||||||
|
|
||||||
function getArgs() {
|
function getArgs() {
|
||||||
const args = {};
|
const args = {};
|
||||||
process.argv.slice(2).forEach((arg) => {
|
process.argv.slice(2).forEach((arg) => {
|
||||||
@@ -72,6 +77,20 @@ function getAllVersionsFromNPM() {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function isVersionDeprecated(version) {
|
||||||
|
const command = `npm view @google/gemini-cli@${version} deprecated`;
|
||||||
|
try {
|
||||||
|
const output = execSync(command).toString().trim();
|
||||||
|
return output.length > 0;
|
||||||
|
} catch (error) {
|
||||||
|
// This command shouldn't fail for existing versions, but as a safeguard:
|
||||||
|
console.warn(
|
||||||
|
`Failed to check deprecation status for ${version}: ${error.message}`,
|
||||||
|
);
|
||||||
|
return false; // Assume not deprecated on error to avoid breaking the release.
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
function detectRollbackAndGetBaseline(npmDistTag) {
|
function detectRollbackAndGetBaseline(npmDistTag) {
|
||||||
// Get the current dist-tag version
|
// Get the current dist-tag version
|
||||||
const distTagVersion = getVersionFromNPM(npmDistTag);
|
const distTagVersion = getVersionFromNPM(npmDistTag);
|
||||||
@@ -107,9 +126,24 @@ function detectRollbackAndGetBaseline(npmDistTag) {
|
|||||||
if (matchingVersions.length === 0)
|
if (matchingVersions.length === 0)
|
||||||
return { baseline: distTagVersion, isRollback: false };
|
return { baseline: distTagVersion, isRollback: false };
|
||||||
|
|
||||||
// Sort by semver and get the highest existing version
|
// Sort by semver to get a list from highest to lowest
|
||||||
matchingVersions.sort((a, b) => semver.rcompare(a, b));
|
matchingVersions.sort((a, b) => semver.rcompare(a, b));
|
||||||
const highestExistingVersion = matchingVersions[0];
|
|
||||||
|
// Find the highest non-deprecated version
|
||||||
|
let highestExistingVersion = '';
|
||||||
|
for (const version of matchingVersions) {
|
||||||
|
if (!isVersionDeprecated(version)) {
|
||||||
|
highestExistingVersion = version;
|
||||||
|
break; // Found the one we want
|
||||||
|
} else {
|
||||||
|
console.log(`Ignoring deprecated version: ${version}`);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// If all matching versions were deprecated, fall back to the dist-tag version
|
||||||
|
if (!highestExistingVersion) {
|
||||||
|
highestExistingVersion = distTagVersion;
|
||||||
|
}
|
||||||
|
|
||||||
// Check if we're in a rollback scenario
|
// Check if we're in a rollback scenario
|
||||||
const isRollback = semver.gt(highestExistingVersion, distTagVersion);
|
const isRollback = semver.gt(highestExistingVersion, distTagVersion);
|
||||||
@@ -122,46 +156,26 @@ function detectRollbackAndGetBaseline(npmDistTag) {
|
|||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
function verifyGitHubReleaseExists(tagName) {
|
function doesVersionExist(version) {
|
||||||
const command = `gh release view "${tagName}" --json tagName --jq .tagName`;
|
// Check NPM
|
||||||
try {
|
try {
|
||||||
|
const command = `npm view @google/gemini-cli@${version} version 2>/dev/null`;
|
||||||
const output = execSync(command).toString().trim();
|
const output = execSync(command).toString().trim();
|
||||||
if (output !== tagName) {
|
if (output === version) {
|
||||||
throw new Error(
|
console.warn(`Version ${version} already exists on NPM.`);
|
||||||
`Discrepancy found! NPM version ${tagName} is missing a corresponding GitHub release.`,
|
return true;
|
||||||
);
|
|
||||||
}
|
}
|
||||||
} catch (error) {
|
} catch (_error) {
|
||||||
throw new Error(
|
// This is expected if the version doesn't exist.
|
||||||
`Discrepancy found! Failed to verify GitHub release for ${tagName}. Error: ${error.message}`,
|
|
||||||
);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
function validateVersionConflicts(newVersion) {
|
|
||||||
// Check if the calculated version already exists in any of the 3 sources
|
|
||||||
const conflicts = [];
|
|
||||||
|
|
||||||
// Check NPM - get all published versions
|
|
||||||
try {
|
|
||||||
const command = `npm view @google/gemini-cli versions --json`;
|
|
||||||
const versionsJson = execSync(command).toString().trim();
|
|
||||||
const allVersions = JSON.parse(versionsJson);
|
|
||||||
if (allVersions.includes(newVersion)) {
|
|
||||||
conflicts.push(`NPM registry already has version ${newVersion}`);
|
|
||||||
}
|
|
||||||
} catch (error) {
|
|
||||||
console.warn(
|
|
||||||
`Failed to check NPM versions for conflicts: ${error.message}`,
|
|
||||||
);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// Check Git tags
|
// Check Git tags
|
||||||
try {
|
try {
|
||||||
const command = `git tag -l 'v${newVersion}'`;
|
const command = `git tag -l 'v${version}'`;
|
||||||
const tagOutput = execSync(command).toString().trim();
|
const tagOutput = execSync(command).toString().trim();
|
||||||
if (tagOutput === `v${newVersion}`) {
|
if (tagOutput === `v${version}`) {
|
||||||
conflicts.push(`Git tag v${newVersion} already exists`);
|
console.warn(`Git tag v${version} already exists.`);
|
||||||
|
return true;
|
||||||
}
|
}
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
console.warn(`Failed to check git tags for conflicts: ${error.message}`);
|
console.warn(`Failed to check git tags for conflicts: ${error.message}`);
|
||||||
@@ -169,18 +183,18 @@ function validateVersionConflicts(newVersion) {
|
|||||||
|
|
||||||
// Check GitHub releases
|
// Check GitHub releases
|
||||||
try {
|
try {
|
||||||
const command = `gh release view "v${newVersion}" --json tagName --jq .tagName`;
|
const command = `gh release view "v${version}" --json tagName --jq .tagName 2>/dev/null`;
|
||||||
const output = execSync(command).toString().trim();
|
const output = execSync(command).toString().trim();
|
||||||
if (output === `v${newVersion}`) {
|
if (output === `v${version}`) {
|
||||||
conflicts.push(`GitHub release v${newVersion} already exists`);
|
console.warn(`GitHub release v${version} already exists.`);
|
||||||
|
return true;
|
||||||
}
|
}
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
// This is expected if the release doesn't exist - only warn on unexpected errors
|
|
||||||
const isExpectedNotFound =
|
const isExpectedNotFound =
|
||||||
error.message.includes('release not found') ||
|
error.message.includes('release not found') ||
|
||||||
error.message.includes('Not Found') ||
|
error.message.includes('Not Found') ||
|
||||||
error.message.includes('not found') ||
|
error.message.includes('not found') ||
|
||||||
error.status === 1; // gh command exit code for not found
|
error.status === 1;
|
||||||
if (!isExpectedNotFound) {
|
if (!isExpectedNotFound) {
|
||||||
console.warn(
|
console.warn(
|
||||||
`Failed to check GitHub releases for conflicts: ${error.message}`,
|
`Failed to check GitHub releases for conflicts: ${error.message}`,
|
||||||
@@ -188,14 +202,10 @@ function validateVersionConflicts(newVersion) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (conflicts.length > 0) {
|
return false;
|
||||||
throw new Error(
|
|
||||||
`Version conflict! Cannot create ${newVersion}:\n${conflicts.join('\n')}`,
|
|
||||||
);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
function getAndVerifyTags(npmDistTag, gitTagPattern) {
|
function getAndVerifyTags(npmDistTag, _gitTagPattern) {
|
||||||
// Detect rollback scenarios and get the correct baseline
|
// Detect rollback scenarios and get the correct baseline
|
||||||
const rollbackInfo = detectRollbackAndGetBaseline(npmDistTag);
|
const rollbackInfo = detectRollbackAndGetBaseline(npmDistTag);
|
||||||
const baselineVersion = rollbackInfo.baseline;
|
const baselineVersion = rollbackInfo.baseline;
|
||||||
@@ -204,56 +214,23 @@ function getAndVerifyTags(npmDistTag, gitTagPattern) {
|
|||||||
throw new Error(`Unable to determine baseline version for ${npmDistTag}`);
|
throw new Error(`Unable to determine baseline version for ${npmDistTag}`);
|
||||||
}
|
}
|
||||||
|
|
||||||
const latestTag = getLatestTag(gitTagPattern);
|
if (rollbackInfo.isRollback) {
|
||||||
|
|
||||||
// In rollback scenarios, we don't require git tags to match the dist-tag
|
|
||||||
// Instead, we verify the baseline version exists as a git tag
|
|
||||||
if (!rollbackInfo.isRollback) {
|
|
||||||
// Normal scenario: NPM dist-tag should match latest git tag
|
|
||||||
if (`v${baselineVersion}` !== latestTag) {
|
|
||||||
throw new Error(
|
|
||||||
`Discrepancy found! NPM ${npmDistTag} tag (${baselineVersion}) does not match latest git ${npmDistTag} tag (${latestTag}).`,
|
|
||||||
);
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
// Rollback scenario: warn about the rollback but don't fail
|
// Rollback scenario: warn about the rollback but don't fail
|
||||||
console.warn(
|
console.warn(
|
||||||
`Rollback detected! NPM ${npmDistTag} tag is ${rollbackInfo.distTagVersion}, but using ${baselineVersion} as baseline for next version calculation (highest existing version).`,
|
`Rollback detected! NPM ${npmDistTag} tag is ${rollbackInfo.distTagVersion}, but using ${baselineVersion} as baseline for next version calculation (highest existing version).`,
|
||||||
);
|
);
|
||||||
|
|
||||||
// Verify the baseline version has corresponding git tag
|
|
||||||
try {
|
|
||||||
const baselineTagExists = execSync(`git tag -l 'v${baselineVersion}'`)
|
|
||||||
.toString()
|
|
||||||
.trim();
|
|
||||||
if (baselineTagExists !== `v${baselineVersion}`) {
|
|
||||||
throw new Error(
|
|
||||||
`Rollback scenario detected, but git tag v${baselineVersion} does not exist! This is required to calculate the next version.`,
|
|
||||||
);
|
|
||||||
}
|
|
||||||
} catch (error) {
|
|
||||||
// If the git command itself failed, log the original error
|
|
||||||
console.error(
|
|
||||||
`Failed to check for git tag v${baselineVersion}: ${error.message}`,
|
|
||||||
);
|
|
||||||
throw new Error(
|
|
||||||
`Rollback scenario detected, but git tag v${baselineVersion} does not exist! This is required to calculate the next version.`,
|
|
||||||
);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// Always verify GitHub release exists for the baseline version (not necessarily the dist-tag)
|
// Not verifying against git tags or GitHub releases as per user request.
|
||||||
verifyGitHubReleaseExists(`v${baselineVersion}`);
|
|
||||||
|
|
||||||
return {
|
return {
|
||||||
latestVersion: baselineVersion,
|
latestVersion: baselineVersion,
|
||||||
latestTag: `v${baselineVersion}`,
|
latestTag: `v${baselineVersion}`,
|
||||||
rollbackInfo,
|
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
function getNightlyVersion() {
|
function promoteNightlyVersion() {
|
||||||
const { latestVersion, latestTag, rollbackInfo } = getAndVerifyTags(
|
const { latestVersion, latestTag } = getAndVerifyTags(
|
||||||
'nightly',
|
'nightly',
|
||||||
'v*-nightly*',
|
'v*-nightly*',
|
||||||
);
|
);
|
||||||
@@ -268,7 +245,21 @@ function getNightlyVersion() {
|
|||||||
releaseVersion: `${major}.${nextMinor}.0-nightly.${date}.${gitShortHash}`,
|
releaseVersion: `${major}.${nextMinor}.0-nightly.${date}.${gitShortHash}`,
|
||||||
npmTag: 'nightly',
|
npmTag: 'nightly',
|
||||||
previousReleaseTag: latestTag,
|
previousReleaseTag: latestTag,
|
||||||
rollbackInfo,
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
function getNightlyVersion() {
|
||||||
|
const packageJson = readJson('package.json');
|
||||||
|
const baseVersion = packageJson.version.split('-')[0];
|
||||||
|
const date = new Date().toISOString().slice(0, 10).replace(/-/g, '');
|
||||||
|
const gitShortHash = execSync('git rev-parse --short HEAD').toString().trim();
|
||||||
|
const releaseVersion = `${baseVersion}-nightly.${date}.${gitShortHash}`;
|
||||||
|
const previousReleaseTag = getLatestTag('v*-nightly*');
|
||||||
|
|
||||||
|
return {
|
||||||
|
releaseVersion,
|
||||||
|
npmTag: 'nightly',
|
||||||
|
previousReleaseTag,
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -299,7 +290,7 @@ function getStableVersion(args) {
|
|||||||
releaseVersion = latestPreviewVersion.replace(/-preview.*/, '');
|
releaseVersion = latestPreviewVersion.replace(/-preview.*/, '');
|
||||||
}
|
}
|
||||||
|
|
||||||
const { latestTag: previousStableTag, rollbackInfo } = getAndVerifyTags(
|
const { latestTag: previousStableTag } = getAndVerifyTags(
|
||||||
'latest',
|
'latest',
|
||||||
'v[0-9].[0-9].[0-9]',
|
'v[0-9].[0-9].[0-9]',
|
||||||
);
|
);
|
||||||
@@ -308,7 +299,6 @@ function getStableVersion(args) {
|
|||||||
releaseVersion,
|
releaseVersion,
|
||||||
npmTag: 'latest',
|
npmTag: 'latest',
|
||||||
previousReleaseTag: previousStableTag,
|
previousReleaseTag: previousStableTag,
|
||||||
rollbackInfo,
|
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -331,7 +321,7 @@ function getPreviewVersion(args) {
|
|||||||
latestNightlyVersion.replace(/-nightly.*/, '') + '-preview.0';
|
latestNightlyVersion.replace(/-nightly.*/, '') + '-preview.0';
|
||||||
}
|
}
|
||||||
|
|
||||||
const { latestTag: previousPreviewTag, rollbackInfo } = getAndVerifyTags(
|
const { latestTag: previousPreviewTag } = getAndVerifyTags(
|
||||||
'preview',
|
'preview',
|
||||||
'v*-preview*',
|
'v*-preview*',
|
||||||
);
|
);
|
||||||
@@ -340,7 +330,6 @@ function getPreviewVersion(args) {
|
|||||||
releaseVersion,
|
releaseVersion,
|
||||||
npmTag: 'preview',
|
npmTag: 'preview',
|
||||||
previousReleaseTag: previousPreviewTag,
|
previousReleaseTag: previousPreviewTag,
|
||||||
rollbackInfo,
|
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -352,10 +341,7 @@ function getPatchVersion(patchFrom) {
|
|||||||
}
|
}
|
||||||
const distTag = patchFrom === 'stable' ? 'latest' : 'preview';
|
const distTag = patchFrom === 'stable' ? 'latest' : 'preview';
|
||||||
const pattern = distTag === 'latest' ? 'v[0-9].[0-9].[0-9]' : 'v*-preview*';
|
const pattern = distTag === 'latest' ? 'v[0-9].[0-9].[0-9]' : 'v*-preview*';
|
||||||
const { latestVersion, latestTag, rollbackInfo } = getAndVerifyTags(
|
const { latestVersion, latestTag } = getAndVerifyTags(distTag, pattern);
|
||||||
distTag,
|
|
||||||
pattern,
|
|
||||||
);
|
|
||||||
|
|
||||||
if (patchFrom === 'stable') {
|
if (patchFrom === 'stable') {
|
||||||
// For stable versions, increment the patch number: 0.5.4 -> 0.5.5
|
// For stable versions, increment the patch number: 0.5.4 -> 0.5.5
|
||||||
@@ -368,7 +354,6 @@ function getPatchVersion(patchFrom) {
|
|||||||
releaseVersion,
|
releaseVersion,
|
||||||
npmTag: distTag,
|
npmTag: distTag,
|
||||||
previousReleaseTag: latestTag,
|
previousReleaseTag: latestTag,
|
||||||
rollbackInfo,
|
|
||||||
};
|
};
|
||||||
} else {
|
} else {
|
||||||
// For preview versions, increment the preview number: 0.6.0-preview.2 -> 0.6.0-preview.3
|
// For preview versions, increment the preview number: 0.6.0-preview.2 -> 0.6.0-preview.3
|
||||||
@@ -389,7 +374,6 @@ function getPatchVersion(patchFrom) {
|
|||||||
releaseVersion,
|
releaseVersion,
|
||||||
npmTag: distTag,
|
npmTag: distTag,
|
||||||
previousReleaseTag: latestTag,
|
previousReleaseTag: latestTag,
|
||||||
rollbackInfo,
|
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -402,6 +386,16 @@ export function getVersion(options = {}) {
|
|||||||
switch (type) {
|
switch (type) {
|
||||||
case 'nightly':
|
case 'nightly':
|
||||||
versionData = getNightlyVersion();
|
versionData = getNightlyVersion();
|
||||||
|
// Nightly versions include a git hash, so conflicts are highly unlikely
|
||||||
|
// and indicate a problem. We'll still validate but not auto-increment.
|
||||||
|
if (doesVersionExist(versionData.releaseVersion)) {
|
||||||
|
throw new Error(
|
||||||
|
`Version conflict! Nightly version ${versionData.releaseVersion} already exists.`,
|
||||||
|
);
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
case 'promote-nightly':
|
||||||
|
versionData = promoteNightlyVersion();
|
||||||
break;
|
break;
|
||||||
case 'stable':
|
case 'stable':
|
||||||
versionData = getStableVersion(args);
|
versionData = getStableVersion(args);
|
||||||
@@ -416,26 +410,34 @@ export function getVersion(options = {}) {
|
|||||||
throw new Error(`Unknown release type: ${type}`);
|
throw new Error(`Unknown release type: ${type}`);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Validate that the calculated version doesn't conflict with existing versions
|
// For patchable versions, check for existence and increment if needed.
|
||||||
validateVersionConflicts(versionData.releaseVersion);
|
if (type === 'stable' || type === 'preview' || type === 'patch') {
|
||||||
|
let releaseVersion = versionData.releaseVersion;
|
||||||
|
while (doesVersionExist(releaseVersion)) {
|
||||||
|
console.log(`Version ${releaseVersion} exists, incrementing.`);
|
||||||
|
if (releaseVersion.includes('-preview.')) {
|
||||||
|
// Increment preview number: 0.6.0-preview.2 -> 0.6.0-preview.3
|
||||||
|
const [version, prereleasePart] = releaseVersion.split('-');
|
||||||
|
const previewNumber = parseInt(prereleasePart.split('.')[1]);
|
||||||
|
releaseVersion = `${version}-preview.${previewNumber + 1}`;
|
||||||
|
} else {
|
||||||
|
// Increment patch number: 0.5.4 -> 0.5.5
|
||||||
|
const versionParts = releaseVersion.split('.');
|
||||||
|
const major = versionParts[0];
|
||||||
|
const minor = versionParts[1];
|
||||||
|
const patch = parseInt(versionParts[2]);
|
||||||
|
releaseVersion = `${major}.${minor}.${patch + 1}`;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
versionData.releaseVersion = releaseVersion;
|
||||||
|
}
|
||||||
|
|
||||||
// Include rollback information in the output if available
|
// All checks are done, construct the final result.
|
||||||
const result = {
|
const result = {
|
||||||
releaseTag: `v${versionData.releaseVersion}`,
|
releaseTag: `v${versionData.releaseVersion}`,
|
||||||
...versionData,
|
...versionData,
|
||||||
};
|
};
|
||||||
|
|
||||||
// Add rollback information to output if it exists
|
|
||||||
if (versionData.rollbackInfo && versionData.rollbackInfo.isRollback) {
|
|
||||||
result.rollbackDetected = {
|
|
||||||
rollbackScenario: true,
|
|
||||||
distTagVersion: versionData.rollbackInfo.distTagVersion,
|
|
||||||
highestExistingVersion: versionData.rollbackInfo.highestExistingVersion,
|
|
||||||
baselineUsed: versionData.rollbackInfo.baseline,
|
|
||||||
message: `Rollback detected: NPM tag was ${versionData.rollbackInfo.distTagVersion}, but using ${versionData.rollbackInfo.baseline} as baseline for next version calculation (highest existing version)`,
|
|
||||||
};
|
|
||||||
}
|
|
||||||
|
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
+1
-1
@@ -164,7 +164,7 @@ export function runYamllint() {
|
|||||||
|
|
||||||
export function runPrettier() {
|
export function runPrettier() {
|
||||||
console.log('\nRunning Prettier...');
|
console.log('\nRunning Prettier...');
|
||||||
if (!runCommand('prettier --check .')) {
|
if (!runCommand('prettier --write .')) {
|
||||||
process.exit(1);
|
process.exit(1);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -7,53 +7,65 @@
|
|||||||
import { vi, describe, it, expect, beforeEach } from 'vitest';
|
import { vi, describe, it, expect, beforeEach } from 'vitest';
|
||||||
import { getVersion } from '../get-release-version.js';
|
import { getVersion } from '../get-release-version.js';
|
||||||
import { execSync } from 'node:child_process';
|
import { execSync } from 'node:child_process';
|
||||||
|
import { readFileSync } from 'node:fs';
|
||||||
|
|
||||||
vi.mock('node:child_process');
|
vi.mock('node:child_process');
|
||||||
|
vi.mock('node:fs');
|
||||||
|
|
||||||
describe('getVersion', () => {
|
describe('getVersion', () => {
|
||||||
beforeEach(() => {
|
beforeEach(() => {
|
||||||
vi.resetAllMocks();
|
vi.resetAllMocks();
|
||||||
vi.setSystemTime(new Date('2025-09-17T00:00:00.000Z'));
|
vi.setSystemTime(new Date('2025-09-17T00:00:00.000Z'));
|
||||||
|
// Mock package.json being read by getNightlyVersion
|
||||||
|
vi.mocked(readFileSync).mockReturnValue(
|
||||||
|
JSON.stringify({ version: '0.8.0' }),
|
||||||
|
);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
// This is the base mock for a clean state with no conflicts or rollbacks
|
||||||
const mockExecSync = (command) => {
|
const mockExecSync = (command) => {
|
||||||
// NPM dist-tags - source of truth
|
// NPM dist-tags
|
||||||
if (command.includes('npm view') && command.includes('--tag=latest'))
|
if (command.includes('npm view') && command.includes('--tag=latest'))
|
||||||
return '0.4.1';
|
return '0.6.1';
|
||||||
if (command.includes('npm view') && command.includes('--tag=preview'))
|
if (command.includes('npm view') && command.includes('--tag=preview'))
|
||||||
return '0.5.0-preview.2';
|
return '0.7.0-preview.1';
|
||||||
if (command.includes('npm view') && command.includes('--tag=nightly'))
|
if (command.includes('npm view') && command.includes('--tag=nightly'))
|
||||||
return '0.6.0-nightly.20250910.a31830a3';
|
return '0.8.0-nightly.20250916.abcdef';
|
||||||
|
|
||||||
// NPM versions list - for conflict validation
|
// NPM versions list
|
||||||
if (command.includes('npm view') && command.includes('versions --json'))
|
if (command.includes('npm view') && command.includes('versions --json'))
|
||||||
return JSON.stringify([
|
return JSON.stringify([
|
||||||
'0.4.1',
|
'0.6.0',
|
||||||
'0.5.0-preview.2',
|
'0.6.1',
|
||||||
'0.6.0-nightly.20250910.a31830a3',
|
'0.7.0-preview.0',
|
||||||
|
'0.7.0-preview.1',
|
||||||
|
'0.8.0-nightly.20250916.abcdef',
|
||||||
]);
|
]);
|
||||||
|
|
||||||
// Git Tag Mocks - with semantic sorting
|
// Deprecation checks (default to not deprecated)
|
||||||
if (command.includes("git tag -l 'v[0-9].[0-9].[0-9]'")) return 'v0.4.1';
|
if (command.includes('deprecated')) return '';
|
||||||
if (command.includes("git tag -l 'v*-preview*'")) return 'v0.5.0-preview.2';
|
|
||||||
|
// Git Tag Mocks
|
||||||
|
if (command.includes("git tag -l 'v[0-9].[0-9].[0-9]'")) return 'v0.6.1';
|
||||||
|
if (command.includes("git tag -l 'v*-preview*'")) return 'v0.7.0-preview.1';
|
||||||
if (command.includes("git tag -l 'v*-nightly*'"))
|
if (command.includes("git tag -l 'v*-nightly*'"))
|
||||||
return 'v0.6.0-nightly.20250910.a31830a3';
|
return 'v0.8.0-nightly.20250916.abcdef';
|
||||||
|
|
||||||
// Conflict validation - Git tag checks
|
|
||||||
if (command.includes("git tag -l 'v0.5.0'")) return ''; // Version doesn't exist yet
|
|
||||||
if (command.includes("git tag -l 'v0.4.2'")) return ''; // Version doesn't exist yet
|
|
||||||
if (command.includes("git tag -l 'v0.6.0-preview.0'")) return ''; // Version doesn't exist yet
|
|
||||||
|
|
||||||
// GitHub Release Mocks
|
|
||||||
if (command.includes('gh release view "v0.4.1"')) return 'v0.4.1';
|
|
||||||
if (command.includes('gh release view "v0.5.0-preview.2"'))
|
|
||||||
return 'v0.5.0-preview.2';
|
|
||||||
if (command.includes('gh release view "v0.6.0-nightly.20250910.a31830a3"'))
|
|
||||||
return 'v0.6.0-nightly.20250910.a31830a3';
|
|
||||||
|
|
||||||
// Git Hash Mock
|
// Git Hash Mock
|
||||||
if (command.includes('git rev-parse --short HEAD')) return 'd3bf8a3d';
|
if (command.includes('git rev-parse --short HEAD')) return 'd3bf8a3d';
|
||||||
|
|
||||||
|
// For doesVersionExist checks - default to not found
|
||||||
|
if (
|
||||||
|
command.includes('npm view') &&
|
||||||
|
command.includes('@google/gemini-cli@')
|
||||||
|
) {
|
||||||
|
throw new Error('NPM version not found');
|
||||||
|
}
|
||||||
|
if (command.includes('git tag -l')) return '';
|
||||||
|
if (command.includes('gh release view')) {
|
||||||
|
throw new Error('GH release not found');
|
||||||
|
}
|
||||||
|
|
||||||
return '';
|
return '';
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -61,345 +73,114 @@ describe('getVersion', () => {
|
|||||||
it('should calculate the next stable version from the latest preview', () => {
|
it('should calculate the next stable version from the latest preview', () => {
|
||||||
vi.mocked(execSync).mockImplementation(mockExecSync);
|
vi.mocked(execSync).mockImplementation(mockExecSync);
|
||||||
const result = getVersion({ type: 'stable' });
|
const result = getVersion({ type: 'stable' });
|
||||||
expect(result.releaseVersion).toBe('0.5.0');
|
expect(result.releaseVersion).toBe('0.7.0');
|
||||||
expect(result.npmTag).toBe('latest');
|
expect(result.npmTag).toBe('latest');
|
||||||
expect(result.previousReleaseTag).toBe('v0.4.1');
|
expect(result.previousReleaseTag).toBe('v0.6.1');
|
||||||
});
|
|
||||||
|
|
||||||
it('should use the override version for stable if provided', () => {
|
|
||||||
vi.mocked(execSync).mockImplementation(mockExecSync);
|
|
||||||
const result = getVersion({
|
|
||||||
type: 'stable',
|
|
||||||
stable_version_override: '1.2.3',
|
|
||||||
});
|
|
||||||
expect(result.releaseVersion).toBe('1.2.3');
|
|
||||||
expect(result.npmTag).toBe('latest');
|
|
||||||
expect(result.previousReleaseTag).toBe('v0.4.1');
|
|
||||||
});
|
});
|
||||||
|
|
||||||
it('should calculate the next preview version from the latest nightly', () => {
|
it('should calculate the next preview version from the latest nightly', () => {
|
||||||
vi.mocked(execSync).mockImplementation(mockExecSync);
|
vi.mocked(execSync).mockImplementation(mockExecSync);
|
||||||
const result = getVersion({ type: 'preview' });
|
const result = getVersion({ type: 'preview' });
|
||||||
expect(result.releaseVersion).toBe('0.6.0-preview.0');
|
expect(result.releaseVersion).toBe('0.8.0-preview.0');
|
||||||
expect(result.npmTag).toBe('preview');
|
expect(result.npmTag).toBe('preview');
|
||||||
expect(result.previousReleaseTag).toBe('v0.5.0-preview.2');
|
expect(result.previousReleaseTag).toBe('v0.7.0-preview.1');
|
||||||
});
|
});
|
||||||
|
|
||||||
it('should use the override version for preview if provided', () => {
|
it('should calculate the next nightly version from package.json', () => {
|
||||||
vi.mocked(execSync).mockImplementation(mockExecSync);
|
|
||||||
const result = getVersion({
|
|
||||||
type: 'preview',
|
|
||||||
preview_version_override: '4.5.6-preview.0',
|
|
||||||
});
|
|
||||||
expect(result.releaseVersion).toBe('4.5.6-preview.0');
|
|
||||||
expect(result.npmTag).toBe('preview');
|
|
||||||
expect(result.previousReleaseTag).toBe('v0.5.0-preview.2');
|
|
||||||
});
|
|
||||||
|
|
||||||
it('should calculate the next nightly version from the latest nightly', () => {
|
|
||||||
vi.mocked(execSync).mockImplementation(mockExecSync);
|
vi.mocked(execSync).mockImplementation(mockExecSync);
|
||||||
const result = getVersion({ type: 'nightly' });
|
const result = getVersion({ type: 'nightly' });
|
||||||
expect(result.releaseVersion).toBe('0.7.0-nightly.20250917.d3bf8a3d');
|
// Note: The base version now comes from package.json, not the previous nightly tag.
|
||||||
|
expect(result.releaseVersion).toBe('0.8.0-nightly.20250917.d3bf8a3d');
|
||||||
expect(result.npmTag).toBe('nightly');
|
expect(result.npmTag).toBe('nightly');
|
||||||
expect(result.previousReleaseTag).toBe(
|
expect(result.previousReleaseTag).toBe('v0.8.0-nightly.20250916.abcdef');
|
||||||
'v0.6.0-nightly.20250910.a31830a3',
|
|
||||||
);
|
|
||||||
});
|
});
|
||||||
|
|
||||||
it('should calculate the next patch version for a stable release', () => {
|
it('should calculate the next patch version for a stable release', () => {
|
||||||
vi.mocked(execSync).mockImplementation(mockExecSync);
|
vi.mocked(execSync).mockImplementation(mockExecSync);
|
||||||
const result = getVersion({ type: 'patch', 'patch-from': 'stable' });
|
const result = getVersion({ type: 'patch', 'patch-from': 'stable' });
|
||||||
expect(result.releaseVersion).toBe('0.4.2');
|
expect(result.releaseVersion).toBe('0.6.2');
|
||||||
expect(result.npmTag).toBe('latest');
|
expect(result.npmTag).toBe('latest');
|
||||||
expect(result.previousReleaseTag).toBe('v0.4.1');
|
expect(result.previousReleaseTag).toBe('v0.6.1');
|
||||||
});
|
});
|
||||||
|
|
||||||
it('should calculate the next patch version for a preview release', () => {
|
it('should calculate the next patch version for a preview release', () => {
|
||||||
vi.mocked(execSync).mockImplementation(mockExecSync);
|
vi.mocked(execSync).mockImplementation(mockExecSync);
|
||||||
const result = getVersion({ type: 'patch', 'patch-from': 'preview' });
|
const result = getVersion({ type: 'patch', 'patch-from': 'preview' });
|
||||||
expect(result.releaseVersion).toBe('0.5.0-preview.3');
|
expect(result.releaseVersion).toBe('0.7.0-preview.2');
|
||||||
expect(result.npmTag).toBe('preview');
|
expect(result.npmTag).toBe('preview');
|
||||||
expect(result.previousReleaseTag).toBe('v0.5.0-preview.2');
|
expect(result.previousReleaseTag).toBe('v0.7.0-preview.1');
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
describe('Failure Path - Invalid Overrides', () => {
|
describe('Advanced Scenarios', () => {
|
||||||
it('should throw an error for an invalid stable_version_override', () => {
|
it('should ignore a deprecated version and use the next highest', () => {
|
||||||
vi.mocked(execSync).mockImplementation(mockExecSync);
|
const mockWithDeprecated = (command) => {
|
||||||
expect(() =>
|
// The highest nightly is 0.9.0, but it's deprecated
|
||||||
getVersion({
|
|
||||||
type: 'stable',
|
|
||||||
stable_version_override: '1.2.3-beta',
|
|
||||||
}),
|
|
||||||
).toThrow(
|
|
||||||
'Invalid stable_version_override: 1.2.3-beta. Must be in X.Y.Z format.',
|
|
||||||
);
|
|
||||||
});
|
|
||||||
|
|
||||||
it('should throw an error for an invalid preview_version_override format', () => {
|
|
||||||
vi.mocked(execSync).mockImplementation(mockExecSync);
|
|
||||||
expect(() =>
|
|
||||||
getVersion({
|
|
||||||
type: 'preview',
|
|
||||||
preview_version_override: '4.5.6-preview', // Missing .N
|
|
||||||
}),
|
|
||||||
).toThrow(
|
|
||||||
'Invalid preview_version_override: 4.5.6-preview. Must be in X.Y.Z-preview.N format.',
|
|
||||||
);
|
|
||||||
});
|
|
||||||
|
|
||||||
it('should throw an error for another invalid preview_version_override format', () => {
|
|
||||||
vi.mocked(execSync).mockImplementation(mockExecSync);
|
|
||||||
expect(() =>
|
|
||||||
getVersion({
|
|
||||||
type: 'preview',
|
|
||||||
preview_version_override: '4.5.6',
|
|
||||||
}),
|
|
||||||
).toThrow(
|
|
||||||
'Invalid preview_version_override: 4.5.6. Must be in X.Y.Z-preview.N format.',
|
|
||||||
);
|
|
||||||
});
|
|
||||||
});
|
|
||||||
|
|
||||||
describe('Semver Sorting Edge Cases', () => {
|
|
||||||
it('should handle Git tag creation date vs semantic version sorting', () => {
|
|
||||||
const mockWithSemverGitSorting = (command) => {
|
|
||||||
// NPM dist-tags are correct (source of truth)
|
|
||||||
if (command.includes('npm view') && command.includes('--tag=latest'))
|
|
||||||
return '0.5.0'; // NPM correctly has 0.5.0 as latest
|
|
||||||
if (command.includes('npm view') && command.includes('--tag=preview'))
|
|
||||||
return '0.6.0-preview.2';
|
|
||||||
if (command.includes('npm view') && command.includes('--tag=nightly'))
|
|
||||||
return '0.7.0-nightly.20250910.a31830a3';
|
|
||||||
|
|
||||||
// NPM versions list for conflict validation
|
|
||||||
if (command.includes('npm view') && command.includes('versions --json'))
|
if (command.includes('npm view') && command.includes('versions --json'))
|
||||||
return JSON.stringify([
|
return JSON.stringify([
|
||||||
'0.0.77', // This was the problematic dev version
|
'0.8.0-nightly.20250916.abcdef',
|
||||||
'0.4.1',
|
'0.9.0-nightly.20250917.deprecated', // This one is deprecated
|
||||||
'0.5.0',
|
|
||||||
'0.6.0-preview.1',
|
|
||||||
'0.6.0-preview.2',
|
|
||||||
'0.7.0-nightly.20250910.a31830a3',
|
|
||||||
]);
|
]);
|
||||||
|
// Mock the deprecation check
|
||||||
// Git tags - test that semantic sorting works correctly
|
|
||||||
if (command.includes("git tag -l 'v[0-9].[0-9].[0-9]'"))
|
|
||||||
return 'v0.0.77\nv0.5.0\nv0.4.1'; // Multiple tags - should pick v0.5.0 semantically
|
|
||||||
if (command.includes("git tag -l 'v*-preview*'"))
|
|
||||||
return 'v0.6.0-preview.2';
|
|
||||||
if (command.includes("git tag -l 'v*-nightly*'"))
|
|
||||||
return 'v0.7.0-nightly.20250910.a31830a3';
|
|
||||||
|
|
||||||
// Conflict validation - new versions don't exist yet
|
|
||||||
if (command.includes("git tag -l 'v0.5.1'")) return '';
|
|
||||||
if (command.includes("git tag -l 'v0.6.0'")) return '';
|
|
||||||
|
|
||||||
// GitHub releases
|
|
||||||
if (command.includes('gh release view "v0.5.0"')) return 'v0.5.0';
|
|
||||||
if (command.includes('gh release view "v0.6.0-preview.2"'))
|
|
||||||
return 'v0.6.0-preview.2';
|
|
||||||
if (
|
if (
|
||||||
command.includes('gh release view "v0.7.0-nightly.20250910.a31830a3"')
|
command.includes(
|
||||||
|
'npm view @google/gemini-cli@0.9.0-nightly.20250917.deprecated deprecated',
|
||||||
|
)
|
||||||
)
|
)
|
||||||
return 'v0.7.0-nightly.20250910.a31830a3';
|
return 'This version is deprecated';
|
||||||
|
// The dist-tag still points to the older, valid version
|
||||||
// GitHub conflict validation - new versions don't exist
|
|
||||||
if (command.includes('gh release view "v0.5.1"'))
|
|
||||||
throw new Error('Not found');
|
|
||||||
if (command.includes('gh release view "v0.6.0"'))
|
|
||||||
throw new Error('Not found');
|
|
||||||
|
|
||||||
// Git Hash Mock
|
|
||||||
if (command.includes('git rev-parse --short HEAD')) return 'd3bf8a3d';
|
|
||||||
|
|
||||||
return mockExecSync(command);
|
|
||||||
};
|
|
||||||
|
|
||||||
vi.mocked(execSync).mockImplementation(mockWithSemverGitSorting);
|
|
||||||
|
|
||||||
// Test patch calculation - should be 0.5.1 from NPM's latest=0.5.0
|
|
||||||
const patchResult = getVersion({ type: 'patch', 'patch-from': 'stable' });
|
|
||||||
expect(patchResult.releaseVersion).toBe('0.5.1');
|
|
||||||
expect(patchResult.previousReleaseTag).toBe('v0.5.0');
|
|
||||||
|
|
||||||
// Verify no rollback information is included in normal scenarios
|
|
||||||
expect(patchResult.rollbackDetected).toBeUndefined();
|
|
||||||
|
|
||||||
// Test stable calculation - should be 0.6.0 from preview
|
|
||||||
const stableResult = getVersion({ type: 'stable' });
|
|
||||||
expect(stableResult.releaseVersion).toBe('0.6.0');
|
|
||||||
expect(stableResult.previousReleaseTag).toBe('v0.5.0');
|
|
||||||
|
|
||||||
// Verify no rollback information for stable calculation either
|
|
||||||
expect(stableResult.rollbackDetected).toBeUndefined();
|
|
||||||
});
|
|
||||||
|
|
||||||
it('should fail when git tags are not semver-sorted correctly', () => {
|
|
||||||
const mockWithIncorrectGitSorting = (command) => {
|
|
||||||
// NPM correctly returns 0.5.0 as latest
|
|
||||||
if (command.includes('npm view') && command.includes('--tag=latest'))
|
|
||||||
return '0.5.0';
|
|
||||||
|
|
||||||
// But git tag sorting returns wrong semantic version
|
|
||||||
if (command.includes("git tag -l 'v[0-9].[0-9].[0-9]'"))
|
|
||||||
return 'v0.4.1'; // This should cause a discrepancy error (NPM says 0.5.0)
|
|
||||||
|
|
||||||
return mockExecSync(command);
|
|
||||||
};
|
|
||||||
|
|
||||||
vi.mocked(execSync).mockImplementation(mockWithIncorrectGitSorting);
|
|
||||||
|
|
||||||
// This should throw because NPM says 0.5.0 but git tag sorting says v0.4.1
|
|
||||||
expect(() =>
|
|
||||||
getVersion({ type: 'patch', 'patch-from': 'stable' }),
|
|
||||||
).toThrow(
|
|
||||||
'Discrepancy found! NPM latest tag (0.5.0) does not match latest git latest tag (v0.4.1).',
|
|
||||||
);
|
|
||||||
});
|
|
||||||
|
|
||||||
it('should handle rollback scenarios by using highest existing version', () => {
|
|
||||||
const mockWithRollback = (command) => {
|
|
||||||
// NPM dist-tag was rolled back from 0.5.0 to 0.4.1 due to issues
|
|
||||||
if (command.includes('npm view') && command.includes('--tag=latest'))
|
|
||||||
return '0.4.1'; // Rolled back version
|
|
||||||
if (command.includes('npm view') && command.includes('--tag=preview'))
|
|
||||||
return '0.6.0-preview.2';
|
|
||||||
if (command.includes('npm view') && command.includes('--tag=nightly'))
|
if (command.includes('npm view') && command.includes('--tag=nightly'))
|
||||||
return '0.7.0-nightly.20250910.a31830a3';
|
return '0.8.0-nightly.20250916.abcdef';
|
||||||
|
|
||||||
// NPM versions list shows 0.5.0 was published (but rolled back)
|
return mockExecSync(command);
|
||||||
if (command.includes('npm view') && command.includes('versions --json'))
|
};
|
||||||
return JSON.stringify([
|
vi.mocked(execSync).mockImplementation(mockWithDeprecated);
|
||||||
'0.3.0',
|
|
||||||
'0.4.1', // Current dist-tag
|
|
||||||
'0.5.0', // Published but rolled back
|
|
||||||
'0.6.0-preview.1',
|
|
||||||
'0.6.0-preview.2',
|
|
||||||
'0.7.0-nightly.20250910.a31830a3',
|
|
||||||
]);
|
|
||||||
|
|
||||||
// Git tags show both versions exist
|
const result = getVersion({ type: 'preview' });
|
||||||
if (command.includes("git tag -l 'v[0-9].[0-9].[0-9]'"))
|
// It should base the preview off 0.8.0, not the deprecated 0.9.0
|
||||||
return 'v0.4.1\nv0.5.0'; // Both tags exist
|
expect(result.releaseVersion).toBe('0.8.0-preview.0');
|
||||||
if (command.includes("git tag -l 'v*-preview*'"))
|
});
|
||||||
return 'v0.6.0-preview.2';
|
|
||||||
if (command.includes("git tag -l 'v*-nightly*'"))
|
|
||||||
return 'v0.7.0-nightly.20250910.a31830a3';
|
|
||||||
|
|
||||||
// Specific git tag checks for rollback validation
|
it('should auto-increment patch version if the calculated one already exists', () => {
|
||||||
if (command.includes("git tag -l 'v0.5.0'")) return 'v0.5.0';
|
const mockWithConflict = (command) => {
|
||||||
|
// The calculated version 0.7.0 already exists as a git tag
|
||||||
|
if (command.includes("git tag -l 'v0.7.0'")) return 'v0.7.0';
|
||||||
|
// The next version, 0.7.1, is available
|
||||||
|
if (command.includes("git tag -l 'v0.7.1'")) return '';
|
||||||
|
|
||||||
// Conflict validation - new versions don't exist yet
|
return mockExecSync(command);
|
||||||
if (command.includes("git tag -l 'v0.5.1'")) return '';
|
};
|
||||||
if (command.includes("git tag -l 'v0.6.0'")) return '';
|
vi.mocked(execSync).mockImplementation(mockWithConflict);
|
||||||
|
|
||||||
// GitHub releases exist for both versions
|
const result = getVersion({ type: 'stable' });
|
||||||
if (command.includes('gh release view "v0.4.1"')) return 'v0.4.1';
|
// Should have skipped 0.7.0 and landed on 0.7.1
|
||||||
if (command.includes('gh release view "v0.5.0"')) return 'v0.5.0'; // Exists but rolled back
|
expect(result.releaseVersion).toBe('0.7.1');
|
||||||
if (command.includes('gh release view "v0.6.0-preview.2"'))
|
});
|
||||||
return 'v0.6.0-preview.2';
|
|
||||||
|
|
||||||
// GitHub conflict validation - new versions don't exist
|
it('should auto-increment preview number if the calculated one already exists', () => {
|
||||||
if (command.includes('gh release view "v0.5.1"'))
|
const mockWithConflict = (command) => {
|
||||||
throw new Error('Not found');
|
// The calculated preview 0.8.0-preview.0 already exists on NPM
|
||||||
if (command.includes('gh release view "v0.6.0"'))
|
if (
|
||||||
|
command.includes(
|
||||||
|
'npm view @google/gemini-cli@0.8.0-preview.0 version',
|
||||||
|
)
|
||||||
|
)
|
||||||
|
return '0.8.0-preview.0';
|
||||||
|
// The next one is available
|
||||||
|
if (
|
||||||
|
command.includes(
|
||||||
|
'npm view @google/gemini-cli@0.8.0-preview.1 version',
|
||||||
|
)
|
||||||
|
)
|
||||||
throw new Error('Not found');
|
throw new Error('Not found');
|
||||||
|
|
||||||
// Git Hash Mock
|
|
||||||
if (command.includes('git rev-parse --short HEAD')) return 'd3bf8a3d';
|
|
||||||
|
|
||||||
return mockExecSync(command);
|
return mockExecSync(command);
|
||||||
};
|
};
|
||||||
|
vi.mocked(execSync).mockImplementation(mockWithConflict);
|
||||||
|
|
||||||
vi.mocked(execSync).mockImplementation(mockWithRollback);
|
const result = getVersion({ type: 'preview' });
|
||||||
|
// Should have skipped preview.0 and landed on preview.1
|
||||||
// Mock console.warn to capture rollback warning
|
expect(result.releaseVersion).toBe('0.8.0-preview.1');
|
||||||
const consoleSpy = vi.spyOn(console, 'warn').mockImplementation(() => {});
|
|
||||||
|
|
||||||
// Test patch calculation - should be 0.5.1 (from rolled back 0.5.0, not current dist-tag 0.4.1)
|
|
||||||
const patchResult = getVersion({ type: 'patch', 'patch-from': 'stable' });
|
|
||||||
expect(patchResult.releaseVersion).toBe('0.5.1'); // Fix for 0.5.0, not 0.4.2
|
|
||||||
expect(patchResult.previousReleaseTag).toBe('v0.5.0'); // Uses highest existing, not dist-tag
|
|
||||||
|
|
||||||
// Verify rollback information is included in output
|
|
||||||
expect(patchResult.rollbackDetected).toBeDefined();
|
|
||||||
expect(patchResult.rollbackDetected.rollbackScenario).toBe(true);
|
|
||||||
expect(patchResult.rollbackDetected.distTagVersion).toBe('0.4.1');
|
|
||||||
expect(patchResult.rollbackDetected.highestExistingVersion).toBe('0.5.0');
|
|
||||||
expect(patchResult.rollbackDetected.baselineUsed).toBe('0.5.0');
|
|
||||||
expect(patchResult.rollbackDetected.message).toContain(
|
|
||||||
'Rollback detected: NPM tag was 0.4.1, but using 0.5.0 as baseline for next version calculation',
|
|
||||||
);
|
|
||||||
|
|
||||||
// Verify rollback was detected and warning was shown
|
|
||||||
expect(consoleSpy).toHaveBeenCalledWith(
|
|
||||||
expect.stringContaining(
|
|
||||||
'Rollback detected! NPM latest tag is 0.4.1, but using 0.5.0 as baseline for next version calculation',
|
|
||||||
),
|
|
||||||
);
|
|
||||||
|
|
||||||
// Test stable calculation - should be 0.6.0 from preview
|
|
||||||
const stableResult = getVersion({ type: 'stable' });
|
|
||||||
expect(stableResult.releaseVersion).toBe('0.6.0');
|
|
||||||
expect(stableResult.previousReleaseTag).toBe('v0.5.0'); // Uses rollback baseline
|
|
||||||
|
|
||||||
consoleSpy.mockRestore();
|
|
||||||
});
|
|
||||||
|
|
||||||
it('should fail rollback scenario when git tag for highest version is missing', () => {
|
|
||||||
const mockWithMissingGitTag = (command) => {
|
|
||||||
// NPM rolled back but git tag was deleted (bad practice)
|
|
||||||
if (command.includes('npm view') && command.includes('--tag=latest'))
|
|
||||||
return '0.4.1'; // Rolled back
|
|
||||||
|
|
||||||
if (command.includes('npm view') && command.includes('versions --json'))
|
|
||||||
return JSON.stringify(['0.4.1', '0.5.0']); // 0.5.0 exists in NPM
|
|
||||||
|
|
||||||
if (command.includes("git tag -l 'v[0-9].[0-9].[0-9]'"))
|
|
||||||
return 'v0.4.1'; // Only old tag exists
|
|
||||||
|
|
||||||
if (command.includes("git tag -l 'v0.5.0'")) return ''; // Missing!
|
|
||||||
|
|
||||||
return mockExecSync(command);
|
|
||||||
};
|
|
||||||
|
|
||||||
vi.mocked(execSync).mockImplementation(mockWithMissingGitTag);
|
|
||||||
|
|
||||||
expect(() =>
|
|
||||||
getVersion({ type: 'patch', 'patch-from': 'stable' }),
|
|
||||||
).toThrow(
|
|
||||||
'Rollback scenario detected, but git tag v0.5.0 does not exist! This is required to calculate the next version.',
|
|
||||||
);
|
|
||||||
});
|
|
||||||
});
|
|
||||||
|
|
||||||
describe('Failure Path - Discrepancy Checks', () => {
|
|
||||||
it('should throw an error if the git tag does not match npm', () => {
|
|
||||||
const mockWithMismatchGitTag = (command) => {
|
|
||||||
if (command.includes("git tag -l 'v*-preview*'"))
|
|
||||||
return 'v0.4.0-preview.99'; // Mismatch with NPM's 0.5.0-preview.2
|
|
||||||
return mockExecSync(command);
|
|
||||||
};
|
|
||||||
vi.mocked(execSync).mockImplementation(mockWithMismatchGitTag);
|
|
||||||
|
|
||||||
expect(() => getVersion({ type: 'stable' })).toThrow(
|
|
||||||
'Discrepancy found! NPM preview tag (0.5.0-preview.2) does not match latest git preview tag (v0.4.0-preview.99).',
|
|
||||||
);
|
|
||||||
});
|
|
||||||
|
|
||||||
it('should throw an error if the GitHub release is missing', () => {
|
|
||||||
const mockWithMissingRelease = (command) => {
|
|
||||||
if (command.includes('gh release view "v0.5.0-preview.2"')) {
|
|
||||||
throw new Error('gh command failed'); // Simulate gh failure
|
|
||||||
}
|
|
||||||
return mockExecSync(command);
|
|
||||||
};
|
|
||||||
vi.mocked(execSync).mockImplementation(mockWithMissingRelease);
|
|
||||||
|
|
||||||
expect(() => getVersion({ type: 'stable' })).toThrow(
|
|
||||||
'Discrepancy found! Failed to verify GitHub release for v0.5.0-preview.2.',
|
|
||||||
);
|
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|||||||
+32
-4
@@ -36,9 +36,35 @@ run(`npm version ${versionType} --no-git-tag-version --allow-same-version`);
|
|||||||
|
|
||||||
// 3. Get all workspaces and filter out the one we don't want to version.
|
// 3. Get all workspaces and filter out the one we don't want to version.
|
||||||
const workspacesToExclude = [];
|
const workspacesToExclude = [];
|
||||||
const lsOutput = JSON.parse(
|
let lsOutput;
|
||||||
execSync('npm ls --workspaces --json --depth=0').toString(),
|
try {
|
||||||
);
|
lsOutput = JSON.parse(
|
||||||
|
execSync('npm ls --workspaces --json --depth=0').toString(),
|
||||||
|
);
|
||||||
|
} catch (e) {
|
||||||
|
// `npm ls` can exit with a non-zero status code if there are issues
|
||||||
|
// with dependencies, but it will still produce the JSON output we need.
|
||||||
|
// We'll try to parse the stdout from the error object.
|
||||||
|
if (e.stdout) {
|
||||||
|
console.warn(
|
||||||
|
'Warning: `npm ls` exited with a non-zero status code. Attempting to proceed with the output.',
|
||||||
|
);
|
||||||
|
try {
|
||||||
|
lsOutput = JSON.parse(e.stdout.toString());
|
||||||
|
} catch (parseError) {
|
||||||
|
console.error(
|
||||||
|
'Error: Failed to parse JSON from `npm ls` output even after `npm ls` failed.',
|
||||||
|
);
|
||||||
|
console.error('npm ls stderr:', e.stderr.toString());
|
||||||
|
console.error('Parse error:', parseError);
|
||||||
|
process.exit(1);
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
console.error('Error: `npm ls` failed with no output.');
|
||||||
|
console.error(e.stderr?.toString() || e);
|
||||||
|
process.exit(1);
|
||||||
|
}
|
||||||
|
}
|
||||||
const allWorkspaces = Object.keys(lsOutput.dependencies || {});
|
const allWorkspaces = Object.keys(lsOutput.dependencies || {});
|
||||||
const workspacesToVersion = allWorkspaces.filter(
|
const workspacesToVersion = allWorkspaces.filter(
|
||||||
(wsName) => !workspacesToExclude.includes(wsName),
|
(wsName) => !workspacesToExclude.includes(wsName),
|
||||||
@@ -76,6 +102,8 @@ if (cliPackageJson.config?.sandboxImageUri) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// 6. Run `npm install` to update package-lock.json.
|
// 6. Run `npm install` to update package-lock.json.
|
||||||
run('npm install');
|
run(
|
||||||
|
'npm install --workspace packages/cli --workspace packages/core --package-lock-only',
|
||||||
|
);
|
||||||
|
|
||||||
console.log(`Successfully bumped versions to v${newVersion}.`);
|
console.log(`Successfully bumped versions to v${newVersion}.`);
|
||||||
|
|||||||
Reference in New Issue
Block a user