fix: support concurrent game windows and prepare beta12 GitHub releases
This commit is contained in:
1 parent
91f483b960
commit
1cf67602d8
33 files changed
+681
-293
No files matched your search
@@ -2,11 +2,11 @@ import { execFileSync } from 'node:child_process'
|
||||
import { createHash } from 'node:crypto'
|
||||
|
||||
const migrationsDirectory = 'packages/app-lib/migrations'
|
||||
const repository = process.env.GITHUB_REPOSITORY ?? 'Mystic-Stars/Axolotl'
|
||||
// v1.7.5 is the canonical snapshot immediately before the v1.7.6 incident.
|
||||
const repository = process.env.GITHUB_REPOSITORY ?? 'ApTx2012/Starlight_Lancher'
|
||||
// Starlight's first release anchors the immutable migration history in this fork.
|
||||
const canonicalBootstrap = {
|
||||
ref: '7ddbfb8e57db4b0044a04cf28f25fb29e08c3279',
|
||||
tag: 'v1.7.5',
|
||||
ref: '71a8e65085c60eeb4154dd3fc39c0d84ed6fd18c',
|
||||
tag: 'v1.0.0-beta1',
|
||||
}
|
||||
// Published divergences remain evidence of an incident and never replace the canonical bytes.
|
||||
const knownPublishedDivergences = new Set([
|
||||
|
||||
@@ -62,7 +62,11 @@ try {
|
||||
const verify = spawnSync(
|
||||
process.execPath,
|
||||
['scripts/axolotl/verify-update-manifest.mjs', outputPath, tag],
|
||||
{ cwd: root, encoding: 'utf8' },
|
||||
{
|
||||
cwd: root,
|
||||
encoding: 'utf8',
|
||||
env: { ...process.env, GITHUB_REPOSITORY: 'Mystic-Stars/Axolotl' },
|
||||
},
|
||||
)
|
||||
assert.equal(verify.status, 0, verify.stderr)
|
||||
} finally {
|
||||
|
||||
@@ -17,6 +17,7 @@ const allowedUntranslatedMessages = new Set([
|
||||
'.minecraft',
|
||||
'Striding Hero',
|
||||
'Axolotl Launcher',
|
||||
'Starlight Launcher',
|
||||
'Explore high-quality Minecraft content on Modrinth.',
|
||||
'example.modrinth.gg',
|
||||
'{title} - {count}',
|
||||
|
||||
@@ -2,6 +2,8 @@ import fs from 'node:fs'
|
||||
|
||||
const [manifestPath, tag, source = 'github'] = process.argv.slice(2)
|
||||
const expectedVersion = tag?.replace(/^v/, '')
|
||||
const githubRepository = process.env.GITHUB_REPOSITORY || 'ApTx2012/Starlight_Lancher'
|
||||
const cnbRepository = process.env.CNB_REPO_SLUG || 'axlmc/Axolotl'
|
||||
|
||||
if (!manifestPath || !expectedVersion || !['github', 'cnb'].includes(source)) {
|
||||
throw new Error('Usage: node verify-update-manifest.mjs <latest.json> <version-tag> [github|cnb]')
|
||||
@@ -34,9 +36,13 @@ for (const platform of requiredPlatforms) {
|
||||
url.protocol === 'https:' &&
|
||||
(source === 'github'
|
||||
? url.hostname === 'github.com' &&
|
||||
pathname.includes('/mystic-stars/axolotl/releases/download/')
|
||||
pathname.startsWith(
|
||||
`/${githubRepository.toLowerCase()}/releases/download/${tag.toLowerCase()}/`,
|
||||
)
|
||||
: url.hostname === 'cnb.cool' &&
|
||||
pathname.includes(`/axlmc/axolotl/-/releases/download/${tag.toLowerCase()}/`))
|
||||
pathname.startsWith(
|
||||
`/${cnbRepository.toLowerCase()}/-/releases/download/${tag.toLowerCase()}/`,
|
||||
))
|
||||
if (!isExpectedUrl) {
|
||||
throw new Error(`Unexpected ${source} update URL for ${platform}: ${update.url}`)
|
||||
}
|
||||
|
||||
@@ -0,0 +1,72 @@
|
||||
import assert from 'node:assert/strict'
|
||||
import { spawnSync } from 'node:child_process'
|
||||
import fs from 'node:fs'
|
||||
import os from 'node:os'
|
||||
import path from 'node:path'
|
||||
import { test } from 'node:test'
|
||||
|
||||
test('update manifests must point to the configured repository and release tag', () => {
|
||||
const directory = fs.mkdtempSync(path.join(os.tmpdir(), 'starlight-manifest-'))
|
||||
const manifestPath = path.join(directory, 'latest.json')
|
||||
const tag = 'v1.0.0-beta12'
|
||||
const repository = 'ApTx2012/Starlight_Lancher'
|
||||
const platforms = [
|
||||
'darwin-aarch64',
|
||||
'darwin-x86_64',
|
||||
'linux-aarch64',
|
||||
'linux-x86_64',
|
||||
'windows-x86_64',
|
||||
]
|
||||
const verify = (url) => {
|
||||
fs.writeFileSync(
|
||||
manifestPath,
|
||||
JSON.stringify({
|
||||
version: tag.slice(1),
|
||||
platforms: Object.fromEntries(
|
||||
platforms.map((platform) => [
|
||||
platform,
|
||||
{
|
||||
url,
|
||||
signature: 'x'.repeat(64),
|
||||
},
|
||||
]),
|
||||
),
|
||||
apt: Object.fromEntries(
|
||||
['linux-aarch64', 'linux-x86_64'].map((platform) => [
|
||||
platform,
|
||||
{
|
||||
url,
|
||||
sha256: 'a'.repeat(64),
|
||||
size: 123,
|
||||
},
|
||||
]),
|
||||
),
|
||||
}),
|
||||
)
|
||||
return spawnSync(
|
||||
process.execPath,
|
||||
['scripts/axolotl/verify-update-manifest.mjs', manifestPath, tag],
|
||||
{
|
||||
env: { ...process.env, GITHUB_REPOSITORY: repository },
|
||||
encoding: 'utf8',
|
||||
},
|
||||
)
|
||||
}
|
||||
try {
|
||||
const success = verify(
|
||||
`https://github.com/${repository}/releases/download/${tag}/installer.zip`,
|
||||
)
|
||||
assert.equal(success.status, 0, success.stderr)
|
||||
for (const url of [
|
||||
`https://github.com/Mystic-Stars/Axolotl/releases/download/${tag}/installer.zip`,
|
||||
`https://github.com/${repository}/releases/download/v1.0.0-beta1/installer.zip`,
|
||||
`https://example.com/${repository}/releases/download/${tag}/installer.zip`,
|
||||
]) {
|
||||
const result = verify(url)
|
||||
assert.notEqual(result.status, 0)
|
||||
assert.match(result.stderr, /Unexpected github update URL/)
|
||||
}
|
||||
} finally {
|
||||
fs.rmSync(directory, { recursive: true, force: true })
|
||||
}
|
||||
})
|
||||
Reference in new issue
Block a user