mirror of
https://github.com/google-gemini/gemini-cli.git
synced 2026-04-24 22:55:13 +00:00
prep for release tagging
This commit is contained in:
@@ -20,20 +20,34 @@ steps:
|
|||||||
# Step 6: Build sandbox container image
|
# Step 6: Build sandbox container image
|
||||||
- name: 'us-west1-docker.pkg.dev/gemini-code-dev/gemini-code-containers/gemini-code-builder'
|
- name: 'us-west1-docker.pkg.dev/gemini-code-dev/gemini-code-containers/gemini-code-builder'
|
||||||
id: 'Build sandbox Docker image'
|
id: 'Build sandbox Docker image'
|
||||||
entrypoint: 'npm'
|
entrypoint: 'bash'
|
||||||
args: ['run', 'build:sandbox:fast']
|
args:
|
||||||
|
- -c
|
||||||
|
- |
|
||||||
|
if [ "$_OFFICIAL_RELEASE" = "true" ]; then
|
||||||
|
export GEMINI_SANDBOX_IMAGE_TAG="${TAG_NAME#v}"
|
||||||
|
else
|
||||||
|
export GEMINI_SANDBOX_IMAGE_TAG="$SHORT_SHA"
|
||||||
|
fi
|
||||||
|
npm run build:sandbox:fast
|
||||||
env:
|
env:
|
||||||
- 'GEMINI_SANDBOX_IMAGE_TAG=$SHORT_SHA'
|
|
||||||
- 'GEMINI_SANDBOX=$_CONTAINER_TOOL'
|
- 'GEMINI_SANDBOX=$_CONTAINER_TOOL'
|
||||||
|
|
||||||
# Step 7: Publish sandbox container image
|
# Step 7: Publish sandbox container image
|
||||||
- name: 'us-west1-docker.pkg.dev/gemini-code-dev/gemini-code-containers/gemini-code-builder'
|
- name: 'us-west1-docker.pkg.dev/gemini-code-dev/gemini-code-containers/gemini-code-builder'
|
||||||
id: 'Publish sandbox Docker image'
|
id: 'Publish sandbox Docker image'
|
||||||
entrypoint: 'npm'
|
entrypoint: 'bash'
|
||||||
args: ['run', 'publish:sandbox']
|
args:
|
||||||
|
- -c
|
||||||
|
- |
|
||||||
|
if [ "$_OFFICIAL_RELEASE" = "true" ]; then
|
||||||
|
export GEMINI_SANDBOX_IMAGE_TAG="${TAG_NAME#v}"
|
||||||
|
else
|
||||||
|
export GEMINI_SANDBOX_IMAGE_TAG="$SHORT_SHA"
|
||||||
|
fi
|
||||||
|
npm run publish:sandbox
|
||||||
env:
|
env:
|
||||||
- 'GEMINI_SANDBOX=$_CONTAINER_TOOL'
|
- 'GEMINI_SANDBOX=$_CONTAINER_TOOL'
|
||||||
- 'GEMINI_SANDBOX_IMAGE_TAG=$SHORT_SHA'
|
|
||||||
|
|
||||||
options:
|
options:
|
||||||
defaultLogsBucketBehavior: REGIONAL_USER_OWNED_BUCKET
|
defaultLogsBucketBehavior: REGIONAL_USER_OWNED_BUCKET
|
||||||
@@ -41,4 +55,4 @@ options:
|
|||||||
|
|
||||||
substitutions:
|
substitutions:
|
||||||
_OFFICIAL_RELEASE: 'false'
|
_OFFICIAL_RELEASE: 'false'
|
||||||
_CONTAINER_TOOL: 'docker'
|
_CONTAINER_TOOL: 'docker'
|
||||||
|
|||||||
47
.github/workflows/release.yml
vendored
47
.github/workflows/release.yml
vendored
@@ -1,24 +1,9 @@
|
|||||||
name: Release
|
name: Release
|
||||||
|
|
||||||
on:
|
on:
|
||||||
# Official Release: Triggered when a tag like v1.2.3 is pushed
|
push:
|
||||||
# push:
|
tags:
|
||||||
# tags:
|
- 'v*.*.*'
|
||||||
# - 'v[0-9]+.[0-9]+.[0-9]+'
|
|
||||||
|
|
||||||
# Pre-Release: Manual trigger from the GitHub Actions UI
|
|
||||||
workflow_dispatch:
|
|
||||||
inputs:
|
|
||||||
pre_release_tag:
|
|
||||||
description: 'NPM pre-release identifier (e.g., "beta", "next").'
|
|
||||||
required: true
|
|
||||||
default: 'next'
|
|
||||||
type: string
|
|
||||||
dry_run:
|
|
||||||
description: 'Whether to run the publish step in dry-run mode.'
|
|
||||||
required: true
|
|
||||||
type: boolean
|
|
||||||
default: true
|
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
release:
|
release:
|
||||||
@@ -67,32 +52,15 @@ jobs:
|
|||||||
- name: Set Release Version and Tag
|
- name: Set Release Version and Tag
|
||||||
id: version
|
id: version
|
||||||
run: |
|
run: |
|
||||||
if [[ "${{ github.ref_type }}" == "tag" ]]; then
|
RELEASE_VERSION="${GITHUB_REF_NAME#v}"
|
||||||
# For official releases, use the git tag as the version
|
if [[ $RELEASE_VERSION == *-* ]]; then
|
||||||
# Example: v1.2.3 -> 1.2.3
|
NPM_TAG=$(echo $RELEASE_VERSION | cut -d'-' -f2 | cut -d'.' -f1)
|
||||||
RELEASE_VERSION="${GITHUB_REF_NAME#v}"
|
|
||||||
NPM_TAG="latest"
|
|
||||||
else
|
else
|
||||||
# For pre-releases, create a version like 1.2.3-next.1
|
NPM_TAG="latest"
|
||||||
# and set the tag to "next"
|
|
||||||
npm version --no-git-tag-version prerelease --preid=${{ inputs.pre_release_tag }}
|
|
||||||
RELEASE_VERSION=$(node -p "require('./package.json').version")
|
|
||||||
NPM_TAG="${{ inputs.pre_release_tag }}"
|
|
||||||
fi
|
fi
|
||||||
echo "RELEASE_VERSION=${RELEASE_VERSION}" >> $GITHUB_OUTPUT
|
echo "RELEASE_VERSION=${RELEASE_VERSION}" >> $GITHUB_OUTPUT
|
||||||
echo "NPM_TAG=${NPM_TAG}" >> $GITHUB_OUTPUT
|
echo "NPM_TAG=${NPM_TAG}" >> $GITHUB_OUTPUT
|
||||||
|
|
||||||
- name: Determine Run Type
|
|
||||||
id: run_type
|
|
||||||
run: |
|
|
||||||
if [[ "${{ github.ref_type }}" == "tag" || "${{ inputs.dry_run }}" == "false" ]]; then
|
|
||||||
echo "NPM_DRY_RUN=" >> $GITHUB_OUTPUT
|
|
||||||
echo "DOCKER_DRY_RUN=" >> $GITHUB_OUTPUT
|
|
||||||
else
|
|
||||||
echo "NPM_DRY_RUN=--dry-run" >> $GITHUB_OUTPUT
|
|
||||||
echo "DOCKER_DRY_RUN=true" >> $GITHUB_OUTPUT
|
|
||||||
fi
|
|
||||||
|
|
||||||
- name: Configure npm for publishing
|
- name: Configure npm for publishing
|
||||||
run: |
|
run: |
|
||||||
echo "registry=https://wombat-dressing-room.appspot.com/" > .npmrc
|
echo "registry=https://wombat-dressing-room.appspot.com/" > .npmrc
|
||||||
@@ -102,7 +70,6 @@ jobs:
|
|||||||
run: npm run publish:npm
|
run: npm run publish:npm
|
||||||
env:
|
env:
|
||||||
NPM_PUBLISH_TAG: ${{ steps.version.outputs.NPM_TAG }}
|
NPM_PUBLISH_TAG: ${{ steps.version.outputs.NPM_TAG }}
|
||||||
NPM_DRY_RUN: ${{ steps.run_type.outputs.NPM_DRY_RUN }}
|
|
||||||
|
|
||||||
- name: Create GitHub Release
|
- name: Create GitHub Release
|
||||||
if: steps.run_type.outputs.NPM_DRY_RUN == ''
|
if: steps.run_type.outputs.NPM_DRY_RUN == ''
|
||||||
|
|||||||
@@ -123,7 +123,8 @@ function buildImage(imageName, dockerfile) {
|
|||||||
readFileSync(join(process.cwd(), 'package.json'), 'utf-8'),
|
readFileSync(join(process.cwd(), 'package.json'), 'utf-8'),
|
||||||
).version;
|
).version;
|
||||||
|
|
||||||
const imageTag = process.env.GEMINI_SANDBOX_IMAGE_TAG || imageName.split(':')[1];
|
const imageTag =
|
||||||
|
process.env.GEMINI_SANDBOX_IMAGE_TAG || imageName.split(':')[1];
|
||||||
const finalImageName = `${imageName.split(':')[0]}:${imageTag}`;
|
const finalImageName = `${imageName.split(':')[0]}:${imageTag}`;
|
||||||
|
|
||||||
execSync(
|
execSync(
|
||||||
|
|||||||
@@ -32,14 +32,15 @@ if (root.version !== cli.version || root.version !== core.version) {
|
|||||||
// 2. Check that the cli's dependency on core matches the core version.
|
// 2. Check that the cli's dependency on core matches the core version.
|
||||||
const coreDepVersion = cli.dependencies['@google/gemini-cli-core'];
|
const coreDepVersion = cli.dependencies['@google/gemini-cli-core'];
|
||||||
const expectedCoreVersion = `^${core.version}`;
|
const expectedCoreVersion = `^${core.version}`;
|
||||||
if (coreDepVersion !== expectedCoreVersion && coreDepVersion !== 'file:../core') {
|
if (
|
||||||
|
coreDepVersion !== expectedCoreVersion &&
|
||||||
|
coreDepVersion !== 'file:../core'
|
||||||
|
) {
|
||||||
errors.push(
|
errors.push(
|
||||||
`CLI dependency on core is wrong: expected ${expectedCoreVersion} or "file:../core", got ${coreDepVersion}`,
|
`CLI dependency on core is wrong: expected ${expectedCoreVersion} or "file:../core", got ${coreDepVersion}`,
|
||||||
);
|
);
|
||||||
} else {
|
} else {
|
||||||
console.log(
|
console.log(`- CLI dependency on core (${coreDepVersion}) is correct.`);
|
||||||
`- CLI dependency on core (${coreDepVersion}) is correct.`,
|
|
||||||
);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// 3. Check that the sandbox image tag matches the root version.
|
// 3. Check that the sandbox image tag matches the root version.
|
||||||
|
|||||||
Reference in New Issue
Block a user