Skip to content

Commit 09e7e0a

Browse files
committed
tag majors
1 parent 0e60f66 commit 09e7e0a

File tree

1 file changed

+21
-4
lines changed

1 file changed

+21
-4
lines changed

packages/opencode/script/publish.ts

Lines changed: 21 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -40,16 +40,33 @@ for (const [name] of Object.entries(binaries)) {
4040
}
4141
await $`cd ./dist/${pkg.name} && bun publish --access public --tag ${Script.channel}`
4242

43+
if (!Script.preview) {
44+
const major = Script.version.split(".")[0]
45+
const majorTag = `v${major}`
46+
for (const [name] of Object.entries(binaries)) {
47+
await $`cd dist/${name} && npm dist-tag add ${name}@${Script.version} ${majorTag}`
48+
}
49+
await $`cd ./dist/${pkg.name} && npm dist-tag add ${pkg.name}-ai@${Script.version} ${majorTag}`
50+
}
51+
4352
if (!Script.preview) {
4453
for (const key of Object.keys(binaries)) {
4554
await $`cd dist/${key}/bin && zip -r ../../${key}.zip *`
4655
}
4756

4857
// Calculate SHA values
49-
const arm64Sha = await $`sha256sum ./dist/opencode-linux-arm64.zip | cut -d' ' -f1`.text().then((x) => x.trim())
50-
const x64Sha = await $`sha256sum ./dist/opencode-linux-x64.zip | cut -d' ' -f1`.text().then((x) => x.trim())
51-
const macX64Sha = await $`sha256sum ./dist/opencode-darwin-x64.zip | cut -d' ' -f1`.text().then((x) => x.trim())
52-
const macArm64Sha = await $`sha256sum ./dist/opencode-darwin-arm64.zip | cut -d' ' -f1`.text().then((x) => x.trim())
58+
const arm64Sha = await $`sha256sum ./dist/opencode-linux-arm64.zip | cut -d' ' -f1`
59+
.text()
60+
.then((x) => x.trim())
61+
const x64Sha = await $`sha256sum ./dist/opencode-linux-x64.zip | cut -d' ' -f1`
62+
.text()
63+
.then((x) => x.trim())
64+
const macX64Sha = await $`sha256sum ./dist/opencode-darwin-x64.zip | cut -d' ' -f1`
65+
.text()
66+
.then((x) => x.trim())
67+
const macArm64Sha = await $`sha256sum ./dist/opencode-darwin-arm64.zip | cut -d' ' -f1`
68+
.text()
69+
.then((x) => x.trim())
5370

5471
const [pkgver, _subver = ""] = Script.version.split(/(-.*)/, 2)
5572

0 commit comments

Comments
 (0)