GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — fix(release): restore desktop app-update.yml and keep V1 as the GitHu… · ogrman/opencode@54dcd34

File tree

Expand file treeCollapse file tree
Open diff view settings
Filter options
  • .github/release
    • publish-github-release.sh
  • packages/desktop/script
    • pack.ts
Expand file treeCollapse file tree
Open diff view settings
Collapse file

‎.github/release/publish-github-release.sh‎

Copy file name to clipboardExpand all lines: .github/release/publish-github-release.sh
+4-2Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,8 @@ printf '%s\n' "${OPENCODE_RELEASE_NOTES:-}" > "$assets.md"
1414
if dry_run; then exit 0; fi
1515

1616
tag="v$OPENCODE_VERSION"
17-
gh release view "$tag" > /dev/null 2>&1 || gh release create "$tag" --draft --verify-tag --title "$tag" --notes-file "$assets.md"
17+
# OpenCode 1 update paths (CLI upgrade, electron-updater, Scoop) follow GitHub's Latest release, which must stay on 1.x.
18+
gh release view "$tag" > /dev/null 2>&1 ||
19+
gh release create "$tag" --draft --verify-tag --latest=false --title "$tag" --notes-file "$assets.md"
1820
gh release upload "$tag" "$assets"/* --clobber
19-
gh release edit "$tag" --draft=false
21+
gh release edit "$tag" --draft=false --latest=false
Collapse file

‎packages/desktop/script/pack.ts‎

Copy file name to clipboardExpand all lines: packages/desktop/script/pack.ts
+21-3Lines changed: 21 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
import { $ } from "bun"
33
import { cp, mkdir, readdir, rm } from "node:fs/promises"
44
import path from "node:path"
5+
import { getConfig } from "../electron-builder.config"
56
import { getCurrentCli, resolveChannel } from "./utils"
67

78
// Packages the built app (out/) for OPENCODE_TARGET into dist/desktop at the repository root, unsigned:
@@ -50,12 +51,29 @@ if (!app && os === "mac") {
5051
const bundles = (await readdir(parent)).filter((file) => file.endsWith(".app"))
5152

5253
if (bundles.length !== 1) throw new Error(`Expected one .app bundle in ${parent}, found ${bundles.join(", ")}`)
54+
await writeUpdateConfig(path.join(parent, bundles[0], "Contents", "Resources"))
5355
await $`tar -cf ${path.join(out, `opencode-desktop-mac-${cli.cpu}.app.tar`)} -C ${parent} ${bundles[0]}`
5456
}
5557

5658
if (!app && os === "win") {
5759
await $`bunx electron-builder ${flags} --dir`
58-
await cp(path.join("dist", cli.cpu === "arm64" ? "win-arm64-unpacked" : "win-unpacked"), path.join(out, "app"), {
59-
recursive: true,
60-
})
60+
const unpacked = path.join("dist", cli.cpu === "arm64" ? "win-arm64-unpacked" : "win-unpacked")
61+
await writeUpdateConfig(path.join(unpacked, "resources"))
62+
await cp(unpacked, path.join(out, "app"), { recursive: true })
63+
}
64+
65+
// electron-builder writes resources/app-update.yml only for dmg, zip and nsis targets, not for --dir builds.
66+
// electron-updater reads its feed from that file, so write the one those targets would.
67+
async function writeUpdateConfig(resources: string) {
68+
const publish = getConfig().publish
69+
const name: string = (await Bun.file("package.json").json()).name
70+
await Bun.write(
71+
path.join(resources, "app-update.yml"),
72+
[
73+
`provider: ${publish.provider}`,
74+
`url: ${publish.url}`,
75+
`channel: ${publish.channel}`,
76+
`updaterCacheDirName: '${name.replace(/[/\\:*?"<>|]/g, "").toLowerCase()}-updater'`,
77+
].join("\n") + "\n",
78+
)
6179
}

0 commit comments

Comments
0 (0)
You are visitor 01402792 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.