9090 id : build
9191 run : |
9292 ./packages/opencode/script/build.ts ${{ (github.ref_name == 'beta' && '--sourcemaps') || '' }}
93+ ./packages/cli/script/build.ts ${{ (github.ref_name == 'beta' && '--sourcemaps') || '' }}
9394 env :
9495 OPENCODE_VERSION : ${{ needs.version.outputs.version }}
9596 OPENCODE_RELEASE : ${{ needs.version.outputs.release }}
@@ -107,6 +108,12 @@ jobs:
107108 with :
108109 name : opencode-cli-windows
109110 path : packages/opencode/dist/opencode-windows*
111+
112+ - uses : actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2
113+ with :
114+ name : opencode-preview-cli
115+ path : packages/cli/dist/cli-*
116+
110117 outputs :
111118 version : ${{ needs.version.outputs.version }}
112119
@@ -318,6 +325,7 @@ jobs:
318325 run : bun run build
319326 working-directory : packages/desktop
320327 env :
328+ NODE_OPTIONS : --max-old-space-size=4096
321329 OPENCODE_CHANNEL : ${{ (github.ref_name == 'beta' && 'beta') || 'prod' }}
322330 SENTRY_AUTH_TOKEN : ${{ secrets.SENTRY_AUTH_TOKEN }}
323331 SENTRY_ORG : ${{ vars.SENTRY_ORG }}
@@ -327,9 +335,9 @@ jobs:
327335 VITE_SENTRY_ENVIRONMENT : ${{ (github.ref_name == 'beta' && 'beta') || 'production' }}
328336 VITE_SENTRY_RELEASE : desktop@${{ needs.version.outputs.version }}
329337
330- - name : Package and publish
338+ - name : Package
331339 if : needs.version.outputs.release
332- run : npx electron-builder ${{ matrix.settings.platform_flag }} --publish always --config electron-builder.config.ts
340+ run : npx electron-builder ${{ matrix.settings.platform_flag }} --publish never --config electron-builder.config.ts
333341 working-directory : packages/desktop
334342 timeout-minutes : 60
335343 env :
@@ -349,11 +357,9 @@ jobs:
349357 env :
350358 OPENCODE_CHANNEL : ${{ (github.ref_name == 'beta' && 'beta') || 'prod' }}
351359
352- - name : Create and upload macOS .app.tar.gz
360+ - name : Create macOS .app.tar.gz
353361 if : runner.os == 'macOS' && needs.version.outputs.release
354362 working-directory : packages/desktop/dist
355- env :
356- GH_TOKEN : ${{ steps.committer.outputs.token }}
357363 run : |
358364 if [[ "${{ matrix.settings.target }}" == "x86_64-apple-darwin" ]]; then
359365 APP_DIR="mac"
@@ -371,7 +377,6 @@ jobs:
371377 exit 1
372378 fi
373379 tar -czf "$OUT_NAME" -C "$(dirname "$APP_PATH")" "$(basename "$APP_PATH")"
374- gh release upload "v${{ needs.version.outputs.version }}" "$OUT_NAME" --clobber --repo "${{ needs.version.outputs.repo }}"
375380
376381 - name : Verify signed Windows Electron artifacts
377382 if : runner.os == 'Windows'
@@ -446,12 +451,24 @@ jobs:
446451 name : opencode-cli-signed-windows
447452 path : packages/opencode/dist
448453
454+ - uses : actions/download-artifact@d3f86a106a0bac45b974a628896c90dbdf5c8093 # v4.3.0
455+ with :
456+ name : opencode-preview-cli
457+ path : packages/cli/dist
458+
449459 - uses : actions/download-artifact@d3f86a106a0bac45b974a628896c90dbdf5c8093 # v4.3.0
450460 if : needs.version.outputs.release
451461 with :
452462 pattern : latest-yml-*
453463 path : /tmp/latest-yml
454464
465+ - uses : actions/download-artifact@d3f86a106a0bac45b974a628896c90dbdf5c8093 # v4.3.0
466+ if : needs.version.outputs.release
467+ with :
468+ pattern : opencode-desktop-*
469+ path : /tmp/desktop
470+ merge-multiple : true
471+
455472 - name : Setup git committer
456473 id : committer
457474 uses : ./.github/actions/setup-git-committer
@@ -478,6 +495,19 @@ jobs:
478495 git config --global user.name "opencode"
479496 ssh-keyscan -H aur.archlinux.org >> ~/.ssh/known_hosts || true
480497
498+ - name : Upload desktop release assets
499+ if : needs.version.outputs.release
500+ env :
501+ GH_TOKEN : ${{ steps.committer.outputs.token }}
502+ run : |
503+ shopt -s nullglob
504+ files=(/tmp/desktop/*.{exe,blockmap,dmg,zip,AppImage,deb,rpm} /tmp/desktop/*.app.tar.gz)
505+ if (( ${#files[@]} == 0 )); then
506+ echo "No desktop release assets found"
507+ exit 1
508+ fi
509+ gh release upload "v${{ needs.version.outputs.version }}" "${files[@]}" --clobber --repo "${{ needs.version.outputs.repo }}"
510+
481511 - run : ./script/publish.ts
482512 env :
483513 OPENCODE_VERSION : ${{ needs.version.outputs.version }}
0 commit comments