Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 8 additions & 4 deletions .github/actions/create-pull-request/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -43,13 +43,17 @@ runs:
if: "inputs.dry-run == 'false'"
env:
GH_TOKEN: '${{ steps.generate_token.outputs.token }}'
INPUTS_PR_TITLE: ${{ inputs.pr-title }}
INPUTS_PR_BODY: ${{ inputs.pr-body }}
INPUTS_BASE_BRANCH: ${{ inputs.base-branch }}
INPUTS_BRANCH_NAME: ${{ inputs.branch-name }}
shell: 'bash'
run: |
set -e
PR_URL=$(gh pr create \
--title "${{ inputs.pr-title }}" \
--body "${{ inputs.pr-body }}" \
--base "${{ inputs.base-branch }}" \
--head "${{ inputs.branch-name }}" \
--title "${INPUTS_PR_TITLE}" \
--body "${INPUTS_PR_BODY}" \
--base "${INPUTS_BASE_BRANCH}" \
--head "${INPUTS_BRANCH_NAME}" \
--fill)
gh pr merge "$PR_URL" --auto --squash
35 changes: 24 additions & 11 deletions .github/actions/publish-release/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -52,15 +52,19 @@ runs:
id: 'release_branch'
shell: 'bash'
run: |
BRANCH_NAME="release/${{ inputs.release-tag }}"
BRANCH_NAME="release/${INPUTS_RELEASE_TAG}"
git switch -c "${BRANCH_NAME}"
echo "BRANCH_NAME=${BRANCH_NAME}" >> "${GITHUB_OUTPUT}"
env:
INPUTS_RELEASE_TAG: ${{ inputs.release-tag }}

- name: '⬆️ Update package versions'
working-directory: '${{ inputs.working-directory }}'
shell: 'bash'
run: |
npm run release:version "${{ inputs.release-version }}"
npm run release:version "${INPUTS_RELEASE_VERSION}"
env:
INPUTS_RELEASE_VERSION: ${{ inputs.release-version }}

- name: '💾 Commit and Conditionally Push package versions'
working-directory: '${{ inputs.working-directory }}'
Expand Down Expand Up @@ -103,32 +107,38 @@ runs:
working-directory: '${{ inputs.working-directory }}'
env:
NODE_AUTH_TOKEN: '${{ inputs.wombat-token-core }}'
INPUTS_DRY_RUN: ${{ inputs.dry-run }}
INPUTS_NPM_TAG: ${{ inputs.npm-tag }}
shell: 'bash'
run: |
npm publish \
--dry-run="${{ inputs.dry-run }}" \
--dry-run="${INPUTS_DRY_RUN}" \
--workspace="@google/gemini-cli-core" \
--tag="${{ inputs.npm-tag }}"
--tag="${INPUTS_NPM_TAG}"

- name: '🔗 Install latest core package'
working-directory: '${{ inputs.working-directory }}'
if: "${{ inputs.dry-run == 'false' }}"
shell: 'bash'
run: |
npm install "@google/gemini-cli-core@${{ inputs.release-version }}" \
npm install "@google/gemini-cli-core@${INPUTS_RELEASE_VERSION}" \
--workspace="@google/gemini-cli" \
--save-exact
env:
INPUTS_RELEASE_VERSION: ${{ inputs.release-version }}

- name: '📦 Publish @google/gemini-cli'
working-directory: '${{ inputs.working-directory }}'
env:
NODE_AUTH_TOKEN: '${{ inputs.wombat-token-cli }}'
INPUTS_DRY_RUN: ${{ inputs.dry-run }}
INPUTS_NPM_TAG: ${{ inputs.npm-tag }}
shell: 'bash'
run: |
npm publish \
--dry-run="${{ inputs.dry-run }}" \
--dry-run="${INPUTS_DRY_RUN}" \
--workspace="@google/gemini-cli" \
--tag="${{ inputs.npm-tag }}"
--tag="${INPUTS_NPM_TAG}"

- name: '🎁 Bundle'
working-directory: '${{ inputs.working-directory }}'
Expand All @@ -141,11 +151,14 @@ runs:
if: "${{ inputs.dry-run == 'false' }}"
env:
GITHUB_TOKEN: '${{ inputs.github-token }}'
INPUTS_RELEASE_TAG: ${{ inputs.release-tag }}
STEPS_RELEASE_BRANCH_OUTPUTS_BRANCH_NAME: ${{ steps.release_branch.outputs.BRANCH_NAME }}
INPUTS_PREVIOUS_TAG: ${{ inputs.previous-tag }}
shell: 'bash'
run: |
gh release create "${{ inputs.release-tag }}" \
gh release create "${INPUTS_RELEASE_TAG}" \
bundle/gemini.js \
--target "${{ steps.release_branch.outputs.BRANCH_NAME }}" \
--title "Release ${{ inputs.release-tag }}" \
--notes-start-tag "${{ inputs.previous-tag }}" \
--target "${STEPS_RELEASE_BRANCH_OUTPUTS_BRANCH_NAME}" \
--title "Release ${INPUTS_RELEASE_TAG}" \
--notes-start-tag "${INPUTS_PREVIOUS_TAG}" \
--generate-notes
4 changes: 3 additions & 1 deletion .github/actions/push-docker/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -47,8 +47,10 @@ runs:
id: 'branch_name'
shell: 'bash'
run: |
REF_NAME="${{ inputs.ref-name }}"
REF_NAME="${INPUTS_REF_NAME}"
echo "name=${REF_NAME%/merge}" >> $GITHUB_OUTPUT
env:
INPUTS_REF_NAME: ${{ inputs.ref-name }}
- name: 'Build and Push the Docker Image'
uses: 'docker/build-push-action@263435318d21b8e681c14492fe198d362a7d2c83' # ratchet:docker/build-push-action@v6
with:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/eval.yml
Original file line number Diff line number Diff line change
Expand Up @@ -44,5 +44,5 @@ jobs:
- name: 'Run evaluation'
working-directory: '/app'
run: |
poetry run exp_run --experiment-mode=on-demand --branch-or-commit=${{ github.ref_name }} --model-name=gemini-2.5-pro --dataset=swebench_verified --concurrency=15
poetry run exp_run --experiment-mode=on-demand --branch-or-commit=${GITHUB_REF_NAME} --model-name=gemini-2.5-pro --dataset=swebench_verified --concurrency=15
poetry run python agent_prototypes/scripts/parse_gcli_logs_experiment.py --experiment_dir=experiments/adhoc/gcli_temp_exp --gcs-bucket="${EVAL_GCS_BUCKET}" --gcs-path=gh_action_artifacts
4 changes: 3 additions & 1 deletion .github/workflows/gemini-automated-issue-triage.yml
Original file line number Diff line number Diff line change
Expand Up @@ -71,8 +71,10 @@ jobs:
if: |-
github.event_name == 'workflow_dispatch' && !contains(steps.get_issue_data.outputs.labels, 'status/need-triage')
run: |
echo "Issue #${{ github.event.inputs.issue_number }} does not have the 'status/need-triage' label. Stopping workflow."
echo "Issue #${GITHUB_EVENT_INPUTS_ISSUE_NUMBER} does not have the 'status/need-triage' label. Stopping workflow."
exit 1
env:
GITHUB_EVENT_INPUTS_ISSUE_NUMBER: ${{ github.event.inputs.issue_number }}

- name: 'Checkout'
uses: 'actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8' # ratchet:actions/checkout@v5
Expand Down
13 changes: 10 additions & 3 deletions .github/workflows/release-change-tags.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,17 +39,24 @@ jobs:
if: 'github.event.inputs.dry_run == false'
env:
NODE_AUTH_TOKEN: '${{ secrets.WOMBAT_TOKEN_CORE }}'
GITHUB_EVENT_INPUTS_VERSION: ${{ github.event.inputs.version }}
GITHUB_EVENT_INPUTS_CHANNEL: ${{ github.event.inputs.channel }}
run: |
npm dist-tag add @google/gemini-cli-core@${{ github.event.inputs.version }} ${{ github.event.inputs.channel }}
npm dist-tag add @google/gemini-cli-core@${GITHUB_EVENT_INPUTS_VERSION} ${GITHUB_EVENT_INPUTS_CHANNEL}

- name: 'Change tag for @google/gemini-cli'
if: 'github.event.inputs.dry_run == false'
env:
NODE_AUTH_TOKEN: '${{ secrets.WOMBAT_TOKEN_CLI }}'
GITHUB_EVENT_INPUTS_VERSION: ${{ github.event.inputs.version }}
GITHUB_EVENT_INPUTS_CHANNEL: ${{ github.event.inputs.channel }}
run: |
npm dist-tag add @google/gemini-cli@${{ github.event.inputs.version }} ${{ github.event.inputs.channel }}
npm dist-tag add @google/gemini-cli@${GITHUB_EVENT_INPUTS_VERSION} ${GITHUB_EVENT_INPUTS_CHANNEL}

- name: 'Log dry run'
if: 'github.event.inputs.dry_run == true'
run: |
echo "Dry run: Would have added tag '${{ github.event.inputs.channel }}' to version '${{ github.event.inputs.version }}' for @google/gemini-cli and @google/gemini-cli-core."
echo "Dry run: Would have added tag '${GITHUB_EVENT_INPUTS_CHANNEL}' to version '${GITHUB_EVENT_INPUTS_VERSION}' for @google/gemini-cli and @google/gemini-cli-core."
env:
GITHUB_EVENT_INPUTS_CHANNEL: ${{ github.event.inputs.channel }}
GITHUB_EVENT_INPUTS_VERSION: ${{ github.event.inputs.version }}
4 changes: 3 additions & 1 deletion .github/workflows/release-manual.yml
Original file line number Diff line number Diff line change
Expand Up @@ -56,9 +56,11 @@ jobs:
- name: 'Prepare Release Info'
id: 'release_info'
run: |
RELEASE_VERSION="${{ github.event.inputs.version }}"
RELEASE_VERSION="${GITHUB_EVENT_INPUTS_VERSION}"
echo "RELEASE_VERSION=${RELEASE_VERSION#v}" >> "${GITHUB_OUTPUT}"
echo "PREVIOUS_TAG=$(git describe --tags --abbrev=0)" >> "${GITHUB_OUTPUT}"
env:
GITHUB_EVENT_INPUTS_VERSION: ${{ github.event.inputs.version }}

- name: 'Run Tests'
if: |-
Expand Down
31 changes: 20 additions & 11 deletions .github/workflows/release-patch-1-create-pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -70,9 +70,11 @@ jobs:
if: "github.event.inputs.channel == 'stable'"
env:
GH_TOKEN: '${{ steps.generate_token.outputs.token }}'
GITHUB_EVENT_INPUTS_COMMIT: ${{ github.event.inputs.commit }}
GITHUB_EVENT_INPUTS_DRY_RUN: ${{ github.event.inputs.dry_run }}
continue-on-error: true
run: |
node scripts/create-patch-pr.js --commit=${{ github.event.inputs.commit }} --channel=stable --dry-run=${{ github.event.inputs.dry_run }} > patch_output.log 2>&1
node scripts/create-patch-pr.js --commit=${GITHUB_EVENT_INPUTS_COMMIT} --channel=stable --dry-run=${GITHUB_EVENT_INPUTS_DRY_RUN} > patch_output.log 2>&1
echo "EXIT_CODE=$?" >> "$GITHUB_OUTPUT"
cat patch_output.log

Expand All @@ -81,22 +83,29 @@ jobs:
if: "github.event.inputs.channel != 'stable'"
env:
GH_TOKEN: '${{ steps.generate_token.outputs.token }}'
GITHUB_EVENT_INPUTS_COMMIT: ${{ github.event.inputs.commit }}
GITHUB_EVENT_INPUTS_CHANNEL: ${{ github.event.inputs.channel }}
GITHUB_EVENT_INPUTS_DRY_RUN: ${{ github.event.inputs.dry_run }}
continue-on-error: true
run: |
node scripts/create-patch-pr.js --commit=${{ github.event.inputs.commit }} --channel=${{ github.event.inputs.channel }} --dry-run=${{ github.event.inputs.dry_run }} > patch_output.log 2>&1
node scripts/create-patch-pr.js --commit=${GITHUB_EVENT_INPUTS_COMMIT} --channel=${GITHUB_EVENT_INPUTS_CHANNEL} --dry-run=${GITHUB_EVENT_INPUTS_DRY_RUN} > patch_output.log 2>&1
echo "EXIT_CODE=$?" >> "$GITHUB_OUTPUT"
cat patch_output.log

- name: 'Comment on Original PR'
if: '!inputs.dry_run && inputs.original_pr'
env:
GH_TOKEN: '${{ steps.generate_token.outputs.token }}'
GITHUB_EVENT_INPUTS_CHANNEL: ${{ github.event.inputs.channel }}
STEPS_CREATE_PATCH_STABLE_OUTPUTS_EXIT_CODE: ${{ steps.create_patch_stable.outputs.EXIT_CODE }}
STEPS_CREATE_PATCH_PREVIEW_OUTPUTS_EXIT_CODE: ${{ steps.create_patch_preview.outputs.EXIT_CODE }}
GITHUB_EVENT_INPUTS_ORIGINAL_PR: ${{ github.event.inputs.original_pr }}
run: |
# Determine which step ran based on channel
if [ "${{ github.event.inputs.channel }}" = "stable" ]; then
EXIT_CODE="${{ steps.create_patch_stable.outputs.EXIT_CODE }}"
if [ "${GITHUB_EVENT_INPUTS_CHANNEL}" = "stable" ]; then
EXIT_CODE="${STEPS_CREATE_PATCH_STABLE_OUTPUTS_EXIT_CODE}"
else
EXIT_CODE="${{ steps.create_patch_preview.outputs.EXIT_CODE }}"
EXIT_CODE="${STEPS_CREATE_PATCH_PREVIEW_OUTPUTS_EXIT_CODE}"
fi

# Check if patch output exists and contains branch info
Expand All @@ -105,12 +114,12 @@ jobs:
# Branch exists with existing PR
PR_NUMBER=$(grep "Found existing PR" patch_output.log | sed 's/.*Found existing PR #\([0-9]*\).*/\1/')
PR_URL=$(grep "Found existing PR" patch_output.log | sed 's/.*Found existing PR #[0-9]*: \(.*\)/\1/')
gh pr comment ${{ github.event.inputs.original_pr }} --body "ℹ️ Patch PR already exists! A patch PR for this change already exists: [#$PR_NUMBER]($PR_URL). Please review and approve this existing patch PR. If it's incorrect, close it and run the patch command again."
gh pr comment ${GITHUB_EVENT_INPUTS_ORIGINAL_PR} --body "ℹ️ Patch PR already exists! A patch PR for this change already exists: [#$PR_NUMBER]($PR_URL). Please review and approve this existing patch PR. If it's incorrect, close it and run the patch command again."

elif grep -q "exists but has no open PR" patch_output.log; then
# Branch exists but no PR
BRANCH=$(grep "Hotfix branch" patch_output.log | grep "already exists" | sed 's/.*Hotfix branch \(.*\) already exists.*/\1/')
gh pr comment ${{ github.event.inputs.original_pr }} --body "ℹ️ Patch branch exists but no PR found! A patch branch [\`$BRANCH\`](https://github.com/${{ github.repository }}/tree/$BRANCH) exists but has no open PR. This might indicate an incomplete patch process. Please delete the branch and run the patch command again."
gh pr comment ${GITHUB_EVENT_INPUTS_ORIGINAL_PR} --body "ℹ️ Patch branch exists but no PR found! A patch branch [\`$BRANCH\`](https://github.com/${{ github.repository }}/tree/$BRANCH) exists but has no open PR. This might indicate an incomplete patch process. Please delete the branch and run the patch command again."

elif [ "$EXIT_CODE" = "0" ]; then
# Success - find the newly created PR
Expand All @@ -122,15 +131,15 @@ jobs:
if [ -n "$PR_INFO" ]; then
PR_NUMBER=$(echo "$PR_INFO" | jq -r '.number')
PR_URL=$(echo "$PR_INFO" | jq -r '.url')
gh pr comment ${{ github.event.inputs.original_pr }} --body "🚀 Patch PR created! The patch release PR has been created: [#$PR_NUMBER]($PR_URL). Please review and approve this PR to complete the patch release."
gh pr comment ${GITHUB_EVENT_INPUTS_ORIGINAL_PR} --body "🚀 Patch PR created! The patch release PR has been created: [#$PR_NUMBER]($PR_URL). Please review and approve this PR to complete the patch release."
else
# Fallback if we can't find the specific PR
gh pr comment ${{ github.event.inputs.original_pr }} --body "🚀 Patch PR created! The patch release PR for this change has been created. Please review and approve it: [View all patch PRs](https://github.com/${{ github.repository }}/pulls?q=is%3Apr+is%3Aopen+label%3Apatch)"
gh pr comment ${GITHUB_EVENT_INPUTS_ORIGINAL_PR} --body "🚀 Patch PR created! The patch release PR for this change has been created. Please review and approve it: [View all patch PRs](https://github.com/${{ github.repository }}/pulls?q=is%3Apr+is%3Aopen+label%3Apatch)"
fi
else
# Other error
gh pr comment ${{ github.event.inputs.original_pr }} --body "❌ Patch creation failed! There was an error creating the patch. Please check the workflow logs for details: [View workflow run](https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }})"
gh pr comment ${GITHUB_EVENT_INPUTS_ORIGINAL_PR} --body "❌ Patch creation failed! There was an error creating the patch. Please check the workflow logs for details: [View workflow run](https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }})"
fi
else
gh pr comment ${{ github.event.inputs.original_pr }} --body "❌ Patch creation failed! No output was generated. Please check the workflow logs: [View workflow run](https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }})"
gh pr comment ${GITHUB_EVENT_INPUTS_ORIGINAL_PR} --body "❌ Patch creation failed! No output was generated. Please check the workflow logs: [View workflow run](https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }})"
fi
16 changes: 11 additions & 5 deletions .github/workflows/release-patch-3-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -66,10 +66,11 @@ jobs:
id: 'patch_version'
env:
GH_TOKEN: '${{ secrets.GITHUB_TOKEN }}'
GITHUB_EVENT_INPUTS_TYPE: ${{ github.event.inputs.type }}
run: |
# Use the existing get-release-version.js script to calculate patch version
# Run from main checkout which has full git history and access to npm
PATCH_JSON=$(node scripts/get-release-version.js --type=patch --patch-from=${{ github.event.inputs.type }})
PATCH_JSON=$(node scripts/get-release-version.js --type=patch --patch-from=${GITHUB_EVENT_INPUTS_TYPE})
echo "Patch version calculation result: ${PATCH_JSON}"

RELEASE_VERSION=$(echo "${PATCH_JSON}" | jq -r .releaseVersion)
Expand All @@ -85,10 +86,15 @@ jobs:
- name: 'Print Calculated Version'
run: |-
echo "Patch Release Summary:"
echo " Release Version: ${{ steps.patch_version.outputs.RELEASE_VERSION }}"
echo " Release Tag: ${{ steps.patch_version.outputs.RELEASE_TAG }}"
echo " NPM Tag: ${{ steps.patch_version.outputs.NPM_TAG }}"
echo " Previous Tag: ${{ steps.patch_version.outputs.PREVIOUS_TAG }}"
echo " Release Version: ${STEPS_PATCH_VERSION_OUTPUTS_RELEASE_VERSION}"
echo " Release Tag: ${STEPS_PATCH_VERSION_OUTPUTS_RELEASE_TAG}"
echo " NPM Tag: ${STEPS_PATCH_VERSION_OUTPUTS_NPM_TAG}"
echo " Previous Tag: ${STEPS_PATCH_VERSION_OUTPUTS_PREVIOUS_TAG}"
env:
STEPS_PATCH_VERSION_OUTPUTS_RELEASE_VERSION: ${{ steps.patch_version.outputs.RELEASE_VERSION }}
STEPS_PATCH_VERSION_OUTPUTS_RELEASE_TAG: ${{ steps.patch_version.outputs.RELEASE_TAG }}
STEPS_PATCH_VERSION_OUTPUTS_NPM_TAG: ${{ steps.patch_version.outputs.NPM_TAG }}
STEPS_PATCH_VERSION_OUTPUTS_PREVIOUS_TAG: ${{ steps.patch_version.outputs.PREVIOUS_TAG }}

- name: 'Run Tests'
uses: './.github/actions/run-tests'
Expand Down
Loading