fix(updater): follow the latest stable release

This commit is contained in:
Tunglies
2026-09-21 21:21:17 +08:00
parent 5059cdcb9d
commit d7e0126586
2 changed files with 6 additions and 14 deletions
+3 -12
View File
@@ -14,22 +14,13 @@ async function resolveUpdater() {
const options = { owner: context.repo.owner, repo: context.repo.repo }
const github = getOctokit(process.env.GITHUB_TOKEN)
const { data: tags } = await github.rest.repos.listTags({
...options,
per_page: 10,
page: 1,
})
const tag = tags.find((t) => t.name.startsWith('v'))
const { data: latestRelease } =
await github.rest.repos.getLatestRelease(options)
const tag = { name: latestRelease.tag_name }
console.log(tag)
console.log()
const { data: latestRelease } = await github.rest.repos.getReleaseByTag({
...options,
tag: tag.name,
})
const updateData = {
name: tag.name,
notes: await resolveUpdateLog(tag.name), // use Changelog.md
+3 -2
View File
@@ -40,10 +40,11 @@ async function resolveUpdater() {
const tags = allTags
console.log(`Retrieved ${tags.length} tags in total`)
const stableTagRegex = /^v\d+\.\d+\.\d+$/
const preReleaseRegex = /^(alpha|beta|rc|pre)$/i
const stableTag = tags.find((t) => stableTagRegex.test(t.name))
const { data: latestRelease } =
await github.rest.repos.getLatestRelease(options)
const stableTag = { name: latestRelease.tag_name }
const preReleaseTag = tags.find((t) => preReleaseRegex.test(t.name))
console.log('All tags:', tags.map((t) => t.name).join(', '))