mirror of
https://github.com/google-gemini/gemini-cli.git
synced 2026-03-10 14:10:37 -07:00
feat(release): Add dev support to patch2 workflow (#11460)
This commit is contained in:
12
.github/workflows/release-patch-2-trigger.yml
vendored
12
.github/workflows/release-patch-2-trigger.yml
vendored
@@ -18,7 +18,7 @@ on:
|
|||||||
type: 'string'
|
type: 'string'
|
||||||
default: 'main'
|
default: 'main'
|
||||||
workflow_id:
|
workflow_id:
|
||||||
description: 'The workflow to trigger. Defaults to patch-release.yml'
|
description: 'The workflow to trigger. Defaults to release-patch-3-release.yml'
|
||||||
required: false
|
required: false
|
||||||
type: 'string'
|
type: 'string'
|
||||||
default: 'release-patch-3-release.yml'
|
default: 'release-patch-3-release.yml'
|
||||||
@@ -37,11 +37,20 @@ on:
|
|||||||
required: false
|
required: false
|
||||||
type: 'boolean'
|
type: 'boolean'
|
||||||
default: false
|
default: false
|
||||||
|
environment:
|
||||||
|
description: 'Environment'
|
||||||
|
required: false
|
||||||
|
type: 'choice'
|
||||||
|
options:
|
||||||
|
- 'prod'
|
||||||
|
- 'dev'
|
||||||
|
default: 'prod'
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
trigger-patch-release:
|
trigger-patch-release:
|
||||||
if: "(github.event_name == 'pull_request' && github.event.pull_request.merged == true && startsWith(github.event.pull_request.head.ref, 'hotfix/')) || github.event_name == 'workflow_dispatch'"
|
if: "(github.event_name == 'pull_request' && github.event.pull_request.merged == true && startsWith(github.event.pull_request.head.ref, 'hotfix/')) || github.event_name == 'workflow_dispatch'"
|
||||||
runs-on: 'ubuntu-latest'
|
runs-on: 'ubuntu-latest'
|
||||||
|
environment: '${{ github.event.inputs.environment }}'
|
||||||
permissions:
|
permissions:
|
||||||
actions: 'write'
|
actions: 'write'
|
||||||
contents: 'write'
|
contents: 'write'
|
||||||
@@ -74,5 +83,6 @@ jobs:
|
|||||||
GITHUB_EVENT_PAYLOAD: '${{ toJSON(github.event) }}'
|
GITHUB_EVENT_PAYLOAD: '${{ toJSON(github.event) }}'
|
||||||
FORCE_SKIP_TESTS: '${{ github.event.inputs.force_skip_tests }}'
|
FORCE_SKIP_TESTS: '${{ github.event.inputs.force_skip_tests }}'
|
||||||
TEST_MODE: '${{ github.event.inputs.test_mode }}'
|
TEST_MODE: '${{ github.event.inputs.test_mode }}'
|
||||||
|
ENVIRONMENT: '${{ github.event.inputs.environment }}'
|
||||||
run: |
|
run: |
|
||||||
node scripts/releasing/patch-trigger.js --dry-run=${{ github.event.inputs.dry_run }}
|
node scripts/releasing/patch-trigger.js --dry-run=${{ github.event.inputs.dry_run }}
|
||||||
|
|||||||
@@ -81,6 +81,11 @@ async function main() {
|
|||||||
type: 'boolean',
|
type: 'boolean',
|
||||||
default: false,
|
default: false,
|
||||||
})
|
})
|
||||||
|
.option('environment', {
|
||||||
|
choices: ['prod', 'dev'],
|
||||||
|
type: 'string',
|
||||||
|
default: process.env.ENVIRONMENT || 'prod',
|
||||||
|
})
|
||||||
.example(
|
.example(
|
||||||
'$0 --head-ref "hotfix/v0.5.3/preview/cherry-pick-abc1234" --test',
|
'$0 --head-ref "hotfix/v0.5.3/preview/cherry-pick-abc1234" --test',
|
||||||
'Test channel detection logic',
|
'Test channel detection logic',
|
||||||
@@ -105,6 +110,7 @@ async function main() {
|
|||||||
|
|
||||||
// Get inputs from CLI args or environment
|
// Get inputs from CLI args or environment
|
||||||
const headRef = argv.headRef || process.env.HEAD_REF;
|
const headRef = argv.headRef || process.env.HEAD_REF;
|
||||||
|
const environment = argv.environment;
|
||||||
const body = argv.prBody || process.env.PR_BODY || '';
|
const body = argv.prBody || process.env.PR_BODY || '';
|
||||||
const isDryRun = argv.dryRun || body.includes('[DRY RUN]');
|
const isDryRun = argv.dryRun || body.includes('[DRY RUN]');
|
||||||
const forceSkipTests =
|
const forceSkipTests =
|
||||||
@@ -226,6 +232,8 @@ async function main() {
|
|||||||
'--field',
|
'--field',
|
||||||
`release_ref=${releaseRef}`,
|
`release_ref=${releaseRef}`,
|
||||||
'--field',
|
'--field',
|
||||||
|
`environment=${environment}`,
|
||||||
|
'--field',
|
||||||
originalPr ? `original_pr=${originalPr.toString()}` : 'original_pr=',
|
originalPr ? `original_pr=${originalPr.toString()}` : 'original_pr=',
|
||||||
];
|
];
|
||||||
|
|
||||||
@@ -259,6 +267,7 @@ async function main() {
|
|||||||
const commentBody = `🚀 **Patch Release Started!**
|
const commentBody = `🚀 **Patch Release Started!**
|
||||||
|
|
||||||
**📋 Release Details:**
|
**📋 Release Details:**
|
||||||
|
- **Environment**: \`${environment}\`
|
||||||
- **Channel**: \`${channel}\` → publishing to npm tag \`${npmTag}\`
|
- **Channel**: \`${channel}\` → publishing to npm tag \`${npmTag}\`
|
||||||
- **Version**: \`${version}\`
|
- **Version**: \`${version}\`
|
||||||
- **Hotfix PR**: Merged ✅
|
- **Hotfix PR**: Merged ✅
|
||||||
|
|||||||
Reference in New Issue
Block a user