release: bridge legacy installations to ForgeFlow-Public
This commit is contained in:
1 parent
1192d75d15
commit
8769f07539
16 files changed
+339
-222
No files matched your search
@@ -5,6 +5,7 @@ const path = require("node:path");
|
||||
const { execFileSync } = require("node:child_process");
|
||||
const { app, safeStorage } = require("electron");
|
||||
const { normalizeBaseUrl } = require("../src/shared/validation.cjs");
|
||||
const { existingReleaseState } = require("../src/shared/release-policy.cjs");
|
||||
|
||||
const root = path.resolve(__dirname, "..");
|
||||
const configuredUserData =
|
||||
@@ -88,7 +89,7 @@ app.whenReady().then(async () => {
|
||||
"Release repository owner",
|
||||
);
|
||||
const repo = safeRepositoryPart(
|
||||
process.env.FORGEFLOW_RELEASE_REPO || config.updates?.repo || "ForgeFlow",
|
||||
process.env.FORGEFLOW_RELEASE_REPO || config.updates?.repo || "ForgeFlow-Public",
|
||||
"Release repository name",
|
||||
);
|
||||
const branch = safeRepositoryPart(
|
||||
@@ -143,17 +144,10 @@ app.whenReady().then(async () => {
|
||||
);
|
||||
}
|
||||
|
||||
if (release.draft !== true) {
|
||||
release = await api(
|
||||
baseUrl,
|
||||
token,
|
||||
`/repos/${encodeURIComponent(owner)}/${encodeURIComponent(repo)}/releases/${release.id}`,
|
||||
{
|
||||
method: "PATCH",
|
||||
headers: { "Content-Type": "application/json" },
|
||||
body: JSON.stringify({ draft: true }),
|
||||
},
|
||||
);
|
||||
if (existingReleaseState(release, version, commit) === "published") {
|
||||
console.log(`PASS ForgeFlow ${version} is already published for ${commit.slice(0, 7)}`);
|
||||
app.exit(0);
|
||||
return;
|
||||
}
|
||||
const binaries = [
|
||||
path.join(root, "dist", `ForgeFlow-Setup-${version}-win-x64.exe`),
|
||||
@@ -172,10 +166,6 @@ app.whenReady().then(async () => {
|
||||
const existing = (release.assets || []).find(
|
||||
(asset) => asset.name === name,
|
||||
);
|
||||
if (existing && Number(existing.size) === bytes.length) {
|
||||
console.log(`SKIP ${name} already published`);
|
||||
continue;
|
||||
}
|
||||
if (existing) {
|
||||
await api(
|
||||
baseUrl,
|
||||
|
||||
Reference in new issue
Block a user