Skip to content

Commit 5d18cd0

Browse files
committed
Stabilize Electron release make checks
1 parent 00981cd commit 5d18cd0

5 files changed

Lines changed: 44 additions & 8 deletions

File tree

.github/workflows/release.yml

Lines changed: 18 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -289,14 +289,24 @@ jobs:
289289
npx electron-forge package \
290290
--platform "${{ matrix.host_platform }}" \
291291
--arch "${{ matrix.arch }}"
292-
set +e
293-
npx electron-forge make \
294-
--skip-package \
295-
--platform "${{ matrix.host_platform }}" \
296-
--arch "${{ matrix.arch }}" \
297-
--targets "${{ matrix.forge_targets }}"
298-
forge_status=$?
299-
set -e
292+
FORGE_MAKE_LOG="$RUNNER_TEMP/electron-forge-make-${{ matrix.host_platform }}-${{ matrix.arch }}.log"
293+
run_forge_make() {
294+
set +e
295+
npx electron-forge make \
296+
--skip-package \
297+
--platform "${{ matrix.host_platform }}" \
298+
--arch "${{ matrix.arch }}" \
299+
--targets "${{ matrix.forge_targets }}" 2>&1 | tee "$FORGE_MAKE_LOG"
300+
forge_status=${PIPESTATUS[0]}
301+
set -e
302+
}
303+
run_forge_make
304+
if [ "$forge_status" -ne 0 ] && [ "${{ matrix.host_platform }}" = "darwin" ] && grep -q "hdiutil detach /Volumes/Lime" "$FORGE_MAKE_LOG" && grep -q "No such file or directory" "$FORGE_MAKE_LOG"; then
305+
echo "Electron Forge DMG cleanup hit a missing /Volumes/Lime mount; retrying make once after best-effort cleanup."
306+
hdiutil detach "/Volumes/Lime" -force || true
307+
sleep 5
308+
run_forge_make
309+
fi
300310
echo "Electron Forge output files:"
301311
if [ -d release-electron ]; then
302312
find release-electron -type f | sort

scripts/electron/current-entrypoints.test.mjs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -262,6 +262,8 @@ describe("Electron current package entrypoints", () => {
262262
expect(smokeBuildRenderer).toContain("NODE_OPTIONS");
263263
expect(viteConfig).toContain("base:");
264264
expect(viteConfig).toContain('isElectronRenderer ? "./" : undefined');
265+
expect(viteConfig).toContain('find: "app-server-client"');
266+
expect(viteConfig).toContain("./packages/app-server-client/src/index.ts");
265267
});
266268

267269
it("build monitor observes Electron package output instead of retired host bundles", () => {

scripts/electron/release-workflow-guard.mjs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -297,10 +297,16 @@ function assertBuildSteps(buildJob) {
297297
"npm run electron:build",
298298
"npx electron-forge package",
299299
"npx electron-forge make",
300+
"FORGE_MAKE_LOG",
301+
"run_forge_make",
300302
"--skip-package",
301303
'--platform "${{ matrix.host_platform }}"',
302304
'--arch "${{ matrix.arch }}"',
303305
'--targets "${{ matrix.forge_targets }}"',
306+
"PIPESTATUS[0]",
307+
"hdiutil detach /Volumes/Lime",
308+
"No such file or directory",
309+
'hdiutil detach "/Volumes/Lime" -force || true',
304310
"find release-electron -type f | sort",
305311
"codesign --display --verbose=4",
306312
"codesign --verify --deep --strict --verbose=4",

scripts/electron/release-workflow-guard.test.mjs

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -129,6 +129,17 @@ describe("Electron release workflow guard", () => {
129129
);
130130
});
131131

132+
it("rejects missing macOS DMG detach retry guard in Forge make step", () => {
133+
const current = fs.readFileSync(".github/workflows/release.yml", "utf8");
134+
const workflowPath = tempWorkflowPath(
135+
current.replaceAll("hdiutil detach /Volumes/Lime", "hdiutil detach"),
136+
);
137+
138+
expect(() => validateReleaseWorkflow({ workflowPath })).toThrow(
139+
/Electron Forge make step must include hdiutil detach \/Volumes\/Lime/,
140+
);
141+
});
142+
132143
it("rejects missing Forge make asset scan", () => {
133144
const current = fs.readFileSync(".github/workflows/release.yml", "utf8");
134145
const workflowPath = tempWorkflowPath(

vite.config.ts

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,13 @@ export default defineConfig(({ command, mode }) => {
5656
find: "@",
5757
replacement: path.resolve(__dirname, "./src"),
5858
},
59+
{
60+
find: "app-server-client",
61+
replacement: path.resolve(
62+
__dirname,
63+
"./packages/app-server-client/src/index.ts",
64+
),
65+
},
5966
],
6067
},
6168
optimizeDeps: {

0 commit comments

Comments
 (0)