feat(updater): migrate Windows updates to full release packages
- add a v0.2.10 legacy updater bridge - support both legacy and full update archives - stop publishing dedicated update packages after v0.2.10 - preserve user data during full-package upgrades
This commit is contained in:
1 parent
88baeab512
commit
365356969e
9 files changed
+595
-80
No files matched your search
@@ -4,6 +4,8 @@ export type PortableUpdateManifestAsset = {
|
||||
sizeBytes: number;
|
||||
};
|
||||
|
||||
export const LEGACY_UPDATE_BRIDGE_VERSION: string;
|
||||
|
||||
export type PortableUpdateManifest = {
|
||||
schemaVersion: number;
|
||||
version: string;
|
||||
|
||||
@@ -3,6 +3,8 @@ import { readFile, stat, writeFile } from 'node:fs/promises';
|
||||
import { basename, join, resolve } from 'node:path';
|
||||
import { pathToFileURL } from 'node:url';
|
||||
|
||||
export const LEGACY_UPDATE_BRIDGE_VERSION = '0.2.10';
|
||||
|
||||
export async function generatePortableUpdateManifest({
|
||||
directory,
|
||||
output,
|
||||
@@ -29,12 +31,15 @@ export async function generatePortableUpdateManifest({
|
||||
}
|
||||
|
||||
const assets = {};
|
||||
const useLegacyBridgeAssets = version === LEGACY_UPDATE_BRIDGE_VERSION;
|
||||
for (const arch of ['amd64', 'aarch64']) {
|
||||
const filename = `EasyCLIProxyAPI-update-${tag}-Windows-${arch}.zip`;
|
||||
const filename = useLegacyBridgeAssets
|
||||
? `EasyCLIProxyAPI-update-${tag}-Windows-${arch}.zip`
|
||||
: `EasyCLIProxyAPI-${tag}-Windows-${arch}.zip`;
|
||||
const path = join(resolvedDirectory, filename);
|
||||
const [contents, metadata] = await Promise.all([readFile(path), stat(path)]);
|
||||
if (!metadata.isFile() || metadata.size === 0) {
|
||||
throw new Error(`Portable updater asset is empty or not a file: ${filename}`);
|
||||
throw new Error(`Portable release asset is empty or not a file: ${filename}`);
|
||||
}
|
||||
assets[`windows-${arch}`] = {
|
||||
url: `https://github.com/${resolvedRepository}/releases/download/${tag}/${filename}`,
|
||||
|
||||
Reference in new issue
Block a user