feat(ci): Update release to use github env variables. (#11068)

This commit is contained in:
Richie Foreman
2025-10-15 09:48:03 -04:00
committed by GitHub
parent 203bad7c06
commit 984415f6c7
13 changed files with 394 additions and 152 deletions

View File

@@ -12,23 +12,28 @@ on:
required: true
type: 'choice'
options:
- 'dev'
- 'latest'
- 'preview'
- 'nightly'
ref:
description: 'The branch, tag, or SHA to run from.'
required: false
type: 'string'
default: 'main'
dry-run:
description: 'Whether to run in dry-run mode.'
required: false
type: 'boolean'
default: true
environment:
description: 'Environment'
required: false
type: 'choice'
options:
- 'prod'
- 'dev'
default: 'prod'
jobs:
change-tags:
runs-on: 'ubuntu-latest'
environment: '${{ github.event.inputs.environment }}'
permissions:
packages: 'write'
issues: 'write'
@@ -36,15 +41,13 @@ jobs:
- name: 'Checkout repository'
uses: 'actions/checkout@v4'
with:
ref: '${{ github.event.inputs.ref }}'
ref: '${{ github.ref }}'
fetch-depth: 0
- name: 'Setup Node.js'
uses: 'actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020'
with:
node-version-file: '.nvmrc'
registry-url: 'https://wombat-dressing-room.appspot.com'
scope: '@google'
- name: 'Change tag'
uses: './.github/actions/tag-npm-release'
@@ -55,3 +58,8 @@ jobs:
wombat-token-core: '${{ secrets.WOMBAT_TOKEN_CORE }}'
wombat-token-cli: '${{ secrets.WOMBAT_TOKEN_CLI }}'
wombat-token-a2a-server: '${{ secrets.WOMBAT_TOKEN_A2A_SERVER }}'
github-token: '${{ secrets.GITHUB_TOKEN }}'
cli-package-name: '${{ vars.CLI_PACKAGE_NAME }}'
core-package-name: '${{ vars.CORE_PACKAGE_NAME }}'
a2a-package-name: '${{ vars.A2A_PACKAGE_NAME }}'
ref: '${{ github.ref }}'

View File

@@ -11,19 +11,12 @@ on:
description: 'The branch, tag, or SHA to release from.'
required: true
type: 'string'
registry:
description: 'The registry to publish to.'
required: true
type: 'choice'
options:
- 'npm-wombat'
- 'github'
default: 'npm-wombat'
npm_channel:
description: 'The npm channel to publish to (only used when registry is npm-wombat)'
description: 'The npm channel to publish to'
required: true
type: 'choice'
options:
- 'dev'
- 'preview'
- 'nightly'
- 'latest'
@@ -39,14 +32,23 @@ on:
type: 'boolean'
default: false
skip_github_release:
description: 'Select to skip creating a GitHub release (only used when registry is npm-wombat)'
description: 'Select to skip creating a GitHub release (only used when environment is PROD)'
required: false
type: 'boolean'
default: false
environment:
description: 'Environment'
required: false
type: 'choice'
options:
- 'prod'
- 'dev'
default: 'prod'
jobs:
release:
runs-on: 'ubuntu-latest'
runs-on: 'self-hosted'
environment: '${{ github.event.inputs.environment }}'
permissions:
contents: 'write'
packages: 'write'
@@ -111,7 +113,12 @@ jobs:
skip-github-release: '${{ github.event.inputs.skip_github_release }}'
working-directory: './release'
gemini_api_key: '${{ secrets.GEMINI_API_KEY }}'
registry: '${{ github.event.inputs.registry }}'
npm-registry-publish-url: '${{ vars.NPM_REGISTRY_PUBLISH_URL }}'
npm-registry-url: '${{ vars.NPM_REGISTRY_URL }}'
npm-registry-scope: '${{ vars.NPM_REGISTRY_SCOPE }}'
cli-package-name: '${{ vars.CLI_PACKAGE_NAME }}'
core-package-name: '${{ vars.CORE_PACKAGE_NAME }}'
a2a-package-name: '${{ vars.A2A_PACKAGE_NAME }}'
- name: 'Create Issue on Failure'
if: '${{ failure() && github.event.inputs.dry_run == false }}'

View File

@@ -20,9 +20,18 @@ on:
required: false
type: 'string'
default: 'main'
environment:
description: 'Environment'
required: false
type: 'choice'
options:
- 'prod'
- 'dev'
default: 'prod'
jobs:
release:
environment: '${{ github.event.inputs.environment }}'
runs-on: 'ubuntu-latest'
permissions:
contents: 'write'
@@ -120,8 +129,15 @@ jobs:
skip-branch-cleanup: true
force-skip-tests: "${{ github.event_name != 'schedule' && github.event.inputs.force_skip_tests == 'true' }}"
gemini_api_key: '${{ secrets.GEMINI_API_KEY }}'
npm-registry-publish-url: '${{ vars.NPM_REGISTRY_PUBLISH_URL }}'
npm-registry-url: '${{ vars.NPM_REGISTRY_URL }}'
npm-registry-scope: '${{ vars.NPM_REGISTRY_SCOPE }}'
cli-package-name: '${{ vars.CLI_PACKAGE_NAME }}'
core-package-name: '${{ vars.CORE_PACKAGE_NAME }}'
a2a-package-name: '${{ vars.A2A_PACKAGE_NAME }}'
- name: 'Create and Merge Pull Request'
if: "github.event.inputs.environment == 'prod'"
uses: './.github/actions/create-pull-request'
with:
branch-name: 'release/${{ steps.nightly_version.outputs.RELEASE_TAG }}'
@@ -132,7 +148,7 @@ jobs:
working-directory: './release'
- name: 'Create Issue on Failure'
if: "${{ failure() && (github.event_name == 'schedule' || github.event.inputs.dry_run != 'true') }}"
if: "${{ failure() && github.event.inputs.environment == 'prod' && (github.event_name == 'schedule' || github.event.inputs.dry_run != 'true') }}"
env:
GITHUB_TOKEN: '${{ secrets.GITHUB_TOKEN }}'
RELEASE_TAG: '${{ steps.nightly_version.outputs.RELEASE_TAG }}'

View File

@@ -28,10 +28,19 @@ on:
description: 'The original PR number to comment back on.'
required: false
type: 'string'
environment:
description: 'Environment'
required: false
type: 'choice'
options:
- 'prod'
## - 'dev' # TODO(richieforeman) - support dev
default: 'prod'
jobs:
release:
runs-on: 'ubuntu-latest'
environment: '${{ github.event.inputs.environment }}'
permissions:
contents: 'write'
packages: 'write'
@@ -165,6 +174,12 @@ jobs:
previous-tag: '${{ steps.patch_version.outputs.PREVIOUS_TAG }}'
working-directory: './release'
gemini_api_key: '${{ secrets.GEMINI_API_KEY }}'
npm-registry-publish-url: '${{ vars.NPM_REGISTRY_PUBLISH_URL }}'
npm-registry-url: '${{ vars.NPM_REGISTRY_URL }}'
npm-registry-scope: '${{ vars.NPM_REGISTRY_SCOPE }}'
cli-package-name: '${{ vars.CLI_PACKAGE_NAME }}'
core-package-name: '${{ vars.CORE_PACKAGE_NAME }}'
a2a-package-name: '${{ vars.A2A_PACKAGE_NAME }}'
- name: 'Create Issue on Failure'
if: '${{ failure() && github.event.inputs.dry_run == false }}'

View File

@@ -26,11 +26,21 @@ on:
description: 'Manually override the preview version number.'
required: false
type: 'string'
environment:
description: 'Environment'
required: false
type: 'choice'
options:
- 'prod'
- 'dev'
default: 'prod'
jobs:
calculate-versions:
name: 'Calculate Versions and Plan'
runs-on: 'ubuntu-latest'
environment: '${{ github.event.inputs.environment }}'
outputs:
STABLE_VERSION: '${{ steps.versions.outputs.STABLE_VERSION }}'
STABLE_SHA: '${{ steps.versions.outputs.STABLE_SHA }}'
@@ -169,6 +179,7 @@ jobs:
name: 'Publish preview'
needs: ['calculate-versions', 'test']
runs-on: 'ubuntu-latest'
environment: '${{ github.event.inputs.environment }}'
permissions:
contents: 'write'
packages: 'write'
@@ -211,6 +222,12 @@ jobs:
working-directory: './release'
gemini_api_key: '${{ secrets.GEMINI_API_KEY }}'
force-skip-tests: '${{ github.event.inputs.force_skip_tests }}'
npm-registry-publish-url: '${{ vars.NPM_REGISTRY_PUBLISH_URL }}'
npm-registry-url: '${{ vars.NPM_REGISTRY_URL }}'
npm-registry-scope: '${{ vars.NPM_REGISTRY_SCOPE }}'
cli-package-name: '${{ vars.CLI_PACKAGE_NAME }}'
core-package-name: '${{ vars.CORE_PACKAGE_NAME }}'
a2a-package-name: '${{ vars.A2A_PACKAGE_NAME }}'
- name: 'Create Issue on Failure'
if: '${{ failure() && github.event.inputs.dry_run == false }}'
@@ -228,6 +245,7 @@ jobs:
name: 'Publish stable'
needs: ['calculate-versions', 'test', 'publish-preview']
runs-on: 'ubuntu-latest'
environment: '${{ github.event.inputs.environment }}'
permissions:
contents: 'write'
packages: 'write'
@@ -270,6 +288,12 @@ jobs:
working-directory: './release'
gemini_api_key: '${{ secrets.GEMINI_API_KEY }}'
force-skip-tests: '${{ github.event.inputs.force_skip_tests }}'
npm-registry-publish-url: '${{ vars.NPM_REGISTRY_PUBLISH_URL }}'
npm-registry-url: '${{ vars.NPM_REGISTRY_URL }}'
npm-registry-scope: '${{ vars.NPM_REGISTRY_SCOPE }}'
cli-package-name: '${{ vars.CLI_PACKAGE_NAME }}'
core-package-name: '${{ vars.CORE_PACKAGE_NAME }}'
a2a-package-name: '${{ vars.A2A_PACKAGE_NAME }}'
- name: 'Create Issue on Failure'
if: '${{ failure() && github.event.inputs.dry_run == false }}'

View File

@@ -34,6 +34,7 @@ on:
jobs:
change-tags:
environment: 'prod' ## TODO(richieforeman) Support Dev mode
runs-on: 'ubuntu-latest'
permissions:
packages: 'write'
@@ -77,6 +78,10 @@ jobs:
wombat-token-core: '${{ secrets.WOMBAT_TOKEN_CORE }}'
wombat-token-cli: '${{ secrets.WOMBAT_TOKEN_CLI }}'
wombat-token-a2a-server: '${{ secrets.WOMBAT_TOKEN_A2A_SERVER }}'
github-token: '${{ secrets.GITHUB_TOKEN }}'
cli-package-name: '${{ vars.CLI_PACKAGE_NAME }}'
core-package-name: '${{ vars.CORE_PACKAGE_NAME }}'
a2a-package-name: '${{ vars.A2A_PACKAGE_NAME }}'
- name: 'Deprecate Cli Npm Package'
if: "${{ github.event.inputs.dry-run == 'false' }}"

View File

@@ -22,7 +22,8 @@ jobs:
smoke-test:
runs-on: 'ubuntu-latest'
permissions:
contents: 'read'
contents: 'write'
packages: 'write'
issues: 'write'
steps:
- name: 'Checkout'

View File

@@ -7,26 +7,45 @@ on:
description: 'The expected Gemini binary version that should be released (e.g., 0.5.0-preview-2).'
required: true
type: 'string'
npm-package:
description: 'NPM package to verify'
npm-tag:
description: 'NPM tag to verify'
required: true
type: 'string'
default: '@google/gemini-cli@latest'
ref:
description: 'The branch, tag, or SHA to release from.'
type: 'choice'
options:
- 'dev'
- 'latest'
- 'preview'
- 'nightly'
default: 'latest'
environment:
description: 'Environment'
required: false
type: 'string'
default: 'main'
type: 'choice'
options:
- 'prod'
- 'dev'
default: 'prod'
jobs:
build:
verify-release:
environment: '${{ github.event.inputs.environment }}'
runs-on: 'ubuntu-latest'
permissions:
contents: 'read'
packages: 'write'
issues: 'write'
steps:
- name: '📝 Print vars'
shell: 'bash'
run: 'echo "${{ toJSON(vars) }}"'
- uses: 'actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8'
- name: 'Verify release'
uses: './.github/actions/verify-release'
with:
npm-package: '${{github.event.inputs.npm-package}}'
npm-package: '${{vars.CLI_PACKAGE_NAME}}@${{github.event.inputs.npm-tag}}'
expected-version: '${{github.event.inputs.version}}'
ref: '${{github.event.inputs.ref}}'
ref: '${{github.ref}}'
gemini_api_key: '${{ secrets.GEMINI_API_KEY }}'
npm-registry-url: '${{ vars.NPM_REGISTRY_URL }}'
github-token: '${{ secrets.GITHUB_TOKEN }}'
npm-registry-scope: '${{ vars.NPM_REGISTRY_SCOPE }}'