feat(download): enhance download page with checksum integration and platform-specific releases

- Added a new `release-data.ts` file to manage release information with dynamic checksums.
- Introduced `CHECKSUMS` constant for easy access to file checksums.
- Updated `PlatformDownload.astro` to support additional release types and improved type safety.
- Enhanced the download page to correctly display platform-specific download links and checksums.
- Refactored tests to validate the new download functionality and checksum integration.
This commit is contained in:
taroj1205 2025-05-16 12:28:14 +12:00
parent 466c829a8a
commit 6a7bd311c0
No known key found for this signature in database
GPG key ID: 0FCB6CFFE0981AB7
9 changed files with 231 additions and 103 deletions

View file

@ -1,14 +1,12 @@
import { CONSTANT } from '~/constants'
/**
* Fetches the latest release notes from GitHub and parses the SHA-256 checksums.
* Returns a mapping from filename to checksum.
*/
export async function getChecksums() {
if (import.meta.env.DEV) {
return {
'zen.macos-universal.dmg': 'macsum',
'zen.installer.exe': 'winsum',
'zen.installer-arm64.exe': 'winarmsum',
}
return CONSTANT.CHECKSUMS
}
const res = await fetch('https://api.github.com/repos/zen-browser/desktop/releases/latest', {
headers: {