mirror of
https://github.com/google-gemini/gemini-cli.git
synced 2026-06-14 05:17:18 -07:00
feat(ci): generalize publish-bundle action and script
This commit is contained in:
@@ -29,7 +29,7 @@ jobs:
|
||||
name: 'Publish Bundle'
|
||||
runs-on: 'ubuntu-latest'
|
||||
outputs:
|
||||
version: '${{ steps.version.outputs.version }}'
|
||||
version: '${{ steps.vars.outputs.version }}'
|
||||
permissions:
|
||||
contents: 'read'
|
||||
packages: 'write'
|
||||
@@ -46,37 +46,24 @@ jobs:
|
||||
node-version-file: '.nvmrc'
|
||||
cache: 'npm'
|
||||
|
||||
- name: 'Install dependencies'
|
||||
run: 'npm ci'
|
||||
|
||||
- name: 'Setup NPMRC'
|
||||
uses: './.github/actions/setup-npmrc'
|
||||
with:
|
||||
github-token: '${{ secrets.GITHUB_TOKEN }}'
|
||||
|
||||
- name: 'Bundle'
|
||||
run: 'npm run bundle'
|
||||
|
||||
- name: 'Prepare for GitHub release'
|
||||
run: 'node scripts/prepare-github-release.js'
|
||||
|
||||
- name: 'Set CI Version'
|
||||
id: 'version'
|
||||
- name: 'Calculate Version and Tag'
|
||||
id: 'vars'
|
||||
run: |
|
||||
CURRENT_VERSION=$(node -p "require('./package.json').version")
|
||||
NEW_VERSION="${CURRENT_VERSION}-ci.${{ github.run_number }}.${{ github.sha }}"
|
||||
echo "version=${NEW_VERSION}" >> "$GITHUB_OUTPUT"
|
||||
npm version --no-git-tag-version "${NEW_VERSION}"
|
||||
|
||||
- name: 'Publish to GitHub Packages'
|
||||
env:
|
||||
NODE_AUTH_TOKEN: '${{ secrets.GITHUB_TOKEN }}'
|
||||
run: |
|
||||
if [[ "${{ github.event_name }}" == "pull_request" ]]; then
|
||||
npm publish --tag="pr-${{ github.event.pull_request.number }}"
|
||||
echo "tag=pr-${{ github.event.pull_request.number }}" >> "$GITHUB_OUTPUT"
|
||||
else
|
||||
npm publish --tag="ci"
|
||||
echo "tag=ci" >> "$GITHUB_OUTPUT"
|
||||
fi
|
||||
- name: 'Publish Bundle'
|
||||
uses: './.github/actions/publish-bundle'
|
||||
with:
|
||||
version: '${{ steps.vars.outputs.version }}'
|
||||
tag: '${{ steps.vars.outputs.tag }}'
|
||||
github-token: '${{ secrets.GITHUB_TOKEN }}'
|
||||
package-scope: '${{ inputs.npm-registry-scope }}'
|
||||
|
||||
build-and-publish-sandbox:
|
||||
name: 'Build and Publish Sandbox'
|
||||
|
||||
@@ -100,15 +100,13 @@ jobs:
|
||||
working-directory: './release'
|
||||
|
||||
- name: 'Publish Release'
|
||||
uses: './.github/actions/publish-release'
|
||||
uses: './.github/actions/publish-release-bundled'
|
||||
with:
|
||||
force-skip-tests: '${{ github.event.inputs.force_skip_tests }}'
|
||||
release-version: '${{ steps.release_info.outputs.RELEASE_VERSION }}'
|
||||
release-tag: '${{ github.event.inputs.version }}'
|
||||
npm-tag: '${{ github.event.inputs.npm_channel }}'
|
||||
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 }}'
|
||||
dry-run: '${{ github.event.inputs.dry_run }}'
|
||||
previous-tag: '${{ steps.release_info.outputs.PREVIOUS_TAG }}'
|
||||
@@ -121,7 +119,6 @@ jobs:
|
||||
cli-package-name: '${{ vars.CLI_PACKAGE_NAME }}'
|
||||
core-package-name: '${{ vars.CORE_PACKAGE_NAME }}'
|
||||
a2a-package-name: '${{ vars.A2A_PACKAGE_NAME }}'
|
||||
use-bundle-release: 'true'
|
||||
|
||||
- name: 'Create Issue on Failure'
|
||||
if: '${{ failure() && github.event.inputs.dry_run == false }}'
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
name: 'Release: Manual'
|
||||
name: 'Release: Manual (Depreciated)'
|
||||
|
||||
on:
|
||||
workflow_dispatch:
|
||||
|
||||
Reference in New Issue
Block a user