feat: simplify patch release workflow (#8196)

Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>
Co-authored-by: Richie Foreman <richie.foreman@gmail.com>
This commit is contained in:
matt korwel
2025-09-12 10:22:10 -07:00
committed by GitHub
parent eaadc6d93d
commit c99539b991
10 changed files with 489 additions and 86 deletions

View File

@@ -19,9 +19,10 @@ inputs:
required: true
dry-run:
description: 'Whether to run in dry-run mode.'
type: 'boolean'
required: true
release-branch:
description: 'The branch to target for the release.'
release-tag:
description: 'The release tag for the release (e.g., v0.1.11).'
required: true
previous-tag:
description: 'The previous tag to use for generating release notes.'
@@ -34,6 +35,44 @@ inputs:
runs:
using: 'composite'
steps:
- name: 'Configure Git User'
working-directory: '${{ inputs.working-directory }}'
shell: 'bash'
run: |-
git config user.name "gemini-cli-robot"
git config user.email "gemini-cli-robot@google.com"
- name: 'Create and switch to a release branch'
working-directory: '${{ inputs.working-directory }}'
id: 'release_branch'
shell: 'bash'
run: |
BRANCH_NAME="release/${{ inputs.release-tag }}"
git switch -c "${BRANCH_NAME}"
echo "BRANCH_NAME=${BRANCH_NAME}" >> "${GITHUB_OUTPUT}"
- name: 'Update package versions'
working-directory: '${{ inputs.working-directory }}'
shell: 'bash'
run: 'npm run release:version "${{ inputs.release-version }}"'
- name: 'Commit and Conditionally Push package versions'
working-directory: '${{ inputs.working-directory }}'
shell: 'bash'
env:
BRANCH_NAME: '${{ steps.release_branch.outputs.BRANCH_NAME }}'
DRY_RUN: '${{ inputs.dry-run }}'
RELEASE_TAG: '${{ inputs.release-tag }}'
run: |-
git add package.json package-lock.json packages/*/package.json
git commit -m "chore(release): ${RELEASE_TAG}"
if [[ "${DRY_RUN}" == "false" ]]; then
echo "Pushing release branch to remote..."
git push --set-upstream origin "${BRANCH_NAME}" --follow-tags
else
echo "Dry run enabled. Skipping push."
fi
- name: 'Build and Prepare Packages'
working-directory: '${{ inputs.working-directory }}'
run: |-
@@ -61,7 +100,7 @@ runs:
- name: 'Install latest core package'
working-directory: '${{ inputs.working-directory }}'
if: '${{ inputs.dry-run == "false" }}'
if: '${{ inputs.dry-run == false }}'
run: |-
npm install "@google/gemini-cli-core@${{ inputs.release-version }}" \
--workspace="@google/gemini-cli" \
@@ -86,14 +125,28 @@ runs:
- name: 'Create GitHub Release'
working-directory: '${{ inputs.working-directory }}'
if: '${{ inputs.dry-run == "false" }}'
if: '${{ inputs.dry-run == false }}'
env:
GITHUB_TOKEN: '${{ inputs.github-token }}'
run: |-
gh release create "v${{ inputs.release-version }}" \
gh release create "${{ inputs.release-tag }}" \
bundle/gemini.js \
--target "${{ inputs.release-branch }}" \
--title "Release v${{ inputs.release-version }}" \
--target "${{ steps.release_branch.outputs.BRANCH_NAME }}" \
--title "Release ${{ inputs.release-tag }}" \
--notes-start-tag "${{ inputs.previous-tag }}" \
--generate-notes
shell: 'bash'
- name: 'Create Issue on Failure'
if: |-
${{ failure() }}
env:
GITHUB_TOKEN: '${{ inputs.github-token }}'
RELEASE_TAG: '${{ inputs.release-tag }} || "N/A"'
DETAILS_URL: '${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}'
run: |-
gh issue create \
--title "Release Failed for ${RELEASE_TAG} on $(date +'%Y-%m-%d')" \
--body "The release workflow failed. See the full run for details: ${DETAILS_URL}" \
--label "kind/bug,release-failure,priority/p0"
shell: 'bash'

24
.github/actions/run-tests/action.yml vendored Normal file
View File

@@ -0,0 +1,24 @@
name: 'Run Tests'
description: 'Runs the preflight checks and integration tests.'
inputs:
force_skip_tests:
description: 'Whether to force skip the tests.'
required: false
default: 'false'
gemini_api_key:
description: 'The API key for running integration tests.'
required: true
runs:
using: 'composite'
steps:
- name: 'Run Tests'
if: "inputs.force_skip_tests != 'true'"
env:
GEMINI_API_KEY: '${{ inputs.gemini_api_key }}'
run: |-
npm run preflight
npm run test:integration:sandbox:none
npm run test:integration:sandbox:docker
shell: 'bash'