Skip to content

Commit 4049c3e

Browse files
committed
Enforce node24 usage in GitHub actions
Add FORCE_JAVASCRIPT_ACTIONS_TO_NODE24 env variable to build and release workflow files to force the actions runner to use node24. Update release packaging logic to support both MainApp.dist and ImageMerge.dist directories and validate the existence of necessary distribution artifacts for Windows, Linux, and macOS. This ensures builds produce consistent artifacts across platforms.
1 parent 798bf12 commit 4049c3e

2 files changed

Lines changed: 38 additions & 4 deletions

File tree

.github/workflows/build-test.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,9 @@ on:
55
tags-ignore:
66
- "*"
77

8+
env:
9+
FORCE_JAVASCRIPT_ACTIONS_TO_NODE24: "true"
10+
811
jobs:
912
build:
1013
name: Build (${{ matrix.os }})

.github/workflows/release.yml

Lines changed: 35 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,9 @@ on:
88
permissions:
99
contents: write
1010

11+
env:
12+
FORCE_JAVASCRIPT_ACTIONS_TO_NODE24: "true"
13+
1114
jobs:
1215
build:
1316
name: Package (${{ matrix.os }})
@@ -51,13 +54,41 @@ jobs:
5154
raise FileNotFoundError(f'Missing build output: {source_dir}')
5255
shutil.make_archive(str(out / name), 'zip', root_dir=source_dir.parent, base_dir=source_dir.name)
5356
57+
def first_existing(candidates):
58+
for candidate in candidates:
59+
if candidate.exists():
60+
return candidate
61+
return None
62+
5463
if runner == 'Windows':
55-
zip_dir('ImageMerge-windows-x64', root / 'dist' / 'windows' / 'MainApp.dist')
64+
dist_dir = first_existing([
65+
root / 'dist' / 'windows' / 'MainApp.dist',
66+
root / 'dist' / 'windows' / 'ImageMerge.dist',
67+
])
68+
if dist_dir is None:
69+
raise FileNotFoundError('Missing Windows dist folder (MainApp.dist/ImageMerge.dist)')
70+
zip_dir('ImageMerge-windows-x64', dist_dir)
5671
elif runner == 'Linux':
57-
zip_dir('ImageMerge-linux-x64', root / 'dist' / 'linux' / 'MainApp.dist')
72+
dist_dir = first_existing([
73+
root / 'dist' / 'linux' / 'MainApp.dist',
74+
root / 'dist' / 'linux' / 'ImageMerge.dist',
75+
])
76+
if dist_dir is None:
77+
raise FileNotFoundError('Missing Linux dist folder (MainApp.dist/ImageMerge.dist)')
78+
zip_dir('ImageMerge-linux-x64', dist_dir)
5879
elif runner == 'macOS':
59-
zip_dir('ImageMerge-macos-binary', root / 'dist' / 'macos-binary' / 'MainApp.dist')
60-
zip_dir('ImageMerge-macos-app', root / 'dist' / 'macos-app' / 'ImageMerge.app')
80+
dist_dir = first_existing([
81+
root / 'dist' / 'macos-binary' / 'MainApp.dist',
82+
root / 'dist' / 'macos-binary' / 'ImageMerge.dist',
83+
])
84+
if dist_dir is None:
85+
raise FileNotFoundError('Missing macOS binary dist folder (MainApp.dist/ImageMerge.dist)')
86+
zip_dir('ImageMerge-macos-binary', dist_dir)
87+
88+
app_candidates = sorted((root / 'dist' / 'macos-app').glob('*.app'))
89+
if not app_candidates:
90+
raise FileNotFoundError('Missing macOS app bundle (*.app) in dist/macos-app')
91+
zip_dir('ImageMerge-macos-app', app_candidates[0])
6192
else:
6293
raise RuntimeError(f'Unsupported RUNNER_OS: {runner}')
6394
PY

0 commit comments

Comments
 (0)