summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
-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`
}