create-disposabl-app 0.8.1 → 0.8.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/disposabl.js +36 -2
- package/dist/index.js +73 -5
- package/dist/templates/default/.github/scripts/apple.sh +62 -0
- package/dist/templates/default/.github/scripts/disposabl.mjs +31 -14
- package/dist/templates/default/.github/scripts/mobile.sh +9 -9
- package/dist/templates/default/.github/scripts/platforms.sh +3 -3
- package/dist/templates/default/.github/scripts/release.sh +1 -1
- package/dist/templates/default/.github/workflows/pipeline.yml +115 -6
- package/dist/templates/default/apps/desktop/.oxfmtrc.json +5 -0
- package/dist/templates/default/apps/desktop/.oxlintrc.json +6 -0
- package/dist/templates/default/apps/desktop/README.md +90 -0
- package/dist/templates/default/apps/desktop/build-ci.mjs +56 -0
- package/dist/templates/default/apps/desktop/forge.config.mts +124 -0
- package/dist/templates/default/apps/desktop/gitignore +146 -0
- package/dist/templates/default/apps/desktop/index.html +16 -0
- package/dist/templates/default/apps/desktop/package.json +55 -0
- package/dist/templates/default/apps/desktop/rpm.spec.ejs +84 -0
- package/dist/templates/default/apps/desktop/src/assets/icon.icns +0 -0
- package/dist/templates/default/apps/desktop/src/assets/icon.ico +0 -0
- package/dist/templates/default/apps/desktop/src/assets/icon.png +0 -0
- package/dist/templates/default/apps/desktop/src/assets/logo.svg +8 -0
- package/dist/templates/default/apps/desktop/src/declarations.d.ts +4 -0
- package/dist/templates/default/apps/desktop/src/index.css +27 -0
- package/dist/templates/default/apps/desktop/src/main.ts +54 -0
- package/dist/templates/default/apps/desktop/src/preload.ts +3 -0
- package/dist/templates/default/apps/desktop/src/renderer.ts +1 -0
- package/dist/templates/default/apps/desktop/tsconfig.json +14 -0
- package/dist/templates/default/apps/desktop/vite.main.config.mts +9 -0
- package/dist/templates/default/apps/desktop/vite.preload.config.mts +4 -0
- package/dist/templates/default/apps/desktop/vite.renderer.config.mts +4 -0
- package/dist/templates/default/apps/mobile/README.md +1 -1
- package/dist/templates/default/apps/mobile/eas.json +2 -2
- package/dist/templates/default/apps/web/src/components/connections/provider-logo.tsx +38 -0
- package/dist/templates/default/apps/web/src/index.css +0 -22
- package/dist/templates/default/apps/web/src/router/_authenticated/dashboard.connections.tsx +244 -153
- package/dist/templates/default/bun.lock +4 -0
- package/dist/templates/default/dev.ts +22 -6
- package/dist/templates/default/packages/backend/convex/_generated/api.d.ts +10 -0
- package/dist/templates/default/packages/backend/convex/apps/actions/cleanup.ts +1 -0
- package/dist/templates/default/packages/backend/convex/apps/internal.ts +17 -1
- package/dist/templates/default/packages/backend/convex/connections/actions/github.ts +5 -4
- package/dist/templates/default/packages/backend/convex/connections/actions/oauth.ts +2 -2
- package/dist/templates/default/packages/backend/convex/downloads/action.ts +136 -0
- package/dist/templates/default/packages/backend/convex/downloads/http.ts +32 -0
- package/dist/templates/default/packages/backend/convex/downloads/internal.ts +58 -0
- package/dist/templates/default/packages/backend/convex/github/actions/http.ts +37 -8
- package/dist/templates/default/packages/backend/convex/github/actions/internal.ts +1 -0
- package/dist/templates/default/packages/backend/convex/github/actions/provision.ts +1 -1
- package/dist/templates/default/packages/backend/convex/github/actions/secrets.ts +38 -6
- package/dist/templates/default/packages/backend/convex/github/actions/signing.ts +41 -0
- package/dist/templates/default/packages/backend/convex/github/actions/tokens.ts +82 -16
- package/dist/templates/default/packages/backend/convex/github/identityCache.ts +54 -0
- package/dist/templates/default/packages/backend/convex/http.ts +3 -0
- package/dist/templates/default/packages/backend/convex/previews/token/actions/create.ts +21 -3
- package/dist/templates/default/packages/backend/convex/previews/token/actions/management.ts +17 -2
- package/dist/templates/default/packages/backend/convex/previews/token/internal.ts +4 -0
- package/dist/templates/default/packages/backend/convex/schema.ts +7 -0
- package/dist/templates/default/packages/backend/generated/openapi.json +107 -1
- package/dist/templates/default/packages/backend/generated/platforms.ts +12 -10
- package/dist/templates/default/packages/backend/package.json +3 -1
- package/dist/templates/default/packages/cli/preview.ts +63 -0
- package/dist/templates/default/packages/disposabl-kit/platforms.ts +3 -0
- package/dist/templates/default/packages/sdk/src/generated/index.ts +5 -0
- package/dist/templates/default/packages/sdk/src/generated/sdk.gen.ts +20 -0
- package/dist/templates/default/packages/sdk/src/generated/types.gen.ts +69 -0
- package/dist/templates/default/packages/skill/SKILL.md +38 -0
- package/package.json +1 -1
package/dist/disposabl.js
CHANGED
|
@@ -22,7 +22,7 @@ import { Command } from "commander";
|
|
|
22
22
|
// ../cli/package.json
|
|
23
23
|
var package_default = {
|
|
24
24
|
name: "@disposabl/cli",
|
|
25
|
-
version: "0.8.
|
|
25
|
+
version: "0.8.2",
|
|
26
26
|
type: "module",
|
|
27
27
|
description: "Command-line access to your Disposabl app",
|
|
28
28
|
license: "MIT",
|
|
@@ -327,6 +327,27 @@ async function configureDevelopment(directory, value) {
|
|
|
327
327
|
throw new Error("Development credentials do not match this app.");
|
|
328
328
|
if (!/^[a-z0-9-]+$/.test(value.name) || value.convexUrl !== `https://${value.name}.convex.cloud` || value.convexSiteUrl !== `https://${value.name}.convex.site`)
|
|
329
329
|
throw new Error("Development URLs do not match the deployment.");
|
|
330
|
+
if (value.productionConvexSiteUrl && !/^https:\/\/[a-z0-9-]+\.convex\.site$/.test(value.productionConvexSiteUrl))
|
|
331
|
+
throw new Error("Unexpected production Convex site URL.");
|
|
332
|
+
if (value.repositoryUrl) {
|
|
333
|
+
const repository = /^https:\/\/github\.com\/([a-zA-Z0-9-]+)\/([a-zA-Z0-9_.-]+)\.git$/.exec(value.repositoryUrl);
|
|
334
|
+
if (!repository)
|
|
335
|
+
throw new Error("Unexpected GitHub repository URL.");
|
|
336
|
+
const remote = spawnSync("git", ["remote", "get-url", "origin"], {
|
|
337
|
+
cwd: root,
|
|
338
|
+
encoding: "utf8"
|
|
339
|
+
});
|
|
340
|
+
if (remote.status === 0) {
|
|
341
|
+
const current = remote.stdout.trim();
|
|
342
|
+
const match = /^(?:https:\/\/github\.com\/|git@github\.com:|ssh:\/\/git@github\.com\/)([^/]+)\/([^/]+?)(?:\.git)?\/?$/i.exec(current);
|
|
343
|
+
if (!match || `${match[1]}/${match[2]}`.toLowerCase() !== `${repository[1]}/${repository[2]}`.toLowerCase())
|
|
344
|
+
throw new Error("Existing origin points to a different repository; it was not changed.");
|
|
345
|
+
} else {
|
|
346
|
+
const added = spawnSync("git", ["remote", "add", "origin", value.repositoryUrl], { cwd: root, encoding: "utf8" });
|
|
347
|
+
if (added.status !== 0)
|
|
348
|
+
throw new Error(`Could not add origin: ${added.stderr.trim()}`);
|
|
349
|
+
}
|
|
350
|
+
}
|
|
330
351
|
const files = ["packages/backend/.env.local", "apps/web/.env.local"];
|
|
331
352
|
if (config.platforms.some((p) => p === "android" || p === "ios"))
|
|
332
353
|
files.push("apps/mobile/.env.local");
|
|
@@ -342,6 +363,17 @@ async function configureDevelopment(directory, value) {
|
|
|
342
363
|
if (ignored.status !== 0 || tracked.status !== 1)
|
|
343
364
|
throw new Error(`${file} must be untracked and ignored by Git.`);
|
|
344
365
|
}
|
|
366
|
+
if (value.productionConvexSiteUrl && config.productionConvexSiteUrl !== value.productionConvexSiteUrl) {
|
|
367
|
+
config.productionConvexSiteUrl = value.productionConvexSiteUrl;
|
|
368
|
+
await writeFile2(join2(root, "disposabl.json"), JSON.stringify(config, null, 2) + `
|
|
369
|
+
`);
|
|
370
|
+
const formatted = spawnSync("bun", ["fmt", "disposabl.json"], {
|
|
371
|
+
cwd: root,
|
|
372
|
+
stdio: "pipe"
|
|
373
|
+
});
|
|
374
|
+
if (formatted.status !== 0)
|
|
375
|
+
throw new Error("Could not format disposabl.json after configuring development.");
|
|
376
|
+
}
|
|
345
377
|
await updateEnv(join2(root, files[0]), {
|
|
346
378
|
CONVEX_DEPLOY_KEY: value.deployKey,
|
|
347
379
|
CONVEX_URL: value.convexUrl,
|
|
@@ -377,7 +409,9 @@ function formatPreview(preview) {
|
|
|
377
409
|
Preview: latest?.url,
|
|
378
410
|
Release: latest?.githubReleaseUrl,
|
|
379
411
|
Download: latest?.artifactUrl,
|
|
380
|
-
Update: latest?.updateUrl
|
|
412
|
+
Update: latest?.updateUrl,
|
|
413
|
+
"Workflow run": latest?.run?.url,
|
|
414
|
+
Reason: latest?.reason
|
|
381
415
|
}))
|
|
382
416
|
if (url)
|
|
383
417
|
lines.push(` ${label}: ${url}`);
|
package/dist/index.js
CHANGED
|
@@ -8,13 +8,16 @@ import { fileURLToPath as fileURLToPath2 } from "node:url";
|
|
|
8
8
|
import { Command, CommanderError } from "commander";
|
|
9
9
|
import * as p2 from "@clack/prompts";
|
|
10
10
|
// package.json
|
|
11
|
-
var version = "0.8.
|
|
11
|
+
var version = "0.8.2";
|
|
12
12
|
|
|
13
13
|
// ../disposabl-kit/platforms.ts
|
|
14
14
|
var platforms = [
|
|
15
15
|
{ id: "web", label: "Web", group: "Required", status: "required" },
|
|
16
16
|
{ id: "android", label: "Android", group: "Mobile", status: "available" },
|
|
17
17
|
{ id: "ios", label: "iOS", group: "Mobile", status: "available" },
|
|
18
|
+
{ id: "macos", label: "macOS", group: "Desktop", status: "available" },
|
|
19
|
+
{ id: "windows", label: "Windows", group: "Desktop", status: "available" },
|
|
20
|
+
{ id: "linux", label: "Linux", group: "Desktop", status: "available" },
|
|
18
21
|
{
|
|
19
22
|
id: "mcp",
|
|
20
23
|
label: "MCP",
|
|
@@ -91,6 +94,8 @@ function selectedFolders(config) {
|
|
|
91
94
|
result.push("packages/sdk");
|
|
92
95
|
if (config.platforms.some((platform) => platform === "android" || platform === "ios"))
|
|
93
96
|
result.push("apps/mobile");
|
|
97
|
+
if (config.platforms.some((platform) => ["macos", "windows", "linux"].includes(platform)))
|
|
98
|
+
result.push("apps/desktop");
|
|
94
99
|
for (const feature of config.features) {
|
|
95
100
|
if (feature !== "authentication")
|
|
96
101
|
result.push("apps/" + feature);
|
|
@@ -323,6 +328,10 @@ async function createApp(template, destination, name, config, overwrite = false)
|
|
|
323
328
|
force: true
|
|
324
329
|
});
|
|
325
330
|
}
|
|
331
|
+
await rm(join(destination, "apps/web/src/router/_authenticated/dashboard.connections.tsx"), { force: true });
|
|
332
|
+
const dashboard = join(destination, "apps/web/src/router/_authenticated/dashboard.tsx");
|
|
333
|
+
await writeFile(dashboard, (await readFile(dashboard, "utf8")).replace(` <Link to="/dashboard/connections">Connections</Link>
|
|
334
|
+
`, ""));
|
|
326
335
|
if (!config.features.includes("authentication")) {
|
|
327
336
|
for (const path of [
|
|
328
337
|
"packages/disposabl-kit/client/routes/_auth-pages",
|
|
@@ -382,13 +391,52 @@ export const Route = createFileRoute("/_providers/_authenticated/dashboard")({
|
|
|
382
391
|
delete client.repository;
|
|
383
392
|
if (client.name.length > 214)
|
|
384
393
|
throw new Error("Project name is too long for generated package names.");
|
|
385
|
-
if (kind === "cli")
|
|
394
|
+
if (kind === "cli") {
|
|
386
395
|
client.bin = { [name]: "dist/index.js" };
|
|
396
|
+
await writeFile(join(folder, "index.ts"), `#!/usr/bin/env node
|
|
397
|
+
import { readFile } from "node:fs/promises";
|
|
398
|
+
import { runCli } from "./commands";
|
|
399
|
+
|
|
400
|
+
async function main() {
|
|
401
|
+
const args = process.argv.slice(2);
|
|
402
|
+
let origin: string | undefined;
|
|
403
|
+
for (let i = 0; i < args.length; i++) {
|
|
404
|
+
if (args[i] === "--origin") {
|
|
405
|
+
if (!args[i + 1] || args[i + 1]!.startsWith("--")) throw new Error("--origin requires a URL.");
|
|
406
|
+
origin = args[i + 1];
|
|
407
|
+
args.splice(i, 2);
|
|
408
|
+
i--;
|
|
409
|
+
} else if (args[i]!.startsWith("--origin=")) {
|
|
410
|
+
origin = args[i]!.slice("--origin=".length);
|
|
411
|
+
args.splice(i, 1);
|
|
412
|
+
i--;
|
|
413
|
+
}
|
|
414
|
+
}
|
|
415
|
+
if (!origin) origin = process.env.DISPOSABL_CLI_ORIGIN;
|
|
416
|
+
if (!origin) {
|
|
417
|
+
const config = await readFile("disposabl.json", "utf8").catch((error) => {
|
|
418
|
+
if (error.code === "ENOENT") return "{}";
|
|
419
|
+
throw error;
|
|
420
|
+
});
|
|
421
|
+
origin = JSON.parse(config).productionConvexSiteUrl;
|
|
422
|
+
}
|
|
423
|
+
if (!origin && !args.some((arg) => ["--help", "-h", "--version", "-V", "help"].includes(arg)) && args.length)
|
|
424
|
+
throw new Error("Set productionConvexSiteUrl in disposabl.json, DISPOSABL_CLI_ORIGIN, or --origin to your app's Convex site URL.");
|
|
425
|
+
if (args.includes("--help") || args.includes("-h") || !args.length)
|
|
426
|
+
console.log("App origin: --origin <url>, DISPOSABL_CLI_ORIGIN, or productionConvexSiteUrl in disposabl.json.");
|
|
427
|
+
await runCli([process.argv[0]!, process.argv[1]!, ...args], origin ?? "");
|
|
428
|
+
}
|
|
429
|
+
main().catch((error) => {
|
|
430
|
+
console.error(error instanceof Error ? error.message : "Command failed.");
|
|
431
|
+
process.exitCode = 1;
|
|
432
|
+
});
|
|
433
|
+
`);
|
|
434
|
+
}
|
|
387
435
|
await writeFile(packagePath, JSON.stringify(client, null, 2) + `
|
|
388
436
|
`);
|
|
389
437
|
const readme = join(folder, "README.md");
|
|
390
438
|
if (existsSync(readme))
|
|
391
|
-
await writeFile(readme, (await readFile(readme, "utf8")).replaceAll(`@disposabl/${kind}`, client.name));
|
|
439
|
+
await writeFile(readme, (await readFile(readme, "utf8")).replaceAll(`@disposabl/${kind}`, client.name) + (kind === "cli" ? "\nSet `productionConvexSiteUrl` in `disposabl.json` to your production Convex site URL, or supply `DISPOSABL_CLI_ORIGIN` or `--origin <url>` when running the CLI.\n" : ""));
|
|
392
440
|
}
|
|
393
441
|
for (const path of await readdir(destination, { recursive: true })) {
|
|
394
442
|
if (basename(path) === "gitignore") {
|
|
@@ -400,6 +448,14 @@ export const Route = createFileRoute("/_providers/_authenticated/dashboard")({
|
|
|
400
448
|
manifest.name = name;
|
|
401
449
|
await writeFile(manifestPath, JSON.stringify(manifest, null, 2) + `
|
|
402
450
|
`);
|
|
451
|
+
if (folders.includes("apps/desktop")) {
|
|
452
|
+
const desktopPath = join(destination, "apps/desktop/package.json");
|
|
453
|
+
const desktop = JSON.parse(await readFile(desktopPath, "utf8"));
|
|
454
|
+
desktop.productName = name;
|
|
455
|
+
desktop.description = `${name} desktop app`;
|
|
456
|
+
await writeFile(desktopPath, JSON.stringify(desktop, null, 2) + `
|
|
457
|
+
`);
|
|
458
|
+
}
|
|
403
459
|
if (folders.includes("apps/mobile")) {
|
|
404
460
|
const appConfigPath = join(destination, "apps/mobile/app.json");
|
|
405
461
|
const appConfig = JSON.parse(await readFile(appConfigPath, "utf8"));
|
|
@@ -477,7 +533,16 @@ async function setupApp(directory, name, run = runDisposabl) {
|
|
|
477
533
|
const path = join3(directory, "disposabl.json");
|
|
478
534
|
const config = JSON.parse(await readFile2(path, "utf8"));
|
|
479
535
|
if (config.appId) {
|
|
480
|
-
await run(["apps", "get", "--appId", config.appId]);
|
|
536
|
+
const app = await run(["apps", "get", "--appId", config.appId]);
|
|
537
|
+
if (JSON.stringify([...app.platforms].sort()) !== JSON.stringify([...config.platforms].sort()))
|
|
538
|
+
await run([
|
|
539
|
+
"apps",
|
|
540
|
+
"update",
|
|
541
|
+
"--appId",
|
|
542
|
+
config.appId,
|
|
543
|
+
"--platforms",
|
|
544
|
+
JSON.stringify(config.platforms)
|
|
545
|
+
]);
|
|
481
546
|
} else {
|
|
482
547
|
const app = await run([
|
|
483
548
|
"apps",
|
|
@@ -547,7 +612,7 @@ function commitApp(directory) {
|
|
|
547
612
|
var jsonOutput = process.argv.slice(2).includes("--json");
|
|
548
613
|
var program = new Command("create-disposabl-app").description("Create a Disposabl starter. Web is always included.").version(version, "-v, --version").argument("[appname]", "App name and new directory").option("--platforms <ids>", "Comma-separated platform IDs; Web is always included").option("--features <ids>", "Comma-separated feature IDs, or none (default: authentication)").option("-y, --yes", "Skip prompts; include Web and authentication by default").option("--setup", "Sign in to Disposabl and configure a development preview").option("--skip-install", "Create files without running bun install").option("--list-options", "List every platform and feature, including disabled choices").option("--json", "Skip prompts and emit a JSON result or error; install logs go to stderr").helpOption("-h, --help").addHelpText("after", `
|
|
549
614
|
Platforms:
|
|
550
|
-
web (required), android, ios, api, mcp, cli, typescript-sdk
|
|
615
|
+
web (required), android, ios, macos, windows, linux, api, mcp, cli, typescript-sdk
|
|
551
616
|
CLI and TypeScript SDK automatically include API.
|
|
552
617
|
|
|
553
618
|
Optional features:
|
|
@@ -588,6 +653,9 @@ function showOptions(json) {
|
|
|
588
653
|
"typescript-sdk": "packages/sdk",
|
|
589
654
|
android: "apps/mobile",
|
|
590
655
|
ios: "apps/mobile",
|
|
656
|
+
macos: "apps/desktop",
|
|
657
|
+
windows: "apps/desktop",
|
|
658
|
+
linux: "apps/desktop",
|
|
591
659
|
docs: "apps/docs"
|
|
592
660
|
},
|
|
593
661
|
configOnly: ["api", "mcp"]
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
#!/usr/bin/env bash
|
|
2
|
+
set -euo pipefail
|
|
3
|
+
report() { node "$GITHUB_WORKSPACE/.github/scripts/disposabl.mjs" report ios "$@"; }
|
|
4
|
+
check_source() { test "$(gh api "repos/$GH_REPO/$SOURCE_PATH" --jq 'if has("head") then (if .state == "open" then .head.sha else "closed" end) else .object.sha end')" = "$SOURCE"; }
|
|
5
|
+
case "${1:?operation required}" in
|
|
6
|
+
simulator)
|
|
7
|
+
check_source
|
|
8
|
+
bun x --no-install expo prebuild --platform ios --no-install
|
|
9
|
+
(cd ios && pod install)
|
|
10
|
+
workspace=$(find ios -maxdepth 1 -name '*.xcworkspace' -print -quit)
|
|
11
|
+
test -n "$workspace"
|
|
12
|
+
xcodebuild -workspace "$workspace" -scheme "$(basename "$workspace" .xcworkspace)" -configuration Release -sdk iphonesimulator -destination 'generic/platform=iOS Simulator' -derivedDataPath "$RUNNER_TEMP/ios-build" CODE_SIGNING_ALLOWED=NO build
|
|
13
|
+
app=$(find "$RUNNER_TEMP/ios-build/Build/Products/Release-iphonesimulator" -maxdepth 1 -name '*.app' -type d -print -quit)
|
|
14
|
+
test -n "$app"
|
|
15
|
+
check_source
|
|
16
|
+
mkdir -p "$GITHUB_WORKSPACE/dist/apple"
|
|
17
|
+
ditto -c -k --sequesterRsrc --keepParent "$app" "$GITHUB_WORKSPACE/dist/apple/ios-simulator.zip"
|
|
18
|
+
test -s "$GITHUB_WORKSPACE/dist/apple/ios-simulator.zip"
|
|
19
|
+
;;
|
|
20
|
+
prerequisites)
|
|
21
|
+
if [[ -z "${EXPO_TOKEN:-}" || -z "${EXPO_PROJECT_ID:-}" ]]; then
|
|
22
|
+
report blocked 'Connect Expo and configure EXPO_TOKEN and EXPO_PROJECT_ID before the iOS production build.'
|
|
23
|
+
exit 0
|
|
24
|
+
fi
|
|
25
|
+
echo 'ready=true' >> "$GITHUB_OUTPUT"
|
|
26
|
+
;;
|
|
27
|
+
production)
|
|
28
|
+
report building
|
|
29
|
+
jq --arg channel "$CHANNEL" --arg number "$DISPOSABL_IOS_BUILD_NUMBER" \
|
|
30
|
+
--arg url "$CONVEX_URL" --arg site "$CONVEX_SITE_URL" \
|
|
31
|
+
--arg project "$EXPO_PROJECT_ID" --arg owner "${EXPO_OWNER:-}" --arg slug "${EXPO_SLUG:-}" \
|
|
32
|
+
'.build["ios-production"].env += {DISPOSABL_MOBILE_CHANNEL: $channel, DISPOSABL_IOS_BUILD_NUMBER: $number, CONVEX_URL: $url, CONVEX_SITE_URL: $site, EXPO_PUBLIC_CONVEX_URL: $url, EXPO_PUBLIC_CONVEX_SITE_URL: $site, EXPO_PROJECT_ID: $project, EXPO_OWNER: $owner, EXPO_SLUG: $slug}' eas.json > "$RUNNER_TEMP/eas-production.json"
|
|
33
|
+
mv "$RUNNER_TEMP/eas-production.json" eas.json
|
|
34
|
+
if [[ -n "${ASC_APP_ID:-}" ]]; then
|
|
35
|
+
jq --arg id "$ASC_APP_ID" '.submit["ios-production"].ios.ascAppId = $id' eas.json > "$RUNNER_TEMP/eas-submit.json"
|
|
36
|
+
mv "$RUNNER_TEMP/eas-submit.json" eas.json
|
|
37
|
+
submit=(--auto-submit-with-profile ios-production)
|
|
38
|
+
else
|
|
39
|
+
submit=()
|
|
40
|
+
fi
|
|
41
|
+
check_source
|
|
42
|
+
if EAS_NO_VCS=1 bun x "$EAS_CLI" build --platform ios --profile ios-production --non-interactive --freeze-credentials --wait --json "${submit[@]}" > "$RUNNER_TEMP/ios-build.json" 2> "$RUNNER_TEMP/ios-build.log"; then
|
|
43
|
+
cat "$RUNNER_TEMP/ios-build.log"
|
|
44
|
+
if [[ -n "${ASC_APP_ID:-}" ]]; then
|
|
45
|
+
report ready 'EAS submitted the build to TestFlight; Apple processing may still be pending.'
|
|
46
|
+
echo 'EAS completed the iOS build and TestFlight submission. Check App Store Connect for processing and availability.' >> "$GITHUB_STEP_SUMMARY"
|
|
47
|
+
else
|
|
48
|
+
report blocked 'iOS build completed; configure ASC_APP_ID and an EAS App Store Connect submission key for TestFlight.'
|
|
49
|
+
echo 'iOS build completed, but TestFlight submission needs ASC_APP_ID and an EAS submission key.' >> "$GITHUB_STEP_SUMMARY"
|
|
50
|
+
fi
|
|
51
|
+
jq -r '.[] | "EAS build: " + (.id // "unknown") + " (" + (.status // "unknown") + ")"' "$RUNNER_TEMP/ios-build.json" >> "$GITHUB_STEP_SUMMARY"
|
|
52
|
+
else
|
|
53
|
+
cat "$RUNNER_TEMP/ios-build.log" >&2
|
|
54
|
+
if grep -Eqi 'Credentials are not set up|Credentials cannot be modified|Provisioning [Pp]rofile.*(--freeze-credentials|not configured)|ASC API key is required|App Store Connect API Keys cannot be set up|Set ascAppId in the submit profile' "$RUNNER_TEMP/ios-build.log"; then
|
|
55
|
+
report blocked 'Configure the iOS distribution certificate, provisioning profile, App Store Connect app ID and submission API key in EAS before unattended TestFlight builds.'
|
|
56
|
+
exit 0
|
|
57
|
+
fi
|
|
58
|
+
exit 1
|
|
59
|
+
fi
|
|
60
|
+
;;
|
|
61
|
+
*) echo "Unknown operation: $1" >&2; exit 1 ;;
|
|
62
|
+
esac
|
|
@@ -16,19 +16,36 @@ if (config.appId) {
|
|
|
16
16
|
throw new Error(`GitHub identity failed (${identity.status}).`);
|
|
17
17
|
const { value: token } = await identity.json();
|
|
18
18
|
const call = async (path, body) => {
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
19
|
+
for (let attempt = 0; ; attempt++) {
|
|
20
|
+
const response = await fetch(origin + path, {
|
|
21
|
+
method: "POST",
|
|
22
|
+
redirect: "error",
|
|
23
|
+
headers: {
|
|
24
|
+
Authorization: `Bearer ${token}`,
|
|
25
|
+
"Content-Type": "application/json",
|
|
26
|
+
},
|
|
27
|
+
body: JSON.stringify({ appId: config.appId, ...body }),
|
|
28
|
+
signal: AbortSignal.timeout(90_000),
|
|
29
|
+
});
|
|
30
|
+
if (response.ok) return response.json();
|
|
31
|
+
const delay = Number(response.headers.get("retry-after") || 5);
|
|
32
|
+
if (
|
|
33
|
+
![429, 502, 503, 504].includes(response.status) ||
|
|
34
|
+
attempt >= 5 ||
|
|
35
|
+
!Number.isFinite(delay) ||
|
|
36
|
+
delay > 60
|
|
37
|
+
)
|
|
38
|
+
throw new Error(
|
|
39
|
+
`Disposabl ${path} failed (${response.status}).${response.headers.has("retry-after") ? ` Retry after ${delay}s.` : ""}`,
|
|
40
|
+
);
|
|
41
|
+
console.log(
|
|
42
|
+
`Disposabl connection is busy; retrying in ${Math.max(1, delay)}s.`,
|
|
43
|
+
);
|
|
44
|
+
await response.body?.cancel();
|
|
45
|
+
await new Promise((resolve) =>
|
|
46
|
+
setTimeout(resolve, Math.max(1, delay) * 1000),
|
|
47
|
+
);
|
|
48
|
+
}
|
|
32
49
|
};
|
|
33
50
|
if (command === "token") {
|
|
34
51
|
const result = await call("/github/token", {});
|
|
@@ -74,7 +91,7 @@ if (config.appId) {
|
|
|
74
91
|
process.exit(0);
|
|
75
92
|
}
|
|
76
93
|
const suffix = {
|
|
77
|
-
android:
|
|
94
|
+
android: ".apk",
|
|
78
95
|
ios: ".ipa",
|
|
79
96
|
macos: ".dmg",
|
|
80
97
|
windows: ".exe",
|
|
@@ -50,7 +50,6 @@ done
|
|
|
50
50
|
;;
|
|
51
51
|
expo-fingerprint)
|
|
52
52
|
artifact=android.apk
|
|
53
|
-
[[ "$CHANNEL" != production ]] || artifact=android.aab
|
|
54
53
|
export artifact
|
|
55
54
|
for ((page=1; ; page++)); do
|
|
56
55
|
gh api "repos/$GH_REPO/releases?per_page=100&page=$page" > "$RUNNER_TEMP/releases.json"
|
|
@@ -69,7 +68,7 @@ bun -e '
|
|
|
69
68
|
const reusable = prior && Object.keys(wanted).every(k => prior[k] === wanted[k]) && /^[a-f0-9]{64}$/.test(prior.sha256 || "") && release.assets.some(a => a.name === process.env.artifact && a.state === "uploaded" && a.size > 0 && a.digest === `sha256:${prior.sha256}`);
|
|
70
69
|
const blocked = !reusable && process.env.CHANNEL === "production" && process.env.ANDROID_SIGNING_READY !== "true";
|
|
71
70
|
if (blocked) {
|
|
72
|
-
const reason = "Configure Android production signing credentials before building
|
|
71
|
+
const reason = "Configure Android production signing credentials before building a production APK.";
|
|
73
72
|
console.error(`::notice::${reason}`);
|
|
74
73
|
const report = Bun.spawnSync(["node", ".github/scripts/disposabl.mjs", "report", "android", "blocked", reason], {
|
|
75
74
|
cwd: process.env.GITHUB_WORKSPACE, stdout: "inherit", stderr: "inherit",
|
|
@@ -81,7 +80,6 @@ bun -e '
|
|
|
81
80
|
;;
|
|
82
81
|
expo-update)
|
|
83
82
|
artifact=android.apk
|
|
84
|
-
[[ "$CHANNEL" != production ]] || artifact=android.aab
|
|
85
83
|
mkdir -p dist/release
|
|
86
84
|
gh release download "$TAG" --pattern "$artifact" --dir dist/release
|
|
87
85
|
echo "$SHA dist/release/$artifact" | sha256sum --check
|
|
@@ -95,6 +93,13 @@ jq --arg sha "$SHA" '. + {sha256: $sha, action: "update"}' <<< "$MANIFEST" > ../
|
|
|
95
93
|
android-build)
|
|
96
94
|
test "$(gh api "repos/$GH_REPO/$SOURCE_PATH" --jq 'if has("head") then (if .state == "open" then .head.sha else "closed" end) else .object.sha end')" = "$SOURCE"
|
|
97
95
|
if [[ "$CHANNEL" == production ]]; then
|
|
96
|
+
if [[ -n "${DISPOSABL_ANDROID_SIGNING:-}" ]]; then
|
|
97
|
+
signing_values=$(jq -er '[.keystoreBase64, .storePassword, .keyAlias, .keyPassword] | if all(.[]; type == "string" and length > 0 and (contains("\n") | not) and (contains("\r") | not)) then .[] else error("Invalid Android signing bundle") end' <<< "$DISPOSABL_ANDROID_SIGNING")
|
|
98
|
+
mapfile -t signing <<< "$signing_values"
|
|
99
|
+
for value in "${signing[@]}"; do printf '::add-mask::%s\n' "${value//%/%25}"; done
|
|
100
|
+
export ANDROID_KEYSTORE_BASE64="${signing[0]}" ANDROID_KEYSTORE_PASSWORD="${signing[1]}" ANDROID_KEY_ALIAS="${signing[2]}" ANDROID_KEY_PASSWORD="${signing[3]}"
|
|
101
|
+
unset signing_values signing value DISPOSABL_ANDROID_SIGNING
|
|
102
|
+
fi
|
|
98
103
|
: "${ANDROID_KEYSTORE_BASE64:?}" "${ANDROID_KEYSTORE_PASSWORD:?}" "${ANDROID_KEY_ALIAS:?}" "${ANDROID_KEY_PASSWORD:?}"
|
|
99
104
|
export ANDROID_KEYSTORE_PATH="$RUNNER_TEMP/android-release.jks"
|
|
100
105
|
trap 'rm -f "$ANDROID_KEYSTORE_PATH"' EXIT
|
|
@@ -106,12 +111,7 @@ task=assembleRelease
|
|
|
106
111
|
artifact=android.apk
|
|
107
112
|
binary=android/app/build/outputs/apk/release/app-release.apk
|
|
108
113
|
fingerprint=assets/fingerprint
|
|
109
|
-
|
|
110
|
-
task=bundleRelease
|
|
111
|
-
artifact=android.aab
|
|
112
|
-
binary=android/app/build/outputs/bundle/release/app-release.aab
|
|
113
|
-
fingerprint=base/assets/fingerprint
|
|
114
|
-
fi
|
|
114
|
+
|
|
115
115
|
(cd android && ./gradlew ":app:$task" --no-daemon --build-cache)
|
|
116
116
|
test "$(unzip -p "$binary" "$fingerprint")" = "$RUNTIME"
|
|
117
117
|
test "$(bun x --no-install expo-updates runtimeversion:resolve --platform android --workflow managed | jq -er .runtimeVersion)" = "$RUNTIME"
|
|
@@ -28,10 +28,10 @@ node --input-type=module -e '
|
|
|
28
28
|
return !["ahead", "identical"].includes(diff.status) || !Array.isArray(diff.files) || diff.files.length >= 300 ? ["disposabl.json"] : diff.files.flatMap(f => [f.filename, f.previous_filename]).filter(relevant);
|
|
29
29
|
} catch { return paths; }
|
|
30
30
|
};
|
|
31
|
-
const affected = (platform, directory) => enabled.includes(platform) && changes(platform).some(p => p.startsWith(directory) || /^(bun.lock$|package.json$|disposabl.json$|turbo.json$|bunfig.toml$|patches\/|\.github\/workflows\/pipeline.yml$|packages\/(?!backend\/|create-disposabl-app\/))/.test(p));
|
|
31
|
+
const affected = (platform, directory) => enabled.includes(platform) && changes(platform).some(p => p.startsWith(directory) || /^(bun.lock$|package.json$|disposabl.json$|turbo.json$|bunfig.toml$|patches\/|\.github\/(workflows\/pipeline.yml$|scripts\/)|packages\/(?!backend\/|create-disposabl-app\/))/.test(p));
|
|
32
32
|
const target = process.env.DISPOSABL_DESKTOP_PLATFORM;
|
|
33
|
-
for (const platform of ["android", "ios"]) console.log(`${platform}=${platform === "
|
|
34
|
-
const desktop = ["linux", "windows"].filter(platform => affected(platform, "apps/desktop/"))
|
|
33
|
+
for (const platform of ["android", "ios"]) console.log(`${platform}=${(platform === "ios" || Boolean(process.env.EXPO_TOKEN)) && !target && affected(platform, "apps/mobile/")}`);
|
|
34
|
+
const desktop = ["linux", "windows", "macos"].filter(platform => affected(platform, "apps/desktop/"))
|
|
35
35
|
.map(platform => ({platform, runner: process.env[`${platform.toUpperCase()}_RUNNER`]}));
|
|
36
36
|
console.log(`desktop=${JSON.stringify(desktop)}`);
|
|
37
37
|
' >> "$GITHUB_OUTPUT"
|
|
@@ -71,7 +71,7 @@ check_source() { test "$(gh api "repos/$GH_REPO/$SOURCE_PATH" --jq 'if has("head
|
|
|
71
71
|
check_source
|
|
72
72
|
for file in dist/release/*; do test -f "$file"; test -s "$file"; done
|
|
73
73
|
case "$PLATFORM" in
|
|
74
|
-
android) artifact=android.apk;
|
|
74
|
+
android) artifact=android.apk; test -s "dist/release/$artifact"; test -s dist/release/android.json ;;
|
|
75
75
|
ios) test -s dist/release/ios.ipa; test -s dist/release/ios.json ;;
|
|
76
76
|
linux) compgen -G 'dist/release/*.deb' > /dev/null; compgen -G 'dist/release/*.rpm' > /dev/null ;;
|
|
77
77
|
windows) compgen -G 'dist/release/*.exe' > /dev/null; compgen -G 'dist/release/*.nupkg' > /dev/null; test -s dist/release/RELEASES ;;
|
|
@@ -19,9 +19,11 @@ env:
|
|
|
19
19
|
NODE_VERSION: &node-version "24"
|
|
20
20
|
LINUX_RUNNER: &linux-runner ubuntu-latest
|
|
21
21
|
WEB_RUNNER: &web-runner ubuntu-latest
|
|
22
|
-
WINDOWS_RUNNER:
|
|
22
|
+
WINDOWS_RUNNER: windows-2025
|
|
23
|
+
MACOS_RUNNER: macos-15
|
|
23
24
|
RELEASE_PREFIX: app
|
|
24
25
|
DISPOSABL_ANDROID_VERSION_CODE: ${{ github.run_number }}
|
|
26
|
+
DISPOSABL_IOS_BUILD_NUMBER: ${{ github.run_number }}
|
|
25
27
|
GH_TOKEN: ${{ github.token }}
|
|
26
28
|
GH_REPO: ${{ github.repository }}
|
|
27
29
|
SOURCE: ${{ github.event.pull_request.head.sha || github.sha }}
|
|
@@ -40,6 +42,7 @@ jobs:
|
|
|
40
42
|
runs-on: *web-runner
|
|
41
43
|
outputs:
|
|
42
44
|
desktop: ${{ steps.platforms.outputs.desktop }}
|
|
45
|
+
ios: ${{ steps.platforms.outputs.ios }}
|
|
43
46
|
android_build: ${{ steps.fingerprint.outputs.build }}
|
|
44
47
|
android_runtime: ${{ steps.fingerprint.outputs.runtime }}
|
|
45
48
|
android_manifest: ${{ steps.fingerprint.outputs.manifest }}
|
|
@@ -47,7 +50,7 @@ jobs:
|
|
|
47
50
|
convex_site_url: ${{ steps.deploy.outputs.CONVEX_SITE_URL }}
|
|
48
51
|
env:
|
|
49
52
|
PLATFORM: android
|
|
50
|
-
ANDROID_SIGNING_READY: ${{ secrets.ANDROID_KEYSTORE_BASE64 != '' && secrets.ANDROID_KEYSTORE_PASSWORD != '' && secrets.ANDROID_KEY_ALIAS != '' && secrets.ANDROID_KEY_PASSWORD != '' }}
|
|
53
|
+
ANDROID_SIGNING_READY: ${{ secrets.DISPOSABL_ANDROID_SIGNING != '' || (secrets.ANDROID_KEYSTORE_BASE64 != '' && secrets.ANDROID_KEYSTORE_PASSWORD != '' && secrets.ANDROID_KEY_ALIAS != '' && secrets.ANDROID_KEY_PASSWORD != '') }}
|
|
51
54
|
EXPO_TOKEN: ${{ secrets.EXPO_TOKEN }}
|
|
52
55
|
EXPO_PROJECT_ID: ${{ secrets.EXPO_PROJECT_ID || vars.EXPO_PROJECT_ID }}
|
|
53
56
|
EXPO_OWNER: ${{ secrets.EXPO_OWNER || vars.EXPO_OWNER }}
|
|
@@ -87,7 +90,6 @@ jobs:
|
|
|
87
90
|
run: |
|
|
88
91
|
node .github/scripts/disposabl.mjs report web,api,mcp building
|
|
89
92
|
if [[ -z "$EXPO_TOKEN" ]]; then node .github/scripts/disposabl.mjs report android blocked 'Connect Expo before building Android.'; fi
|
|
90
|
-
node .github/scripts/disposabl.mjs report ios,macos blocked 'Apple builds are temporarily disabled.'
|
|
91
93
|
if [[ '${{ github.event_name }}' == pull_request ]]; then node .github/scripts/disposabl.mjs report cli,typescript-sdk blocked 'Packages publish after merge to main.'; fi
|
|
92
94
|
- name: Check
|
|
93
95
|
run: bun run check
|
|
@@ -193,6 +195,7 @@ jobs:
|
|
|
193
195
|
RUNTIME: ${{ needs.web.outputs.android_runtime }}
|
|
194
196
|
DISPOSABL_ANDROID_CHANNEL: *channel
|
|
195
197
|
MANIFEST: ${{ needs.web.outputs.android_manifest }}
|
|
198
|
+
DISPOSABL_ANDROID_SIGNING: ${{ github.event_name == 'push' && secrets.DISPOSABL_ANDROID_SIGNING || '' }}
|
|
196
199
|
ANDROID_KEYSTORE_BASE64: ${{ github.event_name == 'push' && secrets.ANDROID_KEYSTORE_BASE64 || '' }}
|
|
197
200
|
ANDROID_KEYSTORE_PASSWORD: ${{ github.event_name == 'push' && secrets.ANDROID_KEYSTORE_PASSWORD || '' }}
|
|
198
201
|
ANDROID_KEY_ALIAS: ${{ github.event_name == 'push' && secrets.ANDROID_KEY_ALIAS || '' }}
|
|
@@ -203,7 +206,93 @@ jobs:
|
|
|
203
206
|
- name: Report Android failure
|
|
204
207
|
if: failure() || cancelled()
|
|
205
208
|
run: node .github/scripts/disposabl.mjs report android failed
|
|
206
|
-
|
|
209
|
+
ios-preview:
|
|
210
|
+
name: iOS simulator preview
|
|
211
|
+
needs: web
|
|
212
|
+
if: github.event_name == 'pull_request' && needs.web.outputs.ios == 'true'
|
|
213
|
+
permissions: *release-permissions
|
|
214
|
+
runs-on: xcode-27
|
|
215
|
+
timeout-minutes: 90
|
|
216
|
+
env:
|
|
217
|
+
DEVELOPER_DIR: /Applications/Xcode_27.2.0.app/Contents/Developer
|
|
218
|
+
CONVEX_URL: ${{ needs.web.outputs.convex_url }}
|
|
219
|
+
CONVEX_SITE_URL: ${{ needs.web.outputs.convex_site_url }}
|
|
220
|
+
EXPO_PUBLIC_CONVEX_URL: ${{ needs.web.outputs.convex_url }}
|
|
221
|
+
EXPO_PUBLIC_CONVEX_SITE_URL: ${{ needs.web.outputs.convex_site_url }}
|
|
222
|
+
EXPO_PROJECT_ID: ${{ secrets.EXPO_PROJECT_ID || vars.EXPO_PROJECT_ID }}
|
|
223
|
+
EXPO_OWNER: ${{ secrets.EXPO_OWNER || vars.EXPO_OWNER }}
|
|
224
|
+
EXPO_SLUG: ${{ secrets.EXPO_SLUG || vars.EXPO_SLUG }}
|
|
225
|
+
EXPO_NO_DOTENV: "1"
|
|
226
|
+
steps:
|
|
227
|
+
- *checkout
|
|
228
|
+
- *node
|
|
229
|
+
- *app-token
|
|
230
|
+
- *bun
|
|
231
|
+
- *cache
|
|
232
|
+
- *install
|
|
233
|
+
- name: Report build
|
|
234
|
+
run: node .github/scripts/disposabl.mjs report ios building
|
|
235
|
+
- name: Xcode toolchain
|
|
236
|
+
run: |
|
|
237
|
+
xcodebuild -version
|
|
238
|
+
xcrun swift --version
|
|
239
|
+
- name: Build simulator archive
|
|
240
|
+
working-directory: apps/mobile
|
|
241
|
+
run: bash "$GITHUB_WORKSPACE/.github/scripts/apple.sh" simulator
|
|
242
|
+
- uses: actions/upload-artifact@v4
|
|
243
|
+
with:
|
|
244
|
+
name: ios-simulator
|
|
245
|
+
path: dist/apple/ios-simulator.zip
|
|
246
|
+
retention-days: 3
|
|
247
|
+
if-no-files-found: error
|
|
248
|
+
- name: Report simulator archive
|
|
249
|
+
run: |
|
|
250
|
+
echo 'iOS simulator archive is available in this workflow run’s artifacts; it is not a device or TestFlight build.' >> "$GITHUB_STEP_SUMMARY"
|
|
251
|
+
node .github/scripts/disposabl.mjs report ios ready 'Simulator archive available in workflow artifacts.'
|
|
252
|
+
- name: Report failure
|
|
253
|
+
if: failure() || cancelled()
|
|
254
|
+
run: node .github/scripts/disposabl.mjs report ios failed 'iOS simulator build failed; check the workflow log.'
|
|
255
|
+
ios-production:
|
|
256
|
+
name: iOS production and TestFlight
|
|
257
|
+
needs: web
|
|
258
|
+
if: github.event_name == 'push' && needs.web.outputs.ios == 'true'
|
|
259
|
+
permissions: *release-permissions
|
|
260
|
+
runs-on: ubuntu-latest
|
|
261
|
+
timeout-minutes: 120
|
|
262
|
+
env:
|
|
263
|
+
EXPO_TOKEN: ${{ secrets.EXPO_TOKEN }}
|
|
264
|
+
EXPO_PROJECT_ID: ${{ secrets.EXPO_PROJECT_ID || vars.EXPO_PROJECT_ID }}
|
|
265
|
+
EXPO_OWNER: ${{ secrets.EXPO_OWNER || vars.EXPO_OWNER }}
|
|
266
|
+
EXPO_SLUG: ${{ secrets.EXPO_SLUG || vars.EXPO_SLUG }}
|
|
267
|
+
EXPO_NO_DOTENV: "1"
|
|
268
|
+
CONVEX_URL: ${{ needs.web.outputs.convex_url }}
|
|
269
|
+
CONVEX_SITE_URL: ${{ needs.web.outputs.convex_site_url }}
|
|
270
|
+
EXPO_PUBLIC_CONVEX_URL: ${{ needs.web.outputs.convex_url }}
|
|
271
|
+
EXPO_PUBLIC_CONVEX_SITE_URL: ${{ needs.web.outputs.convex_site_url }}
|
|
272
|
+
steps:
|
|
273
|
+
- *checkout
|
|
274
|
+
- *node
|
|
275
|
+
- *app-token
|
|
276
|
+
- *bun
|
|
277
|
+
- *cache
|
|
278
|
+
- *install
|
|
279
|
+
- name: Check Expo connection
|
|
280
|
+
id: apple-prerequisites
|
|
281
|
+
working-directory: apps/mobile
|
|
282
|
+
run: bash "$GITHUB_WORKSPACE/.github/scripts/apple.sh" prerequisites
|
|
283
|
+
- name: Load Expo environment
|
|
284
|
+
if: steps.apple-prerequisites.outputs.ready == 'true'
|
|
285
|
+
working-directory: apps/mobile
|
|
286
|
+
run: bash "$GITHUB_WORKSPACE/.github/scripts/mobile.sh" expo-env
|
|
287
|
+
- name: Build and submit to TestFlight
|
|
288
|
+
if: steps.apple-prerequisites.outputs.ready == 'true'
|
|
289
|
+
working-directory: apps/mobile
|
|
290
|
+
env:
|
|
291
|
+
ASC_APP_ID: ${{ secrets.ASC_APP_ID || vars.ASC_APP_ID }}
|
|
292
|
+
run: bash "$GITHUB_WORKSPACE/.github/scripts/apple.sh" production
|
|
293
|
+
- name: Report failure
|
|
294
|
+
if: failure() || cancelled()
|
|
295
|
+
run: node .github/scripts/disposabl.mjs report ios failed 'iOS production build or submission failed; check the workflow log.'
|
|
207
296
|
desktop:
|
|
208
297
|
needs: web
|
|
209
298
|
permissions: *release-permissions
|
|
@@ -240,7 +329,27 @@ jobs:
|
|
|
240
329
|
- name: Build
|
|
241
330
|
run: bun run --cwd apps/desktop preview
|
|
242
331
|
- *publish
|
|
243
|
-
-
|
|
332
|
+
- name: Upload desktop release artifacts
|
|
333
|
+
if: matrix.platform != 'macos'
|
|
334
|
+
uses: actions/upload-artifact@v4
|
|
335
|
+
with:
|
|
336
|
+
name: release-${{ env.PLATFORM }}
|
|
337
|
+
path: dist/release/
|
|
338
|
+
retention-days: 3
|
|
339
|
+
if-no-files-found: error
|
|
340
|
+
- name: Upload unsigned macOS artifact
|
|
341
|
+
if: matrix.platform == 'macos'
|
|
342
|
+
uses: actions/upload-artifact@v4
|
|
343
|
+
with:
|
|
344
|
+
name: macos-unsigned
|
|
345
|
+
path: dist/release/*.dmg
|
|
346
|
+
retention-days: 3
|
|
347
|
+
if-no-files-found: error
|
|
348
|
+
- name: Report macOS artifact
|
|
349
|
+
if: matrix.platform == 'macos'
|
|
350
|
+
run: |
|
|
351
|
+
echo 'macOS DMG is ad-hoc signed, not Developer ID signed or notarized. Download it from this workflow run’s artifacts.' >> "$GITHUB_STEP_SUMMARY"
|
|
352
|
+
node .github/scripts/disposabl.mjs report macos blocked 'Ad-hoc signed DMG available in workflow artifacts; Developer ID signing and notarization are not configured.'
|
|
244
353
|
- name: Report desktop failure
|
|
245
354
|
if: failure() || cancelled()
|
|
246
355
|
run: node .github/scripts/disposabl.mjs report "$PLATFORM" failed
|
|
@@ -276,7 +385,7 @@ jobs:
|
|
|
276
385
|
# The publisher executes scripts from main only; the authorizer verifies workflow_sha.
|
|
277
386
|
publish:
|
|
278
387
|
needs: [web, android, desktop]
|
|
279
|
-
if: always() && !cancelled() &&
|
|
388
|
+
if: always() && !cancelled() && needs.web.result == 'success' && (github.event_name == 'push' || github.event.pull_request.head.repo.full_name == github.repository)
|
|
280
389
|
environment: publishing
|
|
281
390
|
runs-on: ubuntu-latest
|
|
282
391
|
timeout-minutes: 15
|