summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorDax Raad <[email protected]>2025-06-12 11:18:17 -0400
committerDax Raad <[email protected]>2025-06-12 11:18:17 -0400
commite03ad6c42ea31784576dd9931c91b5b659ab98ea (patch)
tree83852f10942f29a507fa37896d6b162354dd7a32
parent33457d847217b771749505e5f57ce0001dacf2d2 (diff)
downloadopencode-e03ad6c42ea31784576dd9931c91b5b659ab98ea.tar.gz
opencode-e03ad6c42ea31784576dd9931c91b5b659ab98ea.zip
sync
-rwxr-xr-xpackages/opencode/script/publish.ts31
1 files changed, 26 insertions, 5 deletions
diff --git a/packages/opencode/script/publish.ts b/packages/opencode/script/publish.ts
index 81f942a03..2bb7e7425 100755
--- a/packages/opencode/script/publish.ts
+++ b/packages/opencode/script/publish.ts
@@ -1,7 +1,6 @@
#!/usr/bin/env bun
import { $ } from "bun"
-import { Glob } from "bun"
import pkg from "../package.json"
@@ -91,8 +90,30 @@ if (!snapshot) {
await $`cd dist/${key}/bin && zip -r ../../${key}.zip *`
}
- const files = Object.keys(optionalDependencies)
- .map((key) => `dist/${key}.zip`)
- .join(" ")
- await $`gh release create v${version} --title "Release v${version}" --generate-notes ./dist/*.zip`
+ const previous = await fetch(
+ "https://api.github.com/repos/sst/opencode/releases/latest",
+ )
+ .then((res) => res.json())
+ .then((data) => data.tag_name)
+
+ const commits = await fetch(
+ `https://api.github.com/repos/sst/opencode/compare/${previous}...HEAD`,
+ )
+ .then((res) => res.json())
+ .then((data) => data.commits || [])
+
+ const notes = commits
+ .map((commit: any) => `- ${commit.commit.message.split("\n")[0]}`)
+ .filter((x: string) => {
+ const lower = x.toLowerCase()
+ return (
+ !lower.includes("chore:") &&
+ !lower.includes("ci:") &&
+ !lower.includes("docs:")
+ )
+ })
+ .join("\n")
+
+ if (!dry)
+ await $`gh release create v${version} --title "v${version}" --notes ${notes} ./dist/*.zip`
}