|
8 | 8 | permissions: |
9 | 9 | contents: write |
10 | 10 |
|
| 11 | +env: |
| 12 | + FORCE_JAVASCRIPT_ACTIONS_TO_NODE24: "true" |
| 13 | + |
11 | 14 | jobs: |
12 | 15 | build: |
13 | 16 | name: Package (${{ matrix.os }}) |
@@ -51,13 +54,41 @@ jobs: |
51 | 54 | raise FileNotFoundError(f'Missing build output: {source_dir}') |
52 | 55 | shutil.make_archive(str(out / name), 'zip', root_dir=source_dir.parent, base_dir=source_dir.name) |
53 | 56 |
|
| 57 | + def first_existing(candidates): |
| 58 | + for candidate in candidates: |
| 59 | + if candidate.exists(): |
| 60 | + return candidate |
| 61 | + return None |
| 62 | +
|
54 | 63 | 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) |
56 | 71 | 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) |
58 | 79 | 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]) |
61 | 92 | else: |
62 | 93 | raise RuntimeError(f'Unsupported RUNNER_OS: {runner}') |
63 | 94 | PY |
|
0 commit comments