diff options
| author | Dax Raad <[email protected]> | 2025-10-05 07:14:52 -0400 |
|---|---|---|
| committer | Dax Raad <[email protected]> | 2025-10-05 07:14:52 -0400 |
| commit | aced8c95f2c96bac0fa85db40fdccdf0f153dac2 (patch) | |
| tree | d140a7013b2ba62ed6346048f091dfa2d8896bc3 | |
| parent | 1bb664869c9abbd9537f0f1a76f07b728a42b25f (diff) | |
| download | opencode-aced8c95f2c96bac0fa85db40fdccdf0f153dac2.tar.gz opencode-aced8c95f2c96bac0fa85db40fdccdf0f153dac2.zip | |
ci: publish
| -rwxr-xr-x | script/publish.ts | 16 |
1 files changed, 9 insertions, 7 deletions
diff --git a/script/publish.ts b/script/publish.ts index 6d162d66f..a4f2ba663 100755 --- a/script/publish.ts +++ b/script/publish.ts @@ -14,11 +14,13 @@ const snapshot = process.env["OPENCODE_SNAPSHOT"] === "true" const version = await (async () => { if (snapshot) return `0.0.0-${new Date().toISOString().slice(0, 16).replace(/[-:T]/g, "")}` if (process.env["OPENCODE_VERSION"]) return process.env["OPENCODE_VERSION"] - const [major, minor, patch] = (await $`gh release list --limit 1 --json tagName --jq '.[0].tagName'`.text()) - .trim() - .replace(/^v/, "") - .split(".") - .map((x) => Number(x) || 0) + const npmVersion = await fetch("https://registry.npmjs.org/opencode-ai/latest") + .then((res) => { + if (!res.ok) throw new Error(res.statusText) + return res.json() + }) + .then((data: any) => data.version) + const [major, minor, patch] = npmVersion.split(".").map((x: string) => Number(x) || 0) const t = process.env["OPENCODE_BUMP"]?.toLowerCase() if (t === "major") return `${major + 1}.0.0` if (t === "minor") return `${major}.${minor + 1}.0` @@ -28,12 +30,12 @@ process.env["OPENCODE_VERSION"] = version console.log("version:", version) if (!snapshot) { - const previous = await fetch("https://api.github.com/repos/sst/opencode/releases/latest") + const previous = await fetch("https://registry.npmjs.org/opencode-ai/latest") .then((res) => { if (!res.ok) throw new Error(res.statusText) return res.json() }) - .then((data) => data.tag_name) + .then((data: any) => data.version) const opencode = await createOpencode() const session = await opencode.client.session.create() |
