From 649803beaef61b07733b81b0de2e44d5a9c4a7c6 Mon Sep 17 00:00:00 2001 From: mkorwel Date: Fri, 24 Apr 2026 20:57:19 +0000 Subject: [PATCH] ci: publish packages to GitHub and use in Windows E2E tests --- .github/workflows/ci-bundling-trial.yml | 57 ++++++++++++++++++++----- packages/cli/package.json | 3 ++ packages/core/package.json | 3 ++ 3 files changed, 52 insertions(+), 11 deletions(-) diff --git a/.github/workflows/ci-bundling-trial.yml b/.github/workflows/ci-bundling-trial.yml index aab33ea461..cf336fe187 100644 --- a/.github/workflows/ci-bundling-trial.yml +++ b/.github/workflows/ci-bundling-trial.yml @@ -10,6 +10,45 @@ concurrency: cancel-in-progress: true jobs: + publish_packages: + name: 'Publish Packages to GitHub' + runs-on: 'gemini-cli-ubuntu-16-core' + permissions: + packages: write + contents: read + steps: + - name: 'Checkout' + uses: 'actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8' + + - name: 'Set up Node.js' + uses: 'actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020' + with: + node-version-file: '.nvmrc' + cache: 'npm' + + - name: 'Install dependencies' + run: 'npm ci' + + - name: 'Build project' + run: 'npm run build' + + - name: 'Set version with SHA' + run: | + npm version 0.0.0-${{ github.sha }} --no-git-tag-version --workspaces + shell: 'bash' + + - name: 'Configure npm for GitHub Packages' + run: | + echo "//npm.pkg.github.com/:_authToken=\${{ secrets.GITHUB_TOKEN }}" > ~/.npmrc + echo "@google:registry=https://npm.pkg.github.com" >> ~/.npmrc + shell: 'bash' + + - name: 'Publish Packages' + run: | + npm publish --workspace @google/gemini-cli-core + npm publish --workspace @google/gemini-cli + shell: 'bash' + build_bundle: name: 'Build Bundle' runs-on: 'gemini-cli-ubuntu-16-core' @@ -372,30 +411,26 @@ jobs: test_e2e_windows: name: 'e2e:windows' - needs: build_bundle + needs: publish_packages runs-on: 'gemini-cli-windows-16-core' steps: - name: 'Checkout' uses: 'actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8' - - name: 'Download Bundle' - uses: 'actions/download-artifact@cc203385981b70ca67e1cc392babf9cc229d5806' - with: - name: 'gemini-bundle' - path: 'bundle' - - name: 'Set up Node.js' uses: 'actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020' with: node-version-file: '.nvmrc' cache: 'npm' - - name: 'Install targeted test dependencies' - run: 'npm install vitest node-pty --no-save' + - name: 'Configure npm for GitHub Packages' + run: | + echo "//npm.pkg.github.com/:_authToken=${{ secrets.GITHUB_TOKEN }}" > "$env:USERPROFILE\.npmrc" + echo "@google:registry=https://npm.pkg.github.com" >> "$env:USERPROFILE\.npmrc" shell: 'pwsh' - - name: 'Build project' - run: 'npm run build' + - name: 'Install dependencies' + run: 'npm install @google/gemini-cli@0.0.0-${{ github.sha }} @google/gemini-cli-core@0.0.0-${{ github.sha }} vitest node-pty --no-save' shell: 'pwsh' - name: 'Run Integration Tests' diff --git a/packages/cli/package.json b/packages/cli/package.json index cd3b2ec135..f721345f32 100644 --- a/packages/cli/package.json +++ b/packages/cli/package.json @@ -7,6 +7,9 @@ "type": "git", "url": "git+https://github.com/google-gemini/gemini-cli.git" }, + "publishConfig": { + "registry": "https://npm.pkg.github.com" + }, "type": "module", "main": "dist/index.js", "bin": { diff --git a/packages/core/package.json b/packages/core/package.json index 00c663690d..dd2c25939e 100644 --- a/packages/core/package.json +++ b/packages/core/package.json @@ -7,6 +7,9 @@ "type": "git", "url": "git+https://github.com/google-gemini/gemini-cli.git" }, + "publishConfig": { + "registry": "https://npm.pkg.github.com" + }, "type": "module", "main": "dist/index.js", "scripts": {