GeezerVison is showing github.com — feat: align V2 beta release channels · jonBoone/opencode@9e22c40
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/workflows/beta.yml -37Lines changed: 0 additions & 37 deletions Collapse file Copy file name to clipboardExpand all lines: .github/workflows/publish.yml +19-5Lines changed: 19 additions & 5 deletions | Original file line number | Diff line number | Diff line change |
|---|
| 7 | 7 | - ci | 8 | 8 | - dev | 9 | 9 | - beta | | 10 | + - v2 | 10 | 11 | - fix/npm-native-binary-install | 11 | 12 | - snapshot-* | 12 | 13 | workflow_dispatch: | @@ -32,7 +33,7 @@ permissions: | 32 | 33 | packages: write | 33 | 34 |
| 34 | 35 | env: | 35 | | - OPENCODE_CHANNEL: ${{ (github.ref_name == 'v2' && 'next') || '' }} | | 36 | + OPENCODE_CHANNEL: ${{ (github.ref_name == 'v2' && 'dev') || '' }} | 36 | 37 |
| 37 | 38 | jobs: | 38 | 39 | version: | | 45 | 46 |
| 46 | 47 | - uses: ./.github/actions/setup-bun | 47 | 48 |
| | 49 | + - name: Deploy update service | | 50 | + if: github.ref_name == 'v2' || github.ref_name == 'beta' | | 51 | + working-directory: packages/updates | | 52 | + run: bun run deploy | | 53 | + env: | | 54 | + CLOUDFLARE_API_TOKEN: ${{ secrets.CLOUDFLARE_API_TOKEN }} | | 55 | + | 48 | 56 | - name: Setup git committer | 49 | 57 | id: committer | 50 | 58 | uses: ./.github/actions/setup-git-committer | | 74 | 82 | build-cli: | 75 | 83 | needs: version | 76 | 84 | runs-on: blacksmith-4vcpu-ubuntu-2404 | 77 | | - if: github.repository == 'anomalyco/opencode' && github.ref_name != 'beta' | | 85 | + if: github.repository == 'anomalyco/opencode' | 78 | 86 | steps: | 79 | 87 | - uses: actions/checkout@f43a0e5ff2bd294095638e18286ca9a3d1956744 # v3.6.0 | 80 | 88 | with: | @@ -188,7 +196,7 @@ jobs: | 188 | 196 |
| 189 | 197 | build-node-cli: | 190 | 198 | needs: version | 191 | | - if: github.repository == 'anomalyco/opencode' && github.ref_name != 'beta' | | 199 | + if: github.repository == 'anomalyco/opencode' | 192 | 200 | strategy: | 193 | 201 | fail-fast: false | 194 | 202 | matrix: | @@ -338,6 +346,7 @@ jobs: | 338 | 346 | build-electron: | 339 | 347 | needs: | 340 | 348 | - version | | 349 | + - sign-cli-macos | 341 | 350 | if: github.repository == 'anomalyco/opencode' && github.ref_name != 'v2' | 342 | 351 | continue-on-error: false | 343 | 352 | env: | @@ -376,6 +385,12 @@ jobs: | 376 | 385 | steps: | 377 | 386 | - uses: actions/checkout@f43a0e5ff2bd294095638e18286ca9a3d1956744 # v3.6.0 | 378 | 387 |
| | 388 | + - uses: actions/download-artifact@d3f86a106a0bac45b974a628896c90dbdf5c8093 # v4.3.0 | | 389 | + if: github.ref_name == 'beta' | | 390 | + with: | | 391 | + name: opencode-preview-cli | | 392 | + path: packages/cli/dist | | 393 | + | 379 | 394 | - uses: apple-actions/import-codesign-certs@8f3fb608891dd2244cdab3d69cd68c0d37a7fe93 # v2.0.0 | 380 | 395 | if: runner.os == 'macOS' | 381 | 396 | with: | @@ -434,6 +449,7 @@ jobs: | 434 | 449 | OPENCODE_VERSION: ${{ needs.version.outputs.version }} | 435 | 450 | OPENCODE_CHANNEL: ${{ (github.ref_name == 'beta' && 'beta') || 'prod' }} | 436 | 451 | OPENCODE_CLI_TARGET: ${{ matrix.settings.target }} | | 452 | + OPENCODE_CLI_DIST: ${{ (github.ref_name == 'beta' && format('{0}/packages/cli/dist', github.workspace)) || '' }} | 437 | 453 |
| 438 | 454 | - name: Build | 439 | 455 | run: bun run build | @@ -572,13 +588,11 @@ jobs: | 572 | 588 | path: packages/opencode/dist | 573 | 589 |
| 574 | 590 | - uses: actions/download-artifact@d3f86a106a0bac45b974a628896c90dbdf5c8093 # v4.3.0 | 575 | | - if: github.ref_name != 'beta' | 576 | 591 | with: | 577 | 592 | name: opencode-preview-cli | 578 | 593 | path: packages/cli/dist | 579 | 594 |
| 580 | 595 | - uses: actions/download-artifact@d3f86a106a0bac45b974a628896c90dbdf5c8093 # v4.3.0 | 581 | | - if: github.ref_name != 'beta' | 582 | 596 | with: | 583 | 597 | pattern: opencode-node-cli-* | 584 | 598 | path: packages/cli/dist/node | |
Collapse file Copy file name to clipboardExpand all lines: AGENTS.md +1-1Lines changed: 1 addition & 1 deletion - Display the source diff
- Display the rich diff
| Original file line number | Diff line number | Diff line change |
|---|
| 9 | 9 |
| 10 | 10 | - Run `bun run dev:live` from a development worktree to test its TUI against the currently elected `opencode2` background server and live sessions. | 11 | 11 | - Pass a directory after the script when needed, for example `bun run dev:live /path/to/project`. | 12 | | -- The script discovers the server with `opencode2 service status`, injects its private local credential from `opencode2 service get password`, and uses the `next` TUI storage channel so tabs and other client-local state match the installed client. | | 12 | +- The script discovers the server with `opencode2 service status`, injects its private local credential from `opencode2 service get password`, and uses the `dev` TUI storage channel so tabs and other client-local state match the installed client. | 13 | 13 | - Prefer `dev:live` over plain `bun run dev` for this workflow. An implicit managed-service connection may replace the live server when the worktree client version differs; explicit `--server` warns and continues without replacing it. | 14 | 14 |
| 15 | 15 | ## V2 TUI Stories | |
Collapse file Copy file name to clipboardExpand all lines: install +3-3Lines changed: 3 additions & 3 deletions | Original file line number | Diff line number | Diff line change |
|---|
@@ -15,13 +15,13 @@ Usage: install.sh [options] | 15 | 15 |
| 16 | 16 | Options: | 17 | 17 | -h, --help Display this help message | 18 | | - -v, --version <version> Install a specific version (e.g., 0.0.0-next-17236) | | 18 | + -v, --version <version> Install a specific version (e.g., 0.0.0-beta-17236) | 19 | 19 | -b, --binary <path> Install from a local binary instead of downloading | 20 | 20 | --no-modify-path Don't modify shell config files (.zshrc, .bashrc, etc.) | 21 | 21 |
| 22 | 22 | Examples: | 23 | 23 | curl -fsSL https://raw.githubusercontent.com/anomalyco/opencode/v2/install | bash | 24 | | - curl -fsSL https://raw.githubusercontent.com/anomalyco/opencode/v2/install | bash -s -- --version 0.0.0-next-17236 | | 24 | + curl -fsSL https://raw.githubusercontent.com/anomalyco/opencode/v2/install | bash -s -- --version 0.0.0-beta-17236 | 25 | 25 | ./install --binary /path/to/opencode2 | 26 | 26 | EOF | 27 | 27 | } | | 166 | 166 | fi | 167 | 167 |
| 168 | 168 | if [ -z "$requested_version" ]; then | 169 | | - metadata=$(curl -fsSL https://registry.npmjs.org/@opencode-ai%2fcli/next || true) | | 169 | + metadata=$(curl -fsSL https://registry.npmjs.org/@opencode-ai%2fcli/beta || true) | 170 | 170 | specific_version=$(echo "$metadata" | sed -n 's/.*"version":"\([^"]*\)".*/\1/p') | 171 | 171 |
| 172 | 172 | if [ -z "$specific_version" ]; then | |
Collapse file Copy file name to clipboardExpand all lines: package.json +1-1Lines changed: 1 addition & 1 deletion | Original file line number | Diff line number | Diff line change |
|---|
| 8 | 8 | | 9 | 9 | "scripts": { | 10 | 10 | "dev": "bun run --cwd packages/cli --conditions=browser src/index.ts", | 11 | | - "dev:live": "OPENCODE_TUI_CHANNEL=next OPENCODE_PASSWORD=\"$(opencode2 service get password)\" bun run dev --server \"$(opencode2 service status)\"", | | 11 | + "dev:live": "OPENCODE_TUI_CHANNEL=dev OPENCODE_PASSWORD=\"$(opencode2 service get password)\" bun run dev --server \"$(opencode2 service status)\"", | 12 | 12 | "dev:desktop": "bun --cwd packages/desktop dev", | 13 | 13 | "dev:web": "bun --cwd packages/app dev", | 14 | 14 | "dev:console": "ulimit -n 10240 2>/dev/null; bun run --cwd packages/console/app dev", | |
Collapse file Copy file name to clipboardExpand all lines: packages/cli/script/publish.ts +7-3Lines changed: 7 additions & 3 deletions | Original file line number | Diff line number | Diff line change |
|---|
@@ -14,9 +14,13 @@ async function published(name: string, version: string) { | 14 | 14 |
| 15 | 15 | async function publish(dir: string, name: string, version: string) { | 16 | 16 | if (process.platform !== "win32") await $`chmod -R 755 .`.cwd(dir) | 17 | | - if (await published(name, version)) return console.log(`already published ${name}@${version}`) | 18 | | - await $`bun pm pack`.cwd(dir) | 19 | | - await $`npm publish *.tgz --access public --tag ${Script.channel}`.cwd(dir) | | 17 | + const exists = await published(name, version) | | 18 | + if (exists) console.log(`already published ${name}@${version}`) | | 19 | + if (!exists) { | | 20 | + await $`bun pm pack`.cwd(dir) | | 21 | + await $`npm publish *.tgz --access public --tag ${Script.channel}`.cwd(dir) | | 22 | + } | | 23 | + if (Script.channel === "beta") await $`npm dist-tag add ${`${name}@${version}`} next` | 20 | 24 | } | 21 | 25 |
| 22 | 26 | async function publishDistribution(input: { root: string; name: string; binary: string; packagePrefix: string }) { | |
Collapse file Copy file name to clipboardExpand all lines: packages/cli/src/server-process.ts +1-1Lines changed: 1 addition & 1 deletion | Original file line number | Diff line number | Diff line change |
|---|
@@ -84,7 +84,7 @@ const processEffect = Effect.fnUntraced(function* (options: Options) { | 84 | 84 | database: { | 85 | 85 | path: | 86 | 86 | process.env.OPENCODE_DB ?? | 87 | | - (["latest", "beta", "next", "prod"].includes(OPENCODE_CHANNEL) || | | 87 | + (["latest", "dev", "beta", "next", "prod"].includes(OPENCODE_CHANNEL) || | 88 | 88 | process.env.OPENCODE_DISABLE_CHANNEL_DB === "1" || | 89 | 89 | process.env.OPENCODE_DISABLE_CHANNEL_DB === "true" | 90 | 90 | ? "opencode.db" | |
Collapse file Copy file name to clipboardExpand all lines: packages/cli/src/services/service-config.ts +2-2Lines changed: 2 additions & 2 deletions | Original file line number | Diff line number | Diff line change |
|---|
@@ -25,12 +25,12 @@ const decodeInfo = Schema.decodeUnknownEffect(Schema.fromJsonString(Info)) | 25 | 25 | const decodeRegistration = Schema.decodeUnknownEffect(Schema.fromJsonString(Service.Info)) | 26 | 26 |
| 27 | 27 | export function filename(channel = OPENCODE_CHANNEL) { | 28 | | - if (channel === "latest" || channel === "next") return "service.json" | | 28 | + if (channel === "latest" || channel === "dev" || channel === "beta" || channel === "next") return "service.json" | 29 | 29 | return `service-${channel.replace(/[^a-zA-Z0-9._-]/g, "-")}.json` | 30 | 30 | } | 31 | 31 |
| 32 | 32 | export function defaultPort(channel = OPENCODE_CHANNEL) { | 33 | | - if (channel === "latest" || channel === "next") return 0xc0de | | 33 | + if (channel === "latest" || channel === "dev" || channel === "beta" || channel === "next") return 0xc0de | 34 | 34 | if (channel === "local") return 0xc0df | 35 | 35 | return 10_000 + (Number.parseInt(Hash.fast(channel).slice(0, 8), 16) % 50_000) | 36 | 36 | } | |
Collapse file Copy file name to clipboardExpand all lines: packages/cli/src/services/updater.test.ts +2-1Lines changed: 2 additions & 1 deletion | Original file line number | Diff line number | Diff line change |
|---|
@@ -35,7 +35,8 @@ describe("updater", () => { | 35 | 35 | test("accepts strict release version variants", () => { | 36 | 36 | expect(action("v1.2.3", " 1.2.4\n", true)).toBe("upgrade") | 37 | 37 | expect(action("1.2.3-alpha.1", "1.2.3-alpha.2", true)).toBe("upgrade") | 38 | | - expect(action("0.0.0-next-17403", "0.0.0-next-17403.2", true)).toBe("upgrade") | | 38 | + expect(action("0.0.0-dev-17403", "0.0.0-dev-17403.2", true)).toBe("upgrade") | | 39 | + expect(action("0.0.0-next-17403", "0.0.0-beta-17404", true)).toBe("upgrade") | 39 | 40 | expect(action("1.2.3+old", "1.2.3+new", true)).toBe("none") | 40 | 41 | expect(action("v1.2.3+old", "1.2.3", true)).toBe("none") | 41 | 42 | }) | |
Collapse file Copy file name to clipboardExpand all lines: packages/cli/test/service.test.ts +4Lines changed: 4 additions & 0 deletions | Original file line number | Diff line number | Diff line change |
|---|
@@ -11,6 +11,8 @@ import { ServiceConfig } from "../src/services/service-config" | 11 | 11 |
| 12 | 12 | test("managed service ports are stable per installation channel", () => { | 13 | 13 | expect(ServiceConfig.defaultPort("latest")).toBe(0xc0de) | | 14 | + expect(ServiceConfig.defaultPort("dev")).toBe(0xc0de) | | 15 | + expect(ServiceConfig.defaultPort("beta")).toBe(0xc0de) | 14 | 16 | expect(ServiceConfig.defaultPort("next")).toBe(0xc0de) | 15 | 17 | expect(ServiceConfig.defaultPort("local")).toBe(0xc0df) | 16 | 18 | expect(ServiceConfig.defaultPort("preview-a")).toBe(ServiceConfig.defaultPort("preview-a")) | @@ -37,6 +39,8 @@ test("local channel stores service config with the local service filename", asyn | 37 | 39 |
| 38 | 40 | test("service filenames share release channels and identify preview channels", () => { | 39 | 41 | expect(ServiceConfig.filename("latest")).toBe("service.json") | | 42 | + expect(ServiceConfig.filename("dev")).toBe("service.json") | | 43 | + expect(ServiceConfig.filename("beta")).toBe("service.json") | 40 | 44 | expect(ServiceConfig.filename("next")).toBe("service.json") | 41 | 45 | expect(ServiceConfig.filename("local")).toBe("service-local.json") | 42 | 46 | expect(ServiceConfig.filename("preview-a")).toBe("service-preview-a.json") | |
|