mirror of
https://github.com/google-gemini/gemini-cli.git
synced 2026-06-24 10:17:35 -07:00
b21a5a0c3c
Adds a debug step to the 'build-and-publish.yml' workflow to print the contents of the .npmrc file immediately after the 'prepare-github-release.js' script runs. This will help determine if the 'prepare-github-release.js' script is inadvertently modifying or overwriting the .npmrc file, which could be causing the 'ENEEDAUTH' error during the publish step.
78 lines
2.5 KiB
YAML
78 lines
2.5 KiB
YAML
# .github/workflows/build-and-publish.yml
|
|
name: 'Build and Publish Bundle'
|
|
|
|
on:
|
|
workflow_call:
|
|
outputs:
|
|
version:
|
|
description: 'The version of the published package'
|
|
value: '${{ jobs.publish-bundle.outputs.version }}'
|
|
|
|
jobs:
|
|
publish-bundle:
|
|
name: 'Publish Bundle'
|
|
runs-on: 'gemini-cli-ubuntu-16-core'
|
|
outputs:
|
|
version: '${{ steps.version.outputs.version }}'
|
|
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: 'Bundle'
|
|
run: 'npm run bundle'
|
|
|
|
- name: 'Prepare for GitHub release'
|
|
run: 'node scripts/prepare-github-release.js'
|
|
|
|
- name: 'Debug .npmrc after prepare-github-release'
|
|
run: |
|
|
echo "--- Listing files in current directory after prepare-github-release ---"
|
|
ls -la
|
|
echo "--- Contents of .npmrc after prepare-github-release ---"
|
|
cat .npmrc
|
|
echo "---------------------------------------------------------"
|
|
|
|
- name: 'Set CI Version'
|
|
id: 'version'
|
|
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: 'Debug .npmrc'
|
|
run: |
|
|
echo "--- Listing files in current directory ---"
|
|
ls -la
|
|
echo "--- Contents of .npmrc ---"
|
|
cat .npmrc
|
|
echo "---------------------------"
|
|
|
|
- name: 'Publish to GitHub Packages'
|
|
run: |
|
|
if [[ "${{ github.event_name }}" == "pull_request" ]]; then
|
|
npm publish --tag="pr-${{ github.event.pull_request.number }}"
|
|
else
|
|
npm publish --tag="ci"
|
|
fi
|