diff options
| author | Dax Raad <[email protected]> | 2025-08-02 18:50:19 -0400 |
|---|---|---|
| committer | Dax Raad <[email protected]> | 2025-08-02 18:50:19 -0400 |
| commit | ca031278ca9ca30277620e344f7a95c597a8a0de (patch) | |
| tree | 93af08a56682986262fb7d2c97cfd77d6a973ff7 /script | |
| parent | ae6e47bb42bbfcbb908cda28f4ec028a7335904e (diff) | |
| download | opencode-ca031278ca9ca30277620e344f7a95c597a8a0de.tar.gz opencode-ca031278ca9ca30277620e344f7a95c597a8a0de.zip | |
wip: plugins
Diffstat (limited to 'script')
| -rwxr-xr-x | script/publish.ts | 27 |
1 files changed, 24 insertions, 3 deletions
diff --git a/script/publish.ts b/script/publish.ts index fd498d42c..d9b08f36e 100755 --- a/script/publish.ts +++ b/script/publish.ts @@ -11,18 +11,39 @@ if (!version) { } process.env["OPENCODE_VERSION"] = version -await import(`../packages/opencode/script/publish.ts`) +const pkgjsons = await Array.fromAsync( + new Bun.Glob("**/package.json").scan({ + absolute: true, + }), +) + +const tree = await $`git add . && git write-tree`.text().then((x) => x.trim()) +for await (const file of new Bun.Glob("**/package.json").scan({ + absolute: true, +})) { + let pkg = await Bun.file(file).text() + pkg = pkg.replaceAll(/"version": "[^"]+"/g, `"version": "${version}"`) + await Bun.file(file).write(pkg) +} + +// await import(`../packages/opencode/script/publish.ts`) await import(`../packages/sdk/js/script/publish.ts`) +await import(`../packages/plugin/script/publish.ts`) // await import(`../packages/sdk/stainless/generate.ts`) if (!snapshot) { await $`git commit -am "release: v${version}"` await $`git tag v${version}` - await $`git push origin HEAD --tags` + await $`git push origin HEAD --tags --no-verify` } if (snapshot) { await $`git commit --allow-empty -m "Snapshot release v${version}"` await $`git tag v${version}` - await $`git push origin v${version}` + await $`git push origin v${version} --no-verify` await $`git reset --soft HEAD~1` + for await (const file of new Bun.Glob("**/package.json").scan({ + absolute: true, + })) { + $`await git checkout ${tree} ${file}` + } } |
