This repository was archived by the owner on Feb 19, 2026. It is now read-only.
File tree Expand file tree Collapse file tree 3 files changed +29
-14
lines changed
Expand file tree Collapse file tree 3 files changed +29
-14
lines changed Original file line number Diff line number Diff line change @@ -18,13 +18,29 @@ export const team = [
1818 "R44VC0RP" ,
1919]
2020
21- export async function getLatestRelease ( ) {
22- return fetch ( "https://api.github.com/repos/anomalyco/opencode/releases/latest" )
23- . then ( ( res ) => {
24- if ( ! res . ok ) throw new Error ( res . statusText )
25- return res . json ( )
26- } )
27- . then ( ( data : any ) => data . tag_name . replace ( / ^ v / , "" ) )
21+ type Release = {
22+ tag_name : string
23+ draft : boolean
24+ prerelease : boolean
25+ }
26+
27+ export async function getLatestRelease ( skip ?: string ) {
28+ const data = await fetch ( "https://api.github.com/repos/anomalyco/opencode/releases?per_page=100" ) . then ( ( res ) => {
29+ if ( ! res . ok ) throw new Error ( res . statusText )
30+ return res . json ( )
31+ } )
32+
33+ const releases = data as Release [ ]
34+ const target = skip ?. replace ( / ^ v / , "" )
35+
36+ for ( const release of releases ) {
37+ if ( release . draft ) continue
38+ const tag = release . tag_name . replace ( / ^ v / , "" )
39+ if ( target && tag === target ) continue
40+ return tag
41+ }
42+
43+ throw new Error ( "No releases found" )
2844}
2945
3046type Commit = {
Original file line number Diff line number Diff line change 22
33import { $ } from "bun"
44import { Script } from "@opencode-ai/script"
5- import { buildNotes , getLatestRelease } from "./changelog"
65
76const highlightsTemplate = `
87<!--
@@ -58,17 +57,12 @@ await $`bun install`
5857await import ( `../packages/sdk/js/script/build.ts` )
5958
6059if ( Script . release ) {
61- // notes.unshift(highlightsTemplate)
6260 await $ `git commit -am "release: v${ Script . version } "`
6361 await $ `git tag v${ Script . version } `
6462 await $ `git fetch origin`
6563 await $ `git cherry-pick HEAD..origin/dev` . nothrow ( )
6664 await $ `git push origin HEAD --tags --no-verify --force-with-lease`
6765 await new Promise ( ( resolve ) => setTimeout ( resolve , 5_000 ) )
68- const previous = await getLatestRelease ( )
69- console . log ( "previous" , previous )
70- const notes = await buildNotes ( previous , "dev" )
71- await $ `gh release edit v${ Script . version } --draft=false --title "v${ Script . version } " --notes ${ notes . join ( "\n" ) || "No notable changes" } `
7266}
7367
7468console . log ( "\n=== cli ===\n" )
Original file line number Diff line number Diff line change 22
33import { Script } from "@opencode-ai/script"
44import { $ } from "bun"
5+ import { buildNotes , getLatestRelease } from "./changelog"
56
6- let output = [ `version=${ Script . version } ` ]
7+ const output = [ `version=${ Script . version } ` ]
78
89if ( ! Script . preview ) {
910 await $ `gh release create v${ Script . version } -d --title "v${ Script . version } " ${ Script . preview ? "--prerelease" : "" } `
1011 const release = await $ `gh release view v${ Script . version } --json id,tagName` . json ( )
12+ const previous = await getLatestRelease ( Script . version )
13+ const notes = await buildNotes ( previous , "HEAD" )
14+ const body = notes . join ( "\n" ) || "No notable changes"
15+ await $ `gh release edit v${ Script . version } --draft=false --title "v${ Script . version } " --notes ${ body } `
1116 output . push ( `release=${ release . id } ` )
1217 output . push ( `tag=${ release . tagName } ` )
1318}
You can’t perform that action at this time.
0 commit comments