diff --git a/.gcp/dogfood.yaml b/.gcp/dogfood.yaml deleted file mode 100644 index dd444db5..00000000 --- a/.gcp/dogfood.yaml +++ /dev/null @@ -1,47 +0,0 @@ -steps: - # Step 1: Install root dependencies (includes workspaces) - - name: 'us-west1-docker.pkg.dev/gemini-code-dev/gemini-code-containers/gemini-code-builder' - entrypoint: 'npm' - args: ['install'] - - # Step 2: Update version in root package.json - - name: 'us-west1-docker.pkg.dev/gemini-code-dev/gemini-code-containers/gemini-code-builder' - entrypoint: 'bash' - args: - - -c # Use bash -c to allow for command substitution and string manipulation - - | - current_version=$(npm pkg get version | sed 's/"//g') - new_version="$${current_version}-$SHORT_SHA.$_REVISION" - npm pkg set "version=$${new_version}" - echo "Set root package.json version to: $${new_version}" - - # Step 3: Run prerelease:dev to update workspace versions and dependencies - - name: 'us-west1-docker.pkg.dev/gemini-code-dev/gemini-code-containers/gemini-code-builder' - entrypoint: 'npm' - args: ['run', 'prerelease:dev'] # This will run prerelease:version and prerelease:deps - - # Step 4: Authenticate for Docker and NPM - - name: 'us-west1-docker.pkg.dev/gemini-code-dev/gemini-code-containers/gemini-code-builder' - entrypoint: 'npm' - args: ['run', 'auth'] - - # Step 5: Run the master release script - - name: 'us-west1-docker.pkg.dev/gemini-code-dev/gemini-code-containers/gemini-code-builder' - entrypoint: 'npm' - args: ['run', 'publish:release'] - env: - - 'GEMINI_SANDBOX=$_CONTAINER_TOOL' - - 'SANDBOX_IMAGE_REGISTRY=$_SANDBOX_IMAGE_REGISTRY' - - 'SANDBOX_IMAGE_NAME=$_SANDBOX_IMAGE_NAME' - - 'NPM_PUBLISH_TAG=$_NPM_PUBLISH_TAG' - -options: - defaultLogsBucketBehavior: REGIONAL_USER_OWNED_BUCKET - dynamicSubstitutions: true - -substitutions: - _REVISION: '0' - _SANDBOX_IMAGE_REGISTRY: 'us-west1-docker.pkg.dev/gemini-code-dev/gemini-cli' - _SANDBOX_IMAGE_NAME: 'sandbox-ci' - _NPM_PUBLISH_TAG: 'head' - _CONTAINER_TOOL: 'docker' diff --git a/.gcp/release.yaml b/.gcp/release.yaml new file mode 100644 index 00000000..03330151 --- /dev/null +++ b/.gcp/release.yaml @@ -0,0 +1,144 @@ +steps: + # Step 1: Install root dependencies (includes workspaces) + - name: 'us-west1-docker.pkg.dev/gemini-code-dev/gemini-code-containers/gemini-code-builder' + id: 'Install Dependencies' + entrypoint: 'npm' + args: ['install'] + + # Step 2: Update version in root package.json + - name: 'us-west1-docker.pkg.dev/gemini-code-dev/gemini-code-containers/gemini-code-builder' + id: 'Set version in workspace root' + entrypoint: 'bash' + args: + - -c # Use bash -c to allow for command substitution and string manipulation + - | + current_version=$(npm pkg get version | sed 's/"//g') + if [ "$_OFFICIAL_RELEASE" = "true" ]; then + new_version="$current_version" + else + new_version="${current_version}-rc.$_REVISION" + fi + npm pkg set "version=${new_version}" + echo "Set root package.json version to: ${new_version}" + + # Step 3: Binds the package versions to the version in the repo root's package.json + - name: 'us-west1-docker.pkg.dev/gemini-code-dev/gemini-code-containers/gemini-code-builder' + id: 'Bind package versions to workspace root' + entrypoint: 'npm' + args: ['run', 'prerelease:dev'] # This will run prerelease:version and prerelease:deps + + # Step 4: Authenticate for Docker (so we can push images to the artifact registry) + - name: 'us-west1-docker.pkg.dev/gemini-code-dev/gemini-code-containers/gemini-code-builder' + id: 'Authenticate docker' + entrypoint: 'npm' + args: ['run', 'auth'] + + # Step 5: Build workspace packages + - name: 'us-west1-docker.pkg.dev/gemini-code-dev/gemini-code-containers/gemini-code-builder' + id: 'Build packages' + entrypoint: 'npm' + args: ['run', 'build:packages'] + + # Step 6: Prepare CLI package.json for publishing + - name: 'us-west1-docker.pkg.dev/gemini-code-dev/gemini-code-containers/gemini-code-builder' + id: 'Prepare @google/gemini-cli package.json and readme' + entrypoint: 'npm' + args: ['run', 'prepare:cli-packagejson'] + env: + - 'GEMINI_SANDBOX=$_CONTAINER_TOOL' + - 'SANDBOX_IMAGE_REGISTRY=$_SANDBOX_IMAGE_REGISTRY' + - 'SANDBOX_IMAGE_NAME=$_SANDBOX_IMAGE_NAME' + + # Step 7: 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'] + env: + - 'GEMINI_SANDBOX=$_CONTAINER_TOOL' + - 'SANDBOX_IMAGE_REGISTRY=$_SANDBOX_IMAGE_REGISTRY' + - 'SANDBOX_IMAGE_NAME=$_SANDBOX_IMAGE_NAME' + + # Step 8: 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'] + env: + - 'GEMINI_SANDBOX=$_CONTAINER_TOOL' + - 'SANDBOX_IMAGE_REGISTRY=$_SANDBOX_IMAGE_REGISTRY' + - 'SANDBOX_IMAGE_NAME=$_SANDBOX_IMAGE_NAME' + + # Pre-Step 9: authenticate to our intermediate npm registry + - name: 'us-west1-docker.pkg.dev/gemini-code-dev/gemini-code-containers/gemini-code-builder' + id: 'Setup @google/gemini-cli-core auth token for publishing' + entrypoint: 'bash' + args: + - -c + - | + echo "//wombat-dressing-room.appspot.com/:_authToken=$$CORE_PACKAGE_PUBLISH_TOKEN" > $$HOME/.npmrc + secretEnv: ['CORE_PACKAGE_PUBLISH_TOKEN'] + + # Step 9: Publish @google/gemini-cli-core to NPM + - name: 'us-west1-docker.pkg.dev/gemini-code-dev/gemini-code-containers/gemini-code-builder' + id: 'Publish @google/gemini-cli-core package' + entrypoint: 'bash' + args: + - -c + - | + if [ "$_OFFICIAL_RELEASE" = "true" ]; then + npm publish --workspace=@google/gemini-cli-core --tag=latest + else + npm publish --workspace=@google/gemini-cli-core --tag=rc + fi + env: + - 'GEMINI_SANDBOX=$_CONTAINER_TOOL' + - 'SANDBOX_IMAGE_REGISTRY=$_SANDBOX_IMAGE_REGISTRY' + - 'SANDBOX_IMAGE_NAME=$_SANDBOX_IMAGE_NAME' + + # Pre-Step 10: authenticate to our intermediate npm registry + - name: 'us-west1-docker.pkg.dev/gemini-code-dev/gemini-code-containers/gemini-code-builder' + id: 'Setup @google/gemini-cli auth token for publishing' + entrypoint: 'bash' + args: + - -c + - | + echo "//wombat-dressing-room.appspot.com/:_authToken=$$CLI_PACKAGE_PUBLISH_TOKEN" > $$HOME/.npmrc + secretEnv: ['CLI_PACKAGE_PUBLISH_TOKEN'] + + # Step 10: Publish @google/gemini-cli to NPM + - name: 'us-west1-docker.pkg.dev/gemini-code-dev/gemini-code-containers/gemini-code-builder' + id: 'Publish @google/gemini-cli package' + entrypoint: 'bash' + args: + - -c + - | + if [ "$_OFFICIAL_RELEASE" = "true" ]; then + npm publish --workspace=@google/gemini-cli --tag=latest + else + npm publish --workspace=@google/gemini-cli --tag=rc + fi + env: + - 'GEMINI_SANDBOX=$_CONTAINER_TOOL' + - 'SANDBOX_IMAGE_REGISTRY=$_SANDBOX_IMAGE_REGISTRY' + - 'SANDBOX_IMAGE_NAME=$_SANDBOX_IMAGE_NAME' + +options: + defaultLogsBucketBehavior: REGIONAL_USER_OWNED_BUCKET + dynamicSubstitutions: true + +availableSecrets: + secretManager: + - versionName: ${_CLI_PACKAGE_WOMBAT_TOKEN_RESOURCE_NAME} + env: 'CLI_PACKAGE_PUBLISH_TOKEN' + - versionName: ${_CORE_PACKAGE_WOMBAT_TOKEN_RESOURCE_NAME} + env: 'CORE_PACKAGE_PUBLISH_TOKEN' + +substitutions: + _REVISION: '0' + _OFFICIAL_RELEASE: 'false' + _CONTAINER_TOOL: 'docker' + _SANDBOX_IMAGE_REGISTRY: '' + _SANDBOX_IMAGE_NAME: '' + _CLI_PACKAGE_WOMBAT_TOKEN_RESOURCE_NAME: '' + _CORE_PACKAGE_WOMBAT_TOKEN_RESOURCE_NAME: '' diff --git a/package-lock.json b/package-lock.json index dd436cc4..2bcaa8a1 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "@google/gemini-cli", - "version": "0.1.1", + "version": "0.1.4", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "@google/gemini-cli", - "version": "0.1.1", + "version": "0.1.4", "workspaces": [ "packages/*" ], @@ -11671,9 +11671,9 @@ }, "packages/cli": { "name": "@google/gemini-cli", - "version": "0.1.1", + "version": "0.1.4", "dependencies": { - "@google/gemini-cli-core": "0.1.1", + "@google/gemini-cli-core": "*", "@types/update-notifier": "^6.0.8", "command-exists": "^1.2.9", "diff": "^7.0.0", @@ -11745,7 +11745,7 @@ }, "packages/core": { "name": "@google/gemini-cli-core", - "version": "0.1.1", + "version": "0.1.4", "dependencies": { "@google/genai": "^1.4.0", "@modelcontextprotocol/sdk": "^1.11.0", diff --git a/package.json b/package.json index bfa9c7f5..27739251 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@google/gemini-cli", - "version": "0.1.1", + "version": "0.1.4", "type": "module", "workspaces": [ "packages/*" @@ -39,11 +39,11 @@ "build:cli": "npm run build --workspace packages/cli", "build:core": "npm run build --workspace packages/core", "build:packages": "npm run build:core && npm run build:cli", - "build:docker": "node scripts/build_sandbox.js -s", + "build:sandbox:fast": "node scripts/build_sandbox.js --skip-npm-install-build", "prepare:cli-packagejson": "node scripts/prepare-cli-packagejson.js", "publish:sandbox": "node scripts/publish-sandbox.js", "publish:npm": "npm publish --workspaces ${NPM_PUBLISH_TAG:+--tag=$NPM_PUBLISH_TAG} ${NPM_DRY_RUN:+--dry-run}", - "publish:release": "npm run build:packages && npm run prepare:cli-packagejson && npm run build:docker && npm run publish:sandbox && npm run publish:npm", + "publish:release": "npm run build:packages && npm run prepare:cli-packagejson && npm run build:sandbox:fast && npm run publish:sandbox && npm run publish:npm", "telemetry": "node scripts/telemetry.js", "start:gcp": "concurrently --raw --kill-others \"npm run telemetry -- --target=gcp\" \"npm start\"" }, diff --git a/packages/cli/package.json b/packages/cli/package.json index 40ea7306..8e033e0d 100644 --- a/packages/cli/package.json +++ b/packages/cli/package.json @@ -1,6 +1,6 @@ { "name": "@google/gemini-cli", - "version": "0.1.1", + "version": "0.1.4", "description": "Gemini CLI", "type": "module", "main": "dist/index.js", @@ -28,7 +28,7 @@ "sandboxImageUri": "us-docker.pkg.dev/gemini-code-dev/gemini-cli/sandbox:0.1.1" }, "dependencies": { - "@google/gemini-cli-core": "0.1.1", + "@google/gemini-cli-core": "*", "@types/update-notifier": "^6.0.8", "command-exists": "^1.2.9", "diff": "^7.0.0", diff --git a/packages/core/package.json b/packages/core/package.json index 1700637e..87d6ba99 100644 --- a/packages/core/package.json +++ b/packages/core/package.json @@ -1,6 +1,6 @@ { "name": "@google/gemini-cli-core", - "version": "0.1.1", + "version": "0.1.4", "description": "Gemini CLI Server", "type": "module", "main": "dist/index.js", diff --git a/scripts/prepare-cli-packagejson.js b/scripts/prepare-cli-packagejson.js index 187dd283..64c36ff0 100644 --- a/scripts/prepare-cli-packagejson.js +++ b/scripts/prepare-cli-packagejson.js @@ -62,3 +62,15 @@ console.log( console.log(` URI: ${containerImageUri}`); console.log(` Registry: ${containerImageRegistry}`); console.log(` Image Name: ${containerImageName}`); + +// Copy README.md to packages/cli +const rootReadmePath = path.resolve(__dirname, '../README.md'); +const cliReadmePath = path.resolve(__dirname, '../packages/cli/README.md'); + +try { + fs.copyFileSync(rootReadmePath, cliReadmePath); + console.log('Copied root README.md to packages/cli/'); +} catch (err) { + console.error('Error copying README.md:', err); + process.exit(1); +}