build(release): stage local macOS v0.1.0 distribution
This commit is contained in:
@@ -70,6 +70,25 @@ const validateBaseUrl = () => {
|
||||
);
|
||||
};
|
||||
|
||||
const validateClientServerUrl = () => {
|
||||
const raw = env.VITE_DESKTOP_SERVER_URL;
|
||||
requireEnv("VITE_DESKTOP_SERVER_URL");
|
||||
if (!raw) return;
|
||||
|
||||
let url;
|
||||
try {
|
||||
url = new URL(raw);
|
||||
} catch (error) {
|
||||
fail(`VITE_DESKTOP_SERVER_URL is invalid: ${error.message}`);
|
||||
return;
|
||||
}
|
||||
|
||||
assert(url.protocol === "https:", "VITE_DESKTOP_SERVER_URL must use HTTPS.");
|
||||
assert(url.username === "" && url.password === "", "VITE_DESKTOP_SERVER_URL must not include credentials.");
|
||||
assert(url.pathname === "/", "VITE_DESKTOP_SERVER_URL must be an origin without a path.");
|
||||
assert(url.search === "" && url.hash === "", "VITE_DESKTOP_SERVER_URL must not include query parameters or fragments.");
|
||||
};
|
||||
|
||||
const validateWindowsTimestampUrl = () => {
|
||||
const raw = env.WINDOWS_TIMESTAMP_URL;
|
||||
requireEnv("WINDOWS_TIMESTAMP_URL");
|
||||
@@ -173,6 +192,7 @@ if (requiresWindowsSigning) {
|
||||
}
|
||||
|
||||
validateBaseUrl();
|
||||
validateClientServerUrl();
|
||||
|
||||
if (failures.length > 0) {
|
||||
console.error(`Desktop release readiness check failed:\n${failures.map((item) => ` - ${item}`).join("\n")}`);
|
||||
|
||||
Reference in New Issue
Block a user