Skip to content

Commit e3e908b

Browse files
committed
ci(release): build and attach unsigned macOS binaries to releases
- Add a `build-mac` job to the nightly, manual, and promote release workflows to build unsigned macOS binaries for both `x64` and `arm64` architectures. - Update the publication jobs to require the new `build-mac` step and download the resulting artifacts. - Modify the `publish-release` action to include the macOS binaries as assets in the GitHub release if they exist.
1 parent 4d1ca92 commit e3e908b

5 files changed

Lines changed: 183 additions & 4 deletions

File tree

.github/actions/publish-release/action.yml

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -308,8 +308,21 @@ runs:
308308
fi
309309
rm -rf test-bundle
310310
311+
RELEASE_ASSETS=("gemini-cli-bundle.zip")
312+
313+
# Check for and prepare macOS binaries if they exist
314+
if [[ -f "dist/darwin-arm64/gemini" ]]; then
315+
cp dist/darwin-arm64/gemini gemini-darwin-arm64-unsigned
316+
RELEASE_ASSETS+=("gemini-darwin-arm64-unsigned")
317+
fi
318+
319+
if [[ -f "dist/darwin-x64/gemini" ]]; then
320+
cp dist/darwin-x64/gemini gemini-darwin-x64-unsigned
321+
RELEASE_ASSETS+=("gemini-darwin-x64-unsigned")
322+
fi
323+
311324
gh release create "${INPUTS_RELEASE_TAG}" \
312-
gemini-cli-bundle.zip \
325+
"${RELEASE_ASSETS[@]}" \
313326
--target "${STEPS_RELEASE_BRANCH_OUTPUTS_BRANCH_NAME}" \
314327
--title "Release ${INPUTS_RELEASE_TAG}" \
315328
--notes-start-tag "${INPUTS_PREVIOUS_TAG}" \

.github/workflows/build-unsigned-mac-binaries.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,4 +53,4 @@ jobs:
5353
with:
5454
name: 'gemini-darwin-${{ matrix.arch }}-unsigned'
5555
path: 'dist/darwin-${{ matrix.arch }}/'
56-
retention-days: 5
56+
retention-days: 14

.github/workflows/release-manual.yml

Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,8 +46,45 @@ on:
4646
default: 'prod'
4747

4848
jobs:
49+
build-mac:
50+
name: 'Build Unsigned (${{ matrix.arch }})'
51+
if: "github.repository == 'google-gemini/gemini-cli'"
52+
runs-on: 'macos-latest'
53+
strategy:
54+
fail-fast: false
55+
matrix:
56+
arch: ['x64', 'arm64']
57+
steps:
58+
- name: 'Checkout Ref'
59+
uses: 'actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8'
60+
with:
61+
ref: '${{ github.event.inputs.ref }}'
62+
63+
- name: 'Set up Node.js'
64+
uses: 'actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020'
65+
with:
66+
node-version-file: '.nvmrc'
67+
architecture: '${{ matrix.arch }}'
68+
cache: 'npm'
69+
70+
- name: 'Install dependencies'
71+
run: 'npm ci'
72+
73+
- name: 'Build Binary'
74+
env:
75+
SKIP_SIGNING: 'true'
76+
run: 'npm run build:binary'
77+
78+
- name: 'Upload Artifact'
79+
uses: 'actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02'
80+
with:
81+
name: 'gemini-darwin-${{ matrix.arch }}-unsigned'
82+
path: 'dist/darwin-${{ matrix.arch }}/gemini'
83+
retention-days: 1
84+
4985
release:
5086
if: "github.repository == 'google-gemini/gemini-cli'"
87+
needs: ['build-mac']
5188
runs-on: 'ubuntu-latest'
5289
environment: "${{ github.event.inputs.environment || 'prod' }}"
5390
permissions:
@@ -83,6 +120,20 @@ jobs:
83120
working-directory: './release'
84121
run: 'npm ci'
85122

123+
- name: 'Download macOS arm64 binary'
124+
uses: 'actions/download-artifact@fa0a91b85d4f404e444e00e005971372dc801d16'
125+
continue-on-error: true
126+
with:
127+
name: 'gemini-darwin-arm64-unsigned'
128+
path: 'release/dist/darwin-arm64'
129+
130+
- name: 'Download macOS x64 binary'
131+
uses: 'actions/download-artifact@fa0a91b85d4f404e444e00e005971372dc801d16'
132+
continue-on-error: true
133+
with:
134+
name: 'gemini-darwin-x64-unsigned'
135+
path: 'release/dist/darwin-x64'
136+
86137
- name: 'Prepare Release Info'
87138
id: 'release_info'
88139
working-directory: './release'

.github/workflows/release-nightly.yml

Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,8 +30,45 @@ on:
3030
default: 'prod'
3131

3232
jobs:
33+
build-mac:
34+
name: 'Build Unsigned (${{ matrix.arch }})'
35+
if: "github.repository == 'google-gemini/gemini-cli'"
36+
runs-on: 'macos-latest'
37+
strategy:
38+
fail-fast: false
39+
matrix:
40+
arch: ['x64', 'arm64']
41+
steps:
42+
- name: 'Checkout Ref'
43+
uses: 'actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8'
44+
with:
45+
ref: '${{ github.event.inputs.ref }}'
46+
47+
- name: 'Set up Node.js'
48+
uses: 'actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020'
49+
with:
50+
node-version-file: '.nvmrc'
51+
architecture: '${{ matrix.arch }}'
52+
cache: 'npm'
53+
54+
- name: 'Install dependencies'
55+
run: 'npm ci'
56+
57+
- name: 'Build Binary'
58+
env:
59+
SKIP_SIGNING: 'true'
60+
run: 'npm run build:binary'
61+
62+
- name: 'Upload Artifact'
63+
uses: 'actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02'
64+
with:
65+
name: 'gemini-darwin-${{ matrix.arch }}-unsigned'
66+
path: 'dist/darwin-${{ matrix.arch }}/gemini'
67+
retention-days: 1
68+
3369
release:
3470
if: "github.repository == 'google-gemini/gemini-cli'"
71+
needs: ['build-mac']
3572
environment: "${{ github.event.inputs.environment || 'prod' }}"
3673
runs-on: 'ubuntu-latest'
3774
permissions:
@@ -62,6 +99,20 @@ jobs:
6299
working-directory: './release'
63100
run: 'npm ci'
64101

102+
- name: 'Download macOS arm64 binary'
103+
uses: 'actions/download-artifact@fa0a91b85d4f404e444e00e005971372dc801d16'
104+
continue-on-error: true
105+
with:
106+
name: 'gemini-darwin-arm64-unsigned'
107+
path: 'release/dist/darwin-arm64'
108+
109+
- name: 'Download macOS x64 binary'
110+
uses: 'actions/download-artifact@fa0a91b85d4f404e444e00e005971372dc801d16'
111+
continue-on-error: true
112+
with:
113+
name: 'gemini-darwin-x64-unsigned'
114+
path: 'release/dist/darwin-x64'
115+
65116
- name: 'Print Inputs'
66117
shell: 'bash'
67118
env:

.github/workflows/release-promote.yml

Lines changed: 66 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -197,9 +197,45 @@ jobs:
197197
gemini_api_key: '${{ secrets.GEMINI_API_KEY }}'
198198
working-directory: './release'
199199

200+
build-mac:
201+
name: 'Build Unsigned (${{ matrix.arch }})'
202+
needs: 'calculate-versions'
203+
runs-on: 'macos-latest'
204+
strategy:
205+
fail-fast: false
206+
matrix:
207+
arch: ['x64', 'arm64']
208+
steps:
209+
- name: 'Checkout Ref'
210+
uses: 'actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8'
211+
with:
212+
ref: '${{ github.event.inputs.ref }}'
213+
214+
- name: 'Set up Node.js'
215+
uses: 'actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020'
216+
with:
217+
node-version-file: '.nvmrc'
218+
architecture: '${{ matrix.arch }}'
219+
cache: 'npm'
220+
221+
- name: 'Install dependencies'
222+
run: 'npm ci'
223+
224+
- name: 'Build Binary'
225+
env:
226+
SKIP_SIGNING: 'true'
227+
run: 'npm run build:binary'
228+
229+
- name: 'Upload Artifact'
230+
uses: 'actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02'
231+
with:
232+
name: 'gemini-darwin-${{ matrix.arch }}-unsigned'
233+
path: 'dist/darwin-${{ matrix.arch }}/gemini'
234+
retention-days: 1
235+
200236
publish-preview:
201237
name: 'Publish preview'
202-
needs: ['calculate-versions', 'test']
238+
needs: ['calculate-versions', 'test', 'build-mac']
203239
runs-on: 'ubuntu-latest'
204240
environment: "${{ github.event.inputs.environment || 'prod' }}"
205241
permissions:
@@ -229,6 +265,20 @@ jobs:
229265
working-directory: './release'
230266
run: 'npm ci'
231267

268+
- name: 'Download macOS arm64 binary'
269+
uses: 'actions/download-artifact@fa0a91b85d4f404e444e00e005971372dc801d16'
270+
continue-on-error: true
271+
with:
272+
name: 'gemini-darwin-arm64-unsigned'
273+
path: 'release/dist/darwin-arm64'
274+
275+
- name: 'Download macOS x64 binary'
276+
uses: 'actions/download-artifact@fa0a91b85d4f404e444e00e005971372dc801d16'
277+
continue-on-error: true
278+
with:
279+
name: 'gemini-darwin-x64-unsigned'
280+
path: 'release/dist/darwin-x64'
281+
232282
- name: 'Publish Release'
233283
uses: './.github/actions/publish-release'
234284
with:
@@ -266,7 +316,7 @@ jobs:
266316
267317
publish-stable:
268318
name: 'Publish stable'
269-
needs: ['calculate-versions', 'test', 'publish-preview']
319+
needs: ['calculate-versions', 'test', 'publish-preview', 'build-mac']
270320
runs-on: 'ubuntu-latest'
271321
environment: "${{ github.event.inputs.environment || 'prod' }}"
272322
permissions:
@@ -296,6 +346,20 @@ jobs:
296346
working-directory: './release'
297347
run: 'npm ci'
298348

349+
- name: 'Download macOS arm64 binary'
350+
uses: 'actions/download-artifact@fa0a91b85d4f404e444e00e005971372dc801d16'
351+
continue-on-error: true
352+
with:
353+
name: 'gemini-darwin-arm64-unsigned'
354+
path: 'release/dist/darwin-arm64'
355+
356+
- name: 'Download macOS x64 binary'
357+
uses: 'actions/download-artifact@fa0a91b85d4f404e444e00e005971372dc801d16'
358+
continue-on-error: true
359+
with:
360+
name: 'gemini-darwin-x64-unsigned'
361+
path: 'release/dist/darwin-x64'
362+
299363
- name: 'Publish Release'
300364
uses: './.github/actions/publish-release'
301365
with:

0 commit comments

Comments
 (0)