fix(release): 修正 updater 清单的下载 URL 与发布顺序
Axolotl desktop CI / guardrails (push) Has been cancelled
Axolotl desktop CI / desktop (macos-latest) (push) Has been cancelled
Axolotl desktop CI / desktop (ubuntu-latest) (push) Has been cancelled
Axolotl desktop CI / desktop (windows-latest) (push) Has been cancelled
Axolotl desktop CI / website (push) Has been cancelled
Repository checks / typos (push) Has been cancelled
Repository checks / tombi (push) Has been cancelled
Rust checks / shear (push) Has been cancelled
Sync source to CNB / Sync Git ref (push) Has been cancelled
Starlight release / Release preflight (push) Has been cancelled
Prepare pnpm cache / prepare (push) Has been cancelled
Starlight release / Build (Windows x64) (push) Has been cancelled
Starlight release / Build (Linux arm64) (push) Has been cancelled
Starlight release / Build (Linux x64) (push) Has been cancelled
Starlight release / Build (macOS universal) (push) Has been cancelled
Starlight release / Verify and publish (push) Has been cancelled
Axolotl desktop CI / guardrails (push) Has been cancelled
Axolotl desktop CI / desktop (macos-latest) (push) Has been cancelled
Axolotl desktop CI / desktop (ubuntu-latest) (push) Has been cancelled
Axolotl desktop CI / desktop (windows-latest) (push) Has been cancelled
Axolotl desktop CI / website (push) Has been cancelled
Repository checks / typos (push) Has been cancelled
Repository checks / tombi (push) Has been cancelled
Rust checks / shear (push) Has been cancelled
Sync source to CNB / Sync Git ref (push) Has been cancelled
Starlight release / Release preflight (push) Has been cancelled
Prepare pnpm cache / prepare (push) Has been cancelled
Starlight release / Build (Windows x64) (push) Has been cancelled
Starlight release / Build (Linux arm64) (push) Has been cancelled
Starlight release / Build (Linux x64) (push) Has been cancelled
Starlight release / Build (macOS universal) (push) Has been cancelled
Starlight release / Verify and publish (push) Has been cancelled
发布时 verify update manifest 失败:draft release 的资产 URL 为 `.../releases/download/untagged-<hash>/...`,而校验要求 URL 含 tag 名。 - create-update-manifest.mjs 不再依赖 draft release 的 browser_download_url,改为按 tag 与资产名自行拼接稳定的 `.../releases/download/<tag>/<name>` 地址。 - build-on-tag.yml 将 Publish release 提前到生成/校验清单之前, 使清单在 release 已发布后生成;并移除多余的 “Refresh published GitHub release metadata” 步骤。 - catalog.ts 版本公告更新为 1.0.0-beta13。
This commit is contained in:
1 parent
e1cca236ee
commit
9411d0945a
3 files changed
+31
-36
No files matched your search
@@ -303,6 +303,20 @@ jobs:
|
|||||||
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||||
run: gh release download "${GITHUB_REF_NAME}" --pattern '*.sig' --dir release-check/signatures
|
run: gh release download "${GITHUB_REF_NAME}" --pattern '*.sig' --dir release-check/signatures
|
||||||
|
|
||||||
|
# Publish the draft release before generating the updater manifest. While
|
||||||
|
# the release is a draft GitHub reports asset URLs as
|
||||||
|
# `.../releases/download/untagged-<hash>/...`; only after publishing does
|
||||||
|
# the manifest point at the stable `.../releases/download/<tag>/...` path.
|
||||||
|
- name: Publish release
|
||||||
|
env:
|
||||||
|
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||||
|
run: |
|
||||||
|
if [[ "${GITHUB_REF_NAME}" == *-* ]]; then
|
||||||
|
gh release edit "${GITHUB_REF_NAME}" --draft=false --prerelease
|
||||||
|
else
|
||||||
|
gh release edit "${GITHUB_REF_NAME}" --draft=false --latest
|
||||||
|
fi
|
||||||
|
|
||||||
- name: Download release metadata
|
- name: Download release metadata
|
||||||
env:
|
env:
|
||||||
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||||
@@ -329,31 +343,6 @@ jobs:
|
|||||||
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||||
run: gh release upload "${GITHUB_REF_NAME}" release-check/latest.json --clobber
|
run: gh release upload "${GITHUB_REF_NAME}" release-check/latest.json --clobber
|
||||||
|
|
||||||
- name: Publish release
|
|
||||||
env:
|
|
||||||
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
||||||
run: |
|
|
||||||
if [[ "${GITHUB_REF_NAME}" == *-* ]]; then
|
|
||||||
gh release edit "${GITHUB_REF_NAME}" --draft=false --prerelease
|
|
||||||
else
|
|
||||||
gh release edit "${GITHUB_REF_NAME}" --draft=false --latest
|
|
||||||
fi
|
|
||||||
|
|
||||||
- name: Refresh published GitHub release metadata
|
|
||||||
env:
|
|
||||||
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
||||||
run: |
|
|
||||||
release_id="$(
|
|
||||||
gh api "repos/${GITHUB_REPOSITORY}/releases" \
|
|
||||||
--paginate \
|
|
||||||
--jq ".[] | select(.tag_name == \"${GITHUB_REF_NAME}\") | .id"
|
|
||||||
)"
|
|
||||||
if [[ -z "$release_id" ]]; then
|
|
||||||
echo "Published release ${GITHUB_REF_NAME} was not found"
|
|
||||||
exit 1
|
|
||||||
fi
|
|
||||||
gh api "repos/${GITHUB_REPOSITORY}/releases/${release_id}" > release-check/release.json
|
|
||||||
|
|
||||||
- name: Build Update Server artifact catalog
|
- name: Build Update Server artifact catalog
|
||||||
run: |
|
run: |
|
||||||
node scripts/axolotl/create-update-server-catalog.mjs \
|
node scripts/axolotl/create-update-server-catalog.mjs \
|
||||||
|
|||||||
@@ -33,12 +33,12 @@ export const ANNOUNCEMENT_CHANGE_TYPES: readonly AnnouncementChangeType[] = [
|
|||||||
|
|
||||||
export const launcherAnnouncements: readonly LauncherAnnouncement[] = [
|
export const launcherAnnouncements: readonly LauncherAnnouncement[] = [
|
||||||
{
|
{
|
||||||
id: 'launcher-1.0.0-beta12',
|
id: 'launcher-1.0.0-beta13',
|
||||||
version: '1.0.0-beta12',
|
version: '1.0.0-beta13',
|
||||||
publishedAt: '2026-09-25',
|
publishedAt: '2026-09-26',
|
||||||
title: {
|
title: {
|
||||||
'en-US': 'Starlight Launcher 1.0.0-beta12',
|
'en-US': 'Starlight Launcher 1.0.0-beta13',
|
||||||
'zh-CN': 'Starlight Launcher 1.0.0-beta12',
|
'zh-CN': 'Starlight Launcher 1.0.0-beta13',
|
||||||
},
|
},
|
||||||
changes: {
|
changes: {
|
||||||
added: [
|
added: [
|
||||||
|
|||||||
@@ -1,6 +1,15 @@
|
|||||||
import fs from 'node:fs'
|
import fs from 'node:fs'
|
||||||
import path from 'node:path'
|
import path from 'node:path'
|
||||||
|
|
||||||
|
// Build a stable release download URL from the tag and asset name instead of
|
||||||
|
// relying on `browser_download_url`. While the release is still a draft GitHub
|
||||||
|
// reports the asset URL as `.../releases/download/untagged-<hash>/...`, which
|
||||||
|
// would make the updater manifest point at a path that disappears once the
|
||||||
|
// release is published.
|
||||||
|
function buildDownloadUrl(assetName, versionTag) {
|
||||||
|
const repository = process.env.GITHUB_REPOSITORY || 'ApTx2012/Starlight_Lancher'
|
||||||
|
return `https://github.com/${repository}/releases/download/${versionTag}/${encodeURIComponent(assetName)}`
|
||||||
|
}
|
||||||
const [releasePath, signaturesPath, tag, outputPath] = process.argv.slice(2)
|
const [releasePath, signaturesPath, tag, outputPath] = process.argv.slice(2)
|
||||||
|
|
||||||
if (!releasePath || !signaturesPath || !tag || !outputPath) {
|
if (!releasePath || !signaturesPath || !tag || !outputPath) {
|
||||||
@@ -52,10 +61,7 @@ for (const target of targets) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
const signature = fs.readFileSync(signaturePath, 'utf8')
|
const signature = fs.readFileSync(signaturePath, 'utf8')
|
||||||
const url = asset.browser_download_url ?? asset.url
|
const url = buildDownloadUrl(asset.name, tag)
|
||||||
if (!url) {
|
|
||||||
throw new Error(`Release asset ${asset.name} does not contain a download URL`)
|
|
||||||
}
|
|
||||||
|
|
||||||
for (const platform of target.platforms) {
|
for (const platform of target.platforms) {
|
||||||
platforms[platform] = { signature, url }
|
platforms[platform] = { signature, url }
|
||||||
@@ -81,8 +87,8 @@ for (const target of [
|
|||||||
)
|
)
|
||||||
}
|
}
|
||||||
const asset = matches[0]
|
const asset = matches[0]
|
||||||
const url = asset.browser_download_url ?? asset.url
|
const url = buildDownloadUrl(asset.name, tag)
|
||||||
if (!url || !Number.isSafeInteger(asset.size) || asset.size <= 0) {
|
if (!Number.isSafeInteger(asset.size) || asset.size <= 0) {
|
||||||
throw new Error(`Release asset ${asset.name} has invalid download metadata`)
|
throw new Error(`Release asset ${asset.name} has invalid download metadata`)
|
||||||
}
|
}
|
||||||
apt[target.platform] = {
|
apt[target.platform] = {
|
||||||
|
|||||||
Reference in new issue
Block a user