Files
Ncurator/scripts/release/r2/storage-layout.mjs
T
hy 7cd3782f1e Refactor macOS release handling: remove x64 support and streamline metadata processing
- Removed support for macos-x64 in fragment definitions and related scripts.
- Updated finalize-macos script to only handle macos-arm64, simplifying signature checks and metadata writing.
- Deleted merge-mac-metadata script as it is no longer needed.
- Adjusted storage layout and release status checks to reflect the removal of x64.
- Updated tests to ensure they only validate macos-arm64 functionality.
2026-09-01 16:36:09 +08:00

30 lines
1.2 KiB
JavaScript

export const platformFamily = (platform) => {
if (platform === 'windows-x64') return 'windows'
if (platform === 'macos-arm64') return 'macos'
throw new Error(`unsupported release platform: ${platform}`)
}
export const artifactKey = (fragment, fileName) =>
`artifacts/${platformFamily(fragment.platform)}/${fragment.tag}/${fileName}`
export const statusKey = (tag, platform) => {
const family = platformFamily(platform)
return family === 'windows'
? `release-status/windows/${tag}.json`
: `release-status/macos/${tag}/${platform}.json`
}
export const fixedDownloadKey = (platform, role = 'installer') => {
if (role !== 'installer') throw new Error(`unsupported fixed download role: ${role}`)
if (platform === 'windows-x64') return 'downloads/latest/windows-x64.exe'
if (platform === 'macos-arm64') return 'downloads/latest/macos-arm64.dmg'
throw new Error(`unsupported release platform: ${platform}`)
}
export const artifactPrefix = (family, tag = '') => `artifacts/${family}/${tag ? `${tag}/` : ''}`
export const statusPrefix = (family, tag = '') =>
family === 'windows'
? `release-status/windows/${tag}`
: `release-status/macos/${tag ? `${tag}/` : ''}`