build(release): stage local macOS v0.1.0 distribution
This commit is contained in:
@@ -35,6 +35,25 @@ const isNativeDesktopRelease = Boolean(
|
||||
requiresUpdaterSigning,
|
||||
);
|
||||
|
||||
const validateDesktopServerUrl = () => {
|
||||
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 fail = (message) => failures.push(message);
|
||||
const assert = (condition, message) => {
|
||||
if (!condition) fail(message);
|
||||
@@ -61,6 +80,7 @@ assert(allowedChannels.has(channel), `VITE_BUILD_CHANNEL must be one of ${[...al
|
||||
if (isCi || isReleaseBuild) {
|
||||
assert(channel !== "local", "CI and release builds must inject VITE_BUILD_CHANNEL.");
|
||||
assert(fullShaPattern.test(commit), "CI and release builds must inject a full 40-character VITE_BUILD_COMMIT.");
|
||||
validateDesktopServerUrl();
|
||||
}
|
||||
|
||||
if (env.GITHUB_SHA) {
|
||||
|
||||
Reference in New Issue
Block a user