Skip to content

Commit ba8a4c5

Browse files
committed
snapshot publish everything
1 parent 790fe72 commit ba8a4c5

File tree

3 files changed

+9
-24
lines changed

3 files changed

+9
-24
lines changed

.github/workflows/snapshot.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ jobs:
2828

2929
- name: Publish
3030
run: |
31-
./packages/opencode/script/publish.ts
31+
./script/publish.ts
3232
env:
3333
GITHUB_TOKEN: ${{ secrets.SST_GITHUB_TOKEN }}
3434
NPM_CONFIG_TOKEN: ${{ secrets.NPM_TOKEN }}

packages/plugin/script/publish.ts

Lines changed: 4 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,29 +1,21 @@
11
#!/usr/bin/env bun
2+
import { Script } from "@opencode-ai/script"
3+
import { $ } from "bun"
24

35
const dir = new URL("..", import.meta.url).pathname
46
process.chdir(dir)
57

6-
import { $ } from "bun"
7-
88
await $`bun tsc`
9-
109
const pkg = await import("../package.json").then((m) => m.default)
1110
const original = JSON.parse(JSON.stringify(pkg))
1211
for (const [key, value] of Object.entries(pkg.exports)) {
1312
const file = value.replace("./src/", "./dist/").replace(".ts", "")
13+
// @ts-ignore
1414
pkg.exports[key] = {
1515
import: file + ".js",
1616
types: file + ".d.ts",
1717
}
1818
}
1919
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`
2921
await Bun.write("package.json", JSON.stringify(original, null, 2))

packages/sdk/js/script/publish.ts

Lines changed: 4 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,11 @@
11
#!/usr/bin/env bun
22

3+
import { Script } from "@opencode-ai/script"
4+
import { $ } from "bun"
5+
36
const dir = new URL("..", import.meta.url).pathname
47
process.chdir(dir)
58

6-
import { $ } from "bun"
7-
89
await import("./build")
910

1011
const pkg = await import("../package.json").then((m) => m.default)
@@ -18,13 +19,5 @@ for (const [key, value] of Object.entries(pkg.exports)) {
1819
}
1920
}
2021
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`
3023
await Bun.write("package.json", JSON.stringify(original, null, 2))

0 commit comments

Comments
 (0)