mirror of
https://github.com/MrPatben8/konduktor.git
synced 2026-11-27 10:22:51 +01:00
Implemented foundation of STEM support
This commit is contained in:
1 parent
376569ec75
commit
681add852a
25 files changed
+1816
-17
No files matched your search
@@ -20,14 +20,26 @@ interface GithubRelease {
|
||||
tag_name: string
|
||||
html_url: string
|
||||
body: string | null
|
||||
draft?: boolean
|
||||
prerelease?: boolean
|
||||
}
|
||||
|
||||
/**
|
||||
* The newest APP release. Not `/releases/latest`: that is whichever release
|
||||
* GitHub flags "latest", and the same repo also publishes the stem engine on
|
||||
* its own `engine-v*` channel — one flagged latest by mistake would make this
|
||||
* check go quiet (its tag does not parse as an app version) with no error. So
|
||||
* list recent releases (newest first) and take the first app tag.
|
||||
*/
|
||||
async function fetchLatestRelease(): Promise<GithubRelease> {
|
||||
const res = await fetch(`https://api.github.com/repos/${REPO}/releases/latest`, {
|
||||
const res = await fetch(`https://api.github.com/repos/${REPO}/releases?per_page=30`, {
|
||||
headers: { Accept: 'application/vnd.github+json' },
|
||||
})
|
||||
if (!res.ok) throw new Error(`GitHub responded ${res.status}`)
|
||||
return res.json()
|
||||
const releases: GithubRelease[] = await res.json()
|
||||
const app = releases.find((r) => !r.draft && !r.prerelease && /^v\d/.test(r.tag_name))
|
||||
if (!app) throw new Error('No app release found')
|
||||
return app
|
||||
}
|
||||
|
||||
/** The semver triple at the start of a version/tag string ("v0.1.2-b7" → [0,1,2]). */
|
||||
|
||||
Reference in new issue
Block a user