Skip binary CLI relaunch (#26261)

This commit is contained in:
ruomeng
2026-04-30 13:48:23 -04:00
committed by GitHub
parent 9a98b0e56c
commit 0f1077076e
4 changed files with 71 additions and 2 deletions
@@ -0,0 +1,56 @@
name: 'Build Unsigned Mac Binaries'
on:
workflow_dispatch:
permissions:
contents: 'read'
defaults:
run:
shell: 'bash'
jobs:
build-mac:
name: 'Build Unsigned (${{ matrix.arch }})'
runs-on: 'macos-latest'
strategy:
fail-fast: false
matrix:
arch: ['x64', 'arm64']
steps:
- name: 'Checkout'
uses: 'actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5' # ratchet:actions/checkout@v4
- name: 'Set up Node.js'
uses: 'actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020' # ratchet:actions/setup-node@v4
with:
node-version-file: '.nvmrc'
architecture: '${{ matrix.arch }}'
cache: 'npm'
- name: 'Install dependencies'
run: 'npm ci'
- name: 'Build Binary'
env:
SKIP_SIGNING: 'true'
run: 'npm run build:binary'
- name: 'Verify Output Exists'
run: |
if [ -f "dist/darwin-${{ matrix.arch }}/gemini" ]; then
echo "Binary found at dist/darwin-${{ matrix.arch }}/gemini"
else
echo "Error: Binary not found in dist/darwin-${{ matrix.arch }}/"
ls -R dist/
exit 1
fi
- name: 'Upload Artifact'
uses: 'actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02' # ratchet:actions/upload-artifact@v4
with:
name: 'gemini-darwin-${{ matrix.arch }}-unsigned'
path: 'dist/darwin-${{ matrix.arch }}/'
retention-days: 5
+5 -1
View File
@@ -75,7 +75,11 @@ async function getMemoryNodeArgs(): Promise<string[]> {
}
async function run() {
if (!process.env['GEMINI_CLI_NO_RELAUNCH'] && !process.env['SANDBOX']) {
if (
!process.env['GEMINI_CLI_NO_RELAUNCH'] &&
!process.env['SANDBOX'] &&
process.env['IS_BINARY'] !== 'true'
) {
// --- Lightweight Parent Process / Daemon ---
// We avoid importing heavy dependencies here to save ~1.5s of startup time.
+5 -1
View File
@@ -125,7 +125,11 @@ export function getNodeMemoryArgs(isDebugMode: boolean): string[] {
);
}
if (process.env['GEMINI_CLI_NO_RELAUNCH']) {
if (
process.env['IS_BINARY'] === 'true' ||
process.env['GEMINI_CLI_NO_RELAUNCH'] ||
process.env['SANDBOX']
) {
return [];
}
+5
View File
@@ -99,6 +99,11 @@ function removeSignature(filePath) {
* @param {string} filePath
*/
function signFile(filePath) {
if (process.env.SKIP_SIGNING === 'true') {
console.log(`Skipping signing for ${filePath} (SKIP_SIGNING=true)`);
return;
}
const platform = process.platform;
if (platform === 'darwin') {