GeezerVison is showing github.com — snapshot publish everything · steipete/opencode@ba8a4c5
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/snapshot.yml +1-1Lines changed: 1 addition & 1 deletion | Original file line number | Diff line number | Diff line change |
|---|
| 28 | 28 |
| 29 | 29 | - name: Publish | 30 | 30 | run: | | 31 | | - ./packages/opencode/script/publish.ts | | 31 | + ./script/publish.ts | 32 | 32 | env: | 33 | 33 | GITHUB_TOKEN: ${{ secrets.SST_GITHUB_TOKEN }} | 34 | 34 | NPM_CONFIG_TOKEN: ${{ secrets.NPM_TOKEN }} |
Collapse file Copy file name to clipboard +4-12Lines changed: 4 additions & 12 deletions | Original file line number | Diff line number | Diff line change |
|---|
| 1 | 1 | #!/usr/bin/env bun | | 2 | +import { Script } from "@opencode-ai/script" | | 3 | +import { $ } from "bun" | 2 | 4 |
| 3 | 5 | const dir = new URL("..", import.meta.url).pathname | 4 | 6 | process.chdir(dir) | 5 | 7 |
| 6 | | -import { $ } from "bun" | 7 | | - | 8 | 8 | await $`bun tsc` | 9 | | - | 10 | 9 | const pkg = await import("../package.json").then((m) => m.default) | 11 | 10 | const original = JSON.parse(JSON.stringify(pkg)) | 12 | 11 | for (const [key, value] of Object.entries(pkg.exports)) { | 13 | 12 | const file = value.replace("./src/", "./dist/").replace(".ts", "") | | 13 | + // @ts-ignore | 14 | 14 | pkg.exports[key] = { | 15 | 15 | import: file + ".js", | 16 | 16 | types: file + ".d.ts", | 17 | 17 | } | 18 | 18 | } | 19 | 19 | await Bun.write("package.json", JSON.stringify(pkg, null, 2)) | 20 | | - | 21 | | -const snapshot = process.env["OPENCODE_SNAPSHOT"] === "true" | 22 | | - | 23 | | -if (snapshot) { | 24 | | - await $`bun publish --tag snapshot --access public` | 25 | | -} | 26 | | -if (!snapshot) { | 27 | | - await $`bun publish --access public` | 28 | | -} | | 20 | +await $`bun publish --tag ${Script.channel} --access public` | 29 | 21 | await Bun.write("package.json", JSON.stringify(original, null, 2)) |
Collapse file Copy file name to clipboard +4-11Lines changed: 4 additions & 11 deletions | Original file line number | Diff line number | Diff line change |
|---|
| 1 | 1 | #!/usr/bin/env bun | 2 | 2 |
| | 3 | +import { Script } from "@opencode-ai/script" | | 4 | +import { $ } from "bun" | | 5 | + | 3 | 6 | const dir = new URL("..", import.meta.url).pathname | 4 | 7 | process.chdir(dir) | 5 | 8 |
| 6 | | -import { $ } from "bun" | 7 | | - | 8 | 9 | await import("./build") | 9 | 10 |
| 10 | 11 | const pkg = await import("../package.json").then((m) => m.default) | @@ -18,13 +19,5 @@ for (const [key, value] of Object.entries(pkg.exports)) { | 18 | 19 | } | 19 | 20 | } | 20 | 21 | await Bun.write("package.json", JSON.stringify(pkg, null, 2)) | 21 | | - | 22 | | -const snapshot = process.env["OPENCODE_SNAPSHOT"] === "true" | 23 | | - | 24 | | -if (snapshot) { | 25 | | - await $`bun publish --tag snapshot --access public` | 26 | | -} | 27 | | -if (!snapshot) { | 28 | | - await $`bun publish --access public` | 29 | | -} | | 22 | +await $`bun publish --tag ${Script.channel} --access public` | 30 | 23 | await Bun.write("package.json", JSON.stringify(original, null, 2)) |
|