mirror of
https://github.com/google-gemini/gemini-cli.git
synced 2026-02-01 22:48:03 +00:00
prep for release tagging
This commit is contained in:
@@ -20,20 +20,34 @@ steps:
|
||||
# Step 6: Build sandbox container image
|
||||
- name: 'us-west1-docker.pkg.dev/gemini-code-dev/gemini-code-containers/gemini-code-builder'
|
||||
id: 'Build sandbox Docker image'
|
||||
entrypoint: 'npm'
|
||||
args: ['run', 'build:sandbox:fast']
|
||||
entrypoint: 'bash'
|
||||
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:
|
||||
- 'GEMINI_SANDBOX_IMAGE_TAG=$SHORT_SHA'
|
||||
- 'GEMINI_SANDBOX=$_CONTAINER_TOOL'
|
||||
|
||||
# Step 7: Publish sandbox container image
|
||||
- name: 'us-west1-docker.pkg.dev/gemini-code-dev/gemini-code-containers/gemini-code-builder'
|
||||
id: 'Publish sandbox Docker image'
|
||||
entrypoint: 'npm'
|
||||
args: ['run', 'publish:sandbox']
|
||||
entrypoint: 'bash'
|
||||
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:
|
||||
- 'GEMINI_SANDBOX=$_CONTAINER_TOOL'
|
||||
- 'GEMINI_SANDBOX_IMAGE_TAG=$SHORT_SHA'
|
||||
|
||||
options:
|
||||
defaultLogsBucketBehavior: REGIONAL_USER_OWNED_BUCKET
|
||||
@@ -41,4 +55,4 @@ options:
|
||||
|
||||
substitutions:
|
||||
_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
|
||||
|
||||
on:
|
||||
# Official Release: Triggered when a tag like v1.2.3 is pushed
|
||||
# push:
|
||||
# tags:
|
||||
# - '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
|
||||
push:
|
||||
tags:
|
||||
- 'v*.*.*'
|
||||
|
||||
jobs:
|
||||
release:
|
||||
@@ -67,32 +52,15 @@ jobs:
|
||||
- name: Set Release Version and Tag
|
||||
id: version
|
||||
run: |
|
||||
if [[ "${{ github.ref_type }}" == "tag" ]]; then
|
||||
# For official releases, use the git tag as the version
|
||||
# Example: v1.2.3 -> 1.2.3
|
||||
RELEASE_VERSION="${GITHUB_REF_NAME#v}"
|
||||
NPM_TAG="latest"
|
||||
RELEASE_VERSION="${GITHUB_REF_NAME#v}"
|
||||
if [[ $RELEASE_VERSION == *-* ]]; then
|
||||
NPM_TAG=$(echo $RELEASE_VERSION | cut -d'-' -f2 | cut -d'.' -f1)
|
||||
else
|
||||
# For pre-releases, create a version like 1.2.3-next.1
|
||||
# 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 }}"
|
||||
NPM_TAG="latest"
|
||||
fi
|
||||
echo "RELEASE_VERSION=${RELEASE_VERSION}" >> $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
|
||||
run: |
|
||||
echo "registry=https://wombat-dressing-room.appspot.com/" > .npmrc
|
||||
@@ -102,7 +70,6 @@ jobs:
|
||||
run: npm run publish:npm
|
||||
env:
|
||||
NPM_PUBLISH_TAG: ${{ steps.version.outputs.NPM_TAG }}
|
||||
NPM_DRY_RUN: ${{ steps.run_type.outputs.NPM_DRY_RUN }}
|
||||
|
||||
- name: Create GitHub Release
|
||||
if: steps.run_type.outputs.NPM_DRY_RUN == ''
|
||||
|
||||
@@ -123,7 +123,8 @@ function buildImage(imageName, dockerfile) {
|
||||
readFileSync(join(process.cwd(), 'package.json'), 'utf-8'),
|
||||
).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}`;
|
||||
|
||||
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.
|
||||
const coreDepVersion = cli.dependencies['@google/gemini-cli-core'];
|
||||
const expectedCoreVersion = `^${core.version}`;
|
||||
if (coreDepVersion !== expectedCoreVersion && coreDepVersion !== 'file:../core') {
|
||||
if (
|
||||
coreDepVersion !== expectedCoreVersion &&
|
||||
coreDepVersion !== 'file:../core'
|
||||
) {
|
||||
errors.push(
|
||||
`CLI dependency on core is wrong: expected ${expectedCoreVersion} or "file:../core", got ${coreDepVersion}`,
|
||||
);
|
||||
} else {
|
||||
console.log(
|
||||
`- CLI dependency on core (${coreDepVersion}) is correct.`,
|
||||
);
|
||||
console.log(`- CLI dependency on core (${coreDepVersion}) is correct.`);
|
||||
}
|
||||
|
||||
// 3. Check that the sandbox image tag matches the root version.
|
||||
|
||||
Reference in New Issue
Block a user