GeezerVison is showing github.com — ci(release): publish desktop on every dev commit (#59507) · ogrman/opencode@362e000
File treeExpand file treeCollapse file tree Open diff view settings Expand file treeCollapse file tree Open diff view settings Collapse file Copy file name to clipboardExpand all lines: .github/release/plan-release.sh +2-2Lines changed: 2 additions & 2 deletions | Original file line number | Diff line number | Diff line change |
|---|
| 2 | 2 | # plan-release.sh: decides version, channel and npm dist-tag from the event, ref and dispatch inputs | 3 | 3 | # (INPUT_BUMP, INPUT_VERSION) only, and writes them to $GITHUB_OUTPUT. Nothing here reads repository files. | 4 | 4 | # | 5 | | -# push or dispatch on dev -> dev 0.0.0-dev-<run> npm tag dev | | 5 | +# push or dispatch on dev -> dev 0.0.0-dev-<run> npm tag dev, desktop | 6 | 6 | # dispatch on dev with bump/version -> latest x.y.z npm tag latest, releasers only | 7 | 7 | # push or dispatch on beta -> beta 0.0.0-beta-<run> desktop only | 8 | 8 | # pull_request -> pr 0.0.0-pr-<run> everything, dry run | | 58 | 58 | # What each channel builds and publishes. | 59 | 59 | case "$channel" in | 60 | 60 | latest) npm_tag=latest cli=true desktop=true node=false release=true ;; | 61 | | - dev) npm_tag=dev cli=true desktop=false node=true release=false ;; | | 61 | + dev) npm_tag=dev cli=true desktop=true node=true release=false ;; | 62 | 62 | beta) npm_tag="" cli=false desktop=true node=false release=false ;; | 63 | 63 | pr) npm_tag=pr cli=true desktop=true node=true release=true ;; | 64 | 64 | esac | |
Collapse file Copy file name to clipboardExpand all lines: .github/release/publish-desktop.sh +5-4Lines changed: 5 additions & 4 deletions | Original file line number | Diff line number | Diff line change |
|---|
@@ -9,11 +9,12 @@ win=("$windows/opencode-desktop-win-arm64.exe" "$windows/opencode-desktop-win-x6 | 9 | 9 | mac=("$macos/opencode-desktop-mac-arm64.zip" "$macos/opencode-desktop-mac-arm64.dmg" "$macos/opencode-desktop-mac-x64.zip" "$macos/opencode-desktop-mac-x64.dmg") | 10 | 10 | linux=("$linux_x64/opencode-desktop-linux-x86_64.AppImage" "$linux_x64/opencode-desktop-linux-amd64.deb" "$linux_x64/opencode-desktop-linux-x86_64.rpm") | 11 | 11 | linux_arm=("$linux_arm64/opencode-desktop-linux-arm64.AppImage" "$linux_arm64/opencode-desktop-linux-arm64.deb" "$linux_arm64/opencode-desktop-linux-aarch64.rpm") | 12 | | -# Beta skips the .app.tar.gz, which only the retired Tauri updater feed read. | | 12 | +# Dev and beta skip the .app.tar.gz, which only the retired Tauri updater feed read. | 13 | 13 | bundles=() | 14 | | -if [ "$OPENCODE_CHANNEL" != beta ]; then | 15 | | - bundles=("$macos/opencode-desktop-mac-arm64.app.tar.gz" "$macos/opencode-desktop-mac-x64.app.tar.gz") | 16 | | -fi | | 14 | +case "$OPENCODE_CHANNEL" in | | 15 | + dev | beta) ;; | | 16 | + *) bundles=("$macos/opencode-desktop-mac-arm64.app.tar.gz" "$macos/opencode-desktop-mac-x64.app.tar.gz") ;; | | 17 | +esac | 17 | 18 |
| 18 | 19 | feed() { | 19 | 20 | for file in "$@"; do | |
Collapse file Copy file name to clipboardExpand all lines: .github/release/sign-desktop-macos.sh +6-5Lines changed: 6 additions & 5 deletions | Original file line number | Diff line number | Diff line change |
|---|
| 1 | 1 | #!/usr/bin/env bash | 2 | 2 | # sign-desktop-macos.sh <out dir> <app tarball>...: signs each unsigned .app inside-out with hardened runtime, | 3 | 3 | # notarizes them in one submission, staples them, and only then builds opencode-desktop-mac-<arch>.{zip,dmg,app.tar.gz} | 4 | | -# from the stapled apps. Dry runs sign ad-hoc and skip notarization. Beta trades larger files for faster packaging | 5 | | -# (zip and dmg at zlib level 1) and skips the .app.tar.gz, which only the retired Tauri updater feed read. | | 4 | +# from the stapled apps. Dry runs sign ad-hoc and skip notarization. Dev and beta trade larger files for faster | | 5 | +# packaging (zip and dmg at zlib level 1) and skip the .app.tar.gz, which only the retired Tauri updater feed read. | 6 | 6 | # Notarization reads APPLE_API_KEY_CONTENT, APPLE_API_KEY_ID and APPLE_API_ISSUER. | 7 | 7 | . "$(dirname "$0")/lib.sh" | 8 | 8 |
| | 11 | 11 | mkdir -p "$out" | 12 | 12 | apps=$(mktemp -d) | 13 | 13 | identity=- timestamp=--timestamp=none | 14 | | -zip_level=() dmg_level=() | 15 | | -if [ "$OPENCODE_CHANNEL" = beta ]; then zip_level=(--zlibCompressionLevel 1) dmg_level=(-imagekey zlib-level=1); fi | | 14 | +zip_level=() dmg_level=() preview=false | | 15 | +case "$OPENCODE_CHANNEL" in dev | beta) preview=true ;; esac | | 16 | +if [ "$preview" = true ]; then zip_level=(--zlibCompressionLevel 1) dmg_level=(-imagekey zlib-level=1); fi | 16 | 17 | if ! dry_run; then | 17 | 18 | identity=$(security find-identity -v -p codesigning build.keychain | sed -n 's/.*"\(Developer ID Application:.*\)"/\1/p' | head -n 1) | 18 | 19 | [ -n "$identity" ] || die "Developer ID Application identity not found" | @@ -82,6 +83,6 @@ for dir in "$apps"/*; do | 82 | 83 | ditto "$app" "$staging/$name" | 83 | 84 | ln -s /Applications "$staging/Applications" | 84 | 85 | hdiutil create -volname "${name%.app}" -srcfolder "$staging" -fs HFS+ -format UDZO ${dmg_level[@]+"${dmg_level[@]}"} -ov "$out/opencode-desktop-mac-$arch.dmg" | 85 | | - if [ "$OPENCODE_CHANNEL" = beta ]; then continue; fi | | 86 | + if [ "$preview" = true ]; then continue; fi | 86 | 87 | COPYFILE_DISABLE=1 tar --no-mac-metadata -czf "$out/opencode-desktop-mac-$arch.app.tar.gz" -C "$dir" "$name" | 87 | 88 | done |
Collapse file Copy file name to clipboardExpand all lines: .github/workflows/release-dry-run.yml +11-11Lines changed: 11 additions & 11 deletions | Original file line number | Diff line number | Diff line change |
|---|
@@ -252,8 +252,8 @@ jobs: | 252 | 252 | path: dist/docker | 253 | 253 |
| 254 | 254 | # macOS and Windows pack an unsigned app; Linux packs the final AppImage, deb and rpm. | 255 | | - # Beta packages macOS x64 on Apple Silicon and Windows arm64 on Blacksmith for speed. electron-builder's afterPack | 256 | | - # rejects a bundle whose CLI or node-pty does not match the target CPU. | | 255 | + # Dev and beta package macOS x64 on Apple Silicon and Windows arm64 on Blacksmith for speed. electron-builder's | | 256 | + # afterPack rejects a bundle whose CLI or node-pty does not match the target CPU. | 257 | 257 | build-desktop: | 258 | 258 | needs: [plan, tag, build-cli] | 259 | 259 | if: needs.plan.outputs.desktop == 'true' | @@ -265,12 +265,12 @@ jobs: | 265 | 265 | matrix: | 266 | 266 | include: | 267 | 267 | - target: darwin-x64 | 268 | | - host: ${{ github.ref_name == 'beta' && 'macos-26' || 'macos-26-intel' }} | 269 | | - install: ${{ github.ref_name == 'beta' && '--os=darwin --cpu=*' || '--os=darwin --cpu=x64' }} | | 268 | + host: ${{ (needs.plan.outputs.channel == 'dev' || needs.plan.outputs.channel == 'beta') && 'macos-26' || 'macos-26-intel' }} | | 269 | + install: ${{ (needs.plan.outputs.channel == 'dev' || needs.plan.outputs.channel == 'beta') && '--os=darwin --cpu=*' || '--os=darwin --cpu=x64' }} | 270 | 270 | - { target: darwin-arm64, host: macos-26, install: --os=darwin --cpu=arm64 } | 271 | 271 | # github-hosted: blacksmith lacks the ARM64 MSVC cross-compilation toolchain | 272 | 272 | - target: windows-arm64 | 273 | | - host: ${{ github.ref_name == 'beta' && 'blacksmith-4vcpu-windows-2025' || 'windows-2025' }} | | 273 | + host: ${{ (needs.plan.outputs.channel == 'dev' || needs.plan.outputs.channel == 'beta') && 'blacksmith-4vcpu-windows-2025' || 'windows-2025' }} | 274 | 274 | install: --cpu=* | 275 | 275 | - { target: windows-x64, host: blacksmith-4vcpu-windows-2025 } | 276 | 276 | - { target: linux-x64, host: blacksmith-4vcpu-ubuntu-2404 } | @@ -294,10 +294,10 @@ jobs: | 294 | 294 | run: git fetch --no-tags --filter=blob:none --depth=300 origin "$SHA" | 295 | 295 | env: | 296 | 296 | SHA: ${{ needs.tag.outputs.sha }} | 297 | | - # Beta trades larger packages for faster packaging. fpm sets XZ_OPT for the deb and rpm level, but xz still | 298 | | - # reads XZ_DEFAULTS, so it uses every CPU. | 299 | | - - name: Beta packaging settings | 300 | | - if: needs.plan.outputs.channel == 'beta' && runner.os == 'Linux' | | 297 | + # Dev and beta trade larger packages for faster packaging. fpm sets XZ_OPT for the deb and rpm level, but xz | | 298 | + # still reads XZ_DEFAULTS, so it uses every CPU. | | 299 | + - name: Preview packaging settings | | 300 | + if: (needs.plan.outputs.channel == 'dev' || needs.plan.outputs.channel == 'beta') && runner.os == 'Linux' | 301 | 301 | run: echo "XZ_DEFAULTS=-T0" >> "$GITHUB_ENV" | 302 | 302 | - name: Build | 303 | 303 | working-directory: packages/desktop | @@ -306,7 +306,7 @@ jobs: | 306 | 306 | OPENCODE_TARGET: ${{ matrix.target }} | 307 | 307 | NODE_OPTIONS: --max-old-space-size=4096 | 308 | 308 | VITE_SENTRY_DSN: ${{ vars.WEB_SENTRY_DSN }} | 309 | | - VITE_SENTRY_ENVIRONMENT: ${{ needs.plan.outputs.channel == 'beta' && 'beta' || 'production' }} | | 309 | + VITE_SENTRY_ENVIRONMENT: ${{ needs.plan.outputs.channel == 'latest' && 'production' || needs.plan.outputs.channel }} | 310 | 310 | VITE_SENTRY_RELEASE: desktop@${{ needs.plan.outputs.version }} | 311 | 311 | GITHUB_TOKEN: ${{ github.token }} # read-only; beta notes read pull request authors and descriptions | 312 | 312 | - name: Pack | @@ -331,7 +331,7 @@ jobs: | 331 | 331 | matrix: | 332 | 332 | include: | 333 | 333 | - target: windows-arm64 | 334 | | - host: ${{ github.ref_name == 'beta' && 'blacksmith-4vcpu-windows-2025' || 'windows-2025' }} | | 334 | + host: ${{ (needs.plan.outputs.channel == 'dev' || needs.plan.outputs.channel == 'beta') && 'blacksmith-4vcpu-windows-2025' || 'windows-2025' }} | 335 | 335 | install: --cpu=* | 336 | 336 | - { target: windows-x64, host: blacksmith-4vcpu-windows-2025 } | 337 | 337 | runs-on: ${{ matrix.host }} | |
Collapse file Copy file name to clipboardExpand all lines: .github/workflows/release.yml +11-11Lines changed: 11 additions & 11 deletions | Original file line number | Diff line number | Diff line change |
|---|
@@ -271,8 +271,8 @@ jobs: | 271 | 271 | path: dist/docker | 272 | 272 |
| 273 | 273 | # macOS and Windows pack an unsigned app; Linux packs the final AppImage, deb and rpm. | 274 | | - # Beta packages macOS x64 on Apple Silicon and Windows arm64 on Blacksmith for speed. electron-builder's afterPack | 275 | | - # rejects a bundle whose CLI or node-pty does not match the target CPU. | | 274 | + # Dev and beta package macOS x64 on Apple Silicon and Windows arm64 on Blacksmith for speed. electron-builder's | | 275 | + # afterPack rejects a bundle whose CLI or node-pty does not match the target CPU. | 276 | 276 | build-desktop: | 277 | 277 | needs: [plan, tag, build-cli] | 278 | 278 | if: needs.plan.outputs.desktop == 'true' | @@ -284,12 +284,12 @@ jobs: | 284 | 284 | matrix: | 285 | 285 | include: | 286 | 286 | - target: darwin-x64 | 287 | | - host: ${{ github.ref_name == 'beta' && 'macos-26' || 'macos-26-intel' }} | 288 | | - install: ${{ github.ref_name == 'beta' && '--os=darwin --cpu=*' || '--os=darwin --cpu=x64' }} | | 287 | + host: ${{ (needs.plan.outputs.channel == 'dev' || needs.plan.outputs.channel == 'beta') && 'macos-26' || 'macos-26-intel' }} | | 288 | + install: ${{ (needs.plan.outputs.channel == 'dev' || needs.plan.outputs.channel == 'beta') && '--os=darwin --cpu=*' || '--os=darwin --cpu=x64' }} | 289 | 289 | - { target: darwin-arm64, host: macos-26, install: --os=darwin --cpu=arm64 } | 290 | 290 | # github-hosted: blacksmith lacks the ARM64 MSVC cross-compilation toolchain | 291 | 291 | - target: windows-arm64 | 292 | | - host: ${{ github.ref_name == 'beta' && 'blacksmith-4vcpu-windows-2025' || 'windows-2025' }} | | 292 | + host: ${{ (needs.plan.outputs.channel == 'dev' || needs.plan.outputs.channel == 'beta') && 'blacksmith-4vcpu-windows-2025' || 'windows-2025' }} | 293 | 293 | install: --cpu=* | 294 | 294 | - { target: windows-x64, host: blacksmith-4vcpu-windows-2025 } | 295 | 295 | - { target: linux-x64, host: blacksmith-4vcpu-ubuntu-2404 } | @@ -313,10 +313,10 @@ jobs: | 313 | 313 | run: git fetch --no-tags --filter=blob:none --depth=300 origin "$SHA" | 314 | 314 | env: | 315 | 315 | SHA: ${{ needs.tag.outputs.sha }} | 316 | | - # Beta trades larger packages for faster packaging. fpm sets XZ_OPT for the deb and rpm level, but xz still | 317 | | - # reads XZ_DEFAULTS, so it uses every CPU. | 318 | | - - name: Beta packaging settings | 319 | | - if: needs.plan.outputs.channel == 'beta' && runner.os == 'Linux' | | 316 | + # Dev and beta trade larger packages for faster packaging. fpm sets XZ_OPT for the deb and rpm level, but xz | | 317 | + # still reads XZ_DEFAULTS, so it uses every CPU. | | 318 | + - name: Preview packaging settings | | 319 | + if: (needs.plan.outputs.channel == 'dev' || needs.plan.outputs.channel == 'beta') && runner.os == 'Linux' | 320 | 320 | run: echo "XZ_DEFAULTS=-T0" >> "$GITHUB_ENV" | 321 | 321 | - name: Build | 322 | 322 | working-directory: packages/desktop | @@ -325,7 +325,7 @@ jobs: | 325 | 325 | OPENCODE_TARGET: ${{ matrix.target }} | 326 | 326 | NODE_OPTIONS: --max-old-space-size=4096 | 327 | 327 | VITE_SENTRY_DSN: ${{ vars.WEB_SENTRY_DSN }} | 328 | | - VITE_SENTRY_ENVIRONMENT: ${{ needs.plan.outputs.channel == 'beta' && 'beta' || 'production' }} | | 328 | + VITE_SENTRY_ENVIRONMENT: ${{ needs.plan.outputs.channel == 'latest' && 'production' || needs.plan.outputs.channel }} | 329 | 329 | VITE_SENTRY_RELEASE: desktop@${{ needs.plan.outputs.version }} | 330 | 330 | GITHUB_TOKEN: ${{ github.token }} # read-only; beta notes read pull request authors and descriptions | 331 | 331 | - name: Pack | @@ -350,7 +350,7 @@ jobs: | 350 | 350 | matrix: | 351 | 351 | include: | 352 | 352 | - target: windows-arm64 | 353 | | - host: ${{ github.ref_name == 'beta' && 'blacksmith-4vcpu-windows-2025' || 'windows-2025' }} | | 353 | + host: ${{ (needs.plan.outputs.channel == 'dev' || needs.plan.outputs.channel == 'beta') && 'blacksmith-4vcpu-windows-2025' || 'windows-2025' }} | 354 | 354 | install: --cpu=* | 355 | 355 | - { target: windows-x64, host: blacksmith-4vcpu-windows-2025 } | 356 | 356 | runs-on: ${{ matrix.host }} | |
Collapse file Copy file name to clipboardExpand all lines: packages/desktop/electron-builder.config.test.ts +10-4Lines changed: 10 additions & 4 deletions | Original file line number | Diff line number | Diff line change |
|---|
@@ -13,9 +13,9 @@ import { CLI_BINARIES, nodePtyPackage } from "./script/utils" | 13 | 13 | const { FileMatcher } = createRequire(import.meta.resolve("electron-builder"))("app-builder-lib/out/fileMatcher") | 14 | 14 |
| 15 | 15 | const channels = [ | 16 | | - { channel: "dev", appId: "ai.opencode.desktop.dev" }, | 17 | | - { channel: "beta", appId: "ai.opencode.desktop.beta" }, | 18 | | - { channel: "prod", appId: "ai.opencode.desktop" }, | | 16 | + { channel: "dev", appId: "ai.opencode.desktop.dev", feed: "dev" }, | | 17 | + { channel: "beta", appId: "ai.opencode.desktop.beta", feed: "beta" }, | | 18 | + { channel: "prod", appId: "ai.opencode.desktop", feed: "latest" }, | 19 | 19 | ] as const | 20 | 20 |
| 21 | 21 | function load(channel: string, target?: string): Configuration { | @@ -47,9 +47,15 @@ function trimFilter(dir: string, config: Configuration) { | 47 | 47 | ]).createFilter() | 48 | 48 | } | 49 | 49 |
| 50 | | -test.each(channels)("channel identity for $channel", ({ channel, appId }) => { | | 50 | +test.each(channels)("channel identity for $channel", ({ channel, appId, feed }) => { | 51 | 51 | const config = load(channel) | 52 | 52 | expect(config.appId).toBe(appId) | | 53 | + // Every published channel updates from its own feed on the update service. | | 54 | + expect(config.publish).toEqual({ | | 55 | + provider: "generic", | | 56 | + url: `https://opencode.ai/update/api/${feed}/desktop/opencode/`, | | 57 | + channel: "latest", | | 58 | + }) | 53 | 59 | expect(config.extraMetadata?.desktopName).toBe(`${appId}.desktop`) | 54 | 60 | // The executable must never end in `.desktop`: libappimage resolves the | 55 | 61 | // AppImage's desktop entry by globbing `*.desktop`, and an ELF matching | |
Collapse file Copy file name to clipboardExpand all lines: packages/desktop/electron-builder.config.ts +14-6Lines changed: 14 additions & 6 deletions | Original file line number | Diff line number | Diff line change |
|---|
@@ -26,9 +26,9 @@ const rpmNoBuildIdLinksFpm = "--rpm-rpmbuild-define=_build_id_links none" | 26 | 26 | const metainfoFpm = (appId: string) => | 27 | 27 | `${path.join(packageDir, "resources", `${appId}.metainfo.xml`)}=/usr/share/metainfo/${appId}.metainfo.xml` | 28 | 28 |
| 29 | | -// Beta packages every commit for the team, so it trades about 5% (deb) and 17% (rpm) larger files for xz -1, which | | 29 | +// Dev and beta package every commit, so they trade about 5% (deb) and 17% (rpm) larger files for xz -1, which | 30 | 30 | // compresses the payload about 3x faster than the deb default (-3) and 5x faster than the rpm default (-9). | 31 | | -const betaCompressionFpm = (target: "deb" | "rpm") => [`--${target}-compression-level`, "1"] | | 31 | +const previewCompressionFpm = (target: "deb" | "rpm") => [`--${target}-compression-level`, "1"] | 32 | 32 |
| 33 | 33 | function resolveChannel() { | 34 | 34 | const raw = process.env.OPENCODE_CHANNEL | @@ -207,8 +207,16 @@ export function getConfig() { | 207 | 207 | ...base, | 208 | 208 | appId, | 209 | 209 | productName: "OpenCode Dev", | 210 | | - deb: { fpm: [metainfoFpm(appId)] }, | 211 | | - rpm: { packageName: "opencode-dev", fpm: [rpmNoBuildIdLinksFpm, metainfoFpm(appId)] }, | | 210 | + publish: { | | 211 | + provider: "generic", | | 212 | + url: "https://opencode.ai/update/api/dev/desktop/opencode/", | | 213 | + channel: "latest", | | 214 | + }, | | 215 | + deb: { fpm: [...previewCompressionFpm("deb"), metainfoFpm(appId)] }, | | 216 | + rpm: { | | 217 | + packageName: "opencode-dev", | | 218 | + fpm: [rpmNoBuildIdLinksFpm, ...previewCompressionFpm("rpm"), metainfoFpm(appId)], | | 219 | + }, | 212 | 220 | } | 213 | 221 | } | 214 | 222 |
| @@ -223,10 +231,10 @@ export function getConfig() { | 223 | 231 | url: "https://opencode.ai/update/api/beta/desktop/opencode/", | 224 | 232 | channel: "latest", | 225 | 233 | }, | 226 | | - deb: { fpm: [...betaCompressionFpm("deb"), metainfoFpm(appId)] }, | | 234 | + deb: { fpm: [...previewCompressionFpm("deb"), metainfoFpm(appId)] }, | 227 | 235 | rpm: { | 228 | 236 | packageName: "opencode-beta", | 229 | | - fpm: [rpmNoBuildIdLinksFpm, ...betaCompressionFpm("rpm"), metainfoFpm(appId)], | | 237 | + fpm: [rpmNoBuildIdLinksFpm, ...previewCompressionFpm("rpm"), metainfoFpm(appId)], | 230 | 238 | }, | 231 | 239 | } | 232 | 240 | } | |
Collapse file Copy file name to clipboardExpand all lines: packages/gui-plugins/src/updater/main.ts +2-2Lines changed: 2 additions & 2 deletions | Original file line number | Diff line number | Diff line change |
|---|
@@ -10,7 +10,7 @@ const setup: Plugin.MainSetup = async (ctx) => { | 10 | 10 | const builtin = builtinMainContext(ctx) | 11 | 11 | const build = ctx.app | 12 | 12 | const lifecycle = builtin.lifecycle | 13 | | - const enabled = build.packaged && build.channel !== "dev" | | 13 | + const enabled = build.packaged | 14 | 14 | // Holds no resources, so it needs no cleanup. | 15 | 15 | const context = logContext(ctx.log.write) | 16 | 16 | const runPromise = Effect.runPromiseWith(context) | @@ -23,7 +23,7 @@ const setup: Plugin.MainSetup = async (ctx) => { | 23 | 23 | from: { settings: "ready", file: "opencode.updater" }, | 24 | 24 | }) | 25 | 25 |
| 26 | | - // electron-updater loads only in packaged builds that update, after the first window is up. | | 26 | + // electron-updater loads only in packaged builds, after the first window is up. | 27 | 27 | const platform = enabled | 28 | 28 | ? await import("./platform").then((module) => runPromise(module.make(build.channel))) | 29 | 29 | : undefined | |
|