Skip to content

The open source coding agent.

TypeScript

tag majors

Dax Raad09e7e0ab70e6
diff --git a/packages/opencode/script/publish.ts b/packages/opencode/script/publish.ts
index ef35b8514f0..a81e7e9e930 100755
--- a/packages/opencode/script/publish.ts
+++ b/packages/opencode/script/publish.ts
@@ -40,16 +40,33 @@ for (const [name] of Object.entries(binaries)) {
}
await $`cd ./dist/${pkg.name} && bun publish --access public --tag ${Script.channel}`
+if (!Script.preview) {
+ const major = Script.version.split(".")[0]
+ const majorTag = `v${major}`
+ for (const [name] of Object.entries(binaries)) {
+ await $`cd dist/${name} && npm dist-tag add ${name}@${Script.version} ${majorTag}`
+ }
+ await $`cd ./dist/${pkg.name} && npm dist-tag add ${pkg.name}-ai@${Script.version} ${majorTag}`
+}
+
if (!Script.preview) {
for (const key of Object.keys(binaries)) {
await $`cd dist/${key}/bin && zip -r ../../${key}.zip *`
}
// Calculate SHA values
- const arm64Sha = await $`sha256sum ./dist/opencode-linux-arm64.zip | cut -d' ' -f1`.text().then((x) => x.trim())
- const x64Sha = await $`sha256sum ./dist/opencode-linux-x64.zip | cut -d' ' -f1`.text().then((x) => x.trim())
- const macX64Sha = await $`sha256sum ./dist/opencode-darwin-x64.zip | cut -d' ' -f1`.text().then((x) => x.trim())
- const macArm64Sha = await $`sha256sum ./dist/opencode-darwin-arm64.zip | cut -d' ' -f1`.text().then((x) => x.trim())
+ const arm64Sha = await $`sha256sum ./dist/opencode-linux-arm64.zip | cut -d' ' -f1`
+ .text()
+ .then((x) => x.trim())
+ const x64Sha = await $`sha256sum ./dist/opencode-linux-x64.zip | cut -d' ' -f1`
+ .text()
+ .then((x) => x.trim())
+ const macX64Sha = await $`sha256sum ./dist/opencode-darwin-x64.zip | cut -d' ' -f1`
+ .text()
+ .then((x) => x.trim())
+ const macArm64Sha = await $`sha256sum ./dist/opencode-darwin-arm64.zip | cut -d' ' -f1`
+ .text()
+ .then((x) => x.trim())
const [pkgver, _subver = ""] = Script.version.split(/(-.*)/, 2)