mirror of
https://github.com/google-gemini/gemini-cli.git
synced 2026-06-13 21:07:00 -07:00
53 lines
1.5 KiB
YAML
53 lines
1.5 KiB
YAML
# .github/workflows/build-and-publish.yml
|
|
name: 'Build and Publish Bundle'
|
|
|
|
on:
|
|
workflow_call:
|
|
outputs:
|
|
tag:
|
|
description: "The tag of the published package"
|
|
value: ${{ jobs.publish-bundle.outputs.tag }}
|
|
|
|
jobs:
|
|
publish-bundle:
|
|
name: 'Publish Bundle'
|
|
runs-on: 'gemini-cli-ubuntu-16-core'
|
|
outputs:
|
|
tag: ${{ steps.get_tag.outputs.tag }}
|
|
permissions:
|
|
contents: 'read'
|
|
packages: 'write'
|
|
steps:
|
|
- name: 'Checkout'
|
|
uses: 'actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8' # ratchet:actions/checkout@v5
|
|
with:
|
|
ref: '${{ github.event.inputs.branch_ref || github.ref }}'
|
|
fetch-depth: 0
|
|
|
|
- name: 'Set up Node.js'
|
|
uses: 'actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020' # ratchet:actions/setup-node@v4.4.0
|
|
with:
|
|
node-version-file: '.nvmrc'
|
|
cache: 'npm'
|
|
|
|
- name: 'Install dependencies'
|
|
run: 'npm ci'
|
|
|
|
- name: 'Configure npm for GitHub Packages'
|
|
run: |
|
|
echo "@google-gemini:registry=https://npm.pkg.github.com/" > .npmrc
|
|
echo "//npm.pkg.github.com/:_authToken=${{ secrets.GITHUB_TOKEN }}" >> .npmrc
|
|
|
|
- name: 'Prepare for GitHub release'
|
|
run: 'node scripts/prepare-github-release.js'
|
|
|
|
- name: 'Bundle'
|
|
run: 'npm run bundle'
|
|
|
|
- name: 'Get tag'
|
|
id: get_tag
|
|
run: echo "tag=ci-${{ github.sha }}" >> $GITHUB_OUTPUT
|
|
|
|
- name: 'Publish to GitHub Packages'
|
|
run: 'npm publish --tag=${{ steps.get_tag.outputs.tag }}'
|