Skip to content

Commit 7ecfa6e

Browse files
authored
Merge pull request #166 from brainlife/hotfix/resolve-pet-path-issues
fix: added smoke test, fixed PET paths, improved UI
2 parents f392e41 + c2ee4b5 commit 7ecfa6e

13 files changed

Lines changed: 1343 additions & 705 deletions

File tree

Lines changed: 60 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,60 @@
1+
name: Desktop pack smoke test
2+
3+
on:
4+
push:
5+
tags:
6+
- 'v*'
7+
workflow_dispatch:
8+
9+
permissions:
10+
contents: read
11+
12+
jobs:
13+
smoke-test:
14+
name: Pack and verify binaries (${{ matrix.platform }}-${{ matrix.arch }})
15+
runs-on: ${{ matrix.os }}
16+
strategy:
17+
fail-fast: false
18+
matrix:
19+
include:
20+
- os: macos-latest
21+
platform: darwin
22+
arch: arm64
23+
- os: ubuntu-latest
24+
platform: linux
25+
arch: amd64
26+
- os: windows-latest
27+
platform: windows
28+
arch: amd64
29+
30+
defaults:
31+
run:
32+
shell: bash
33+
34+
env:
35+
npm_config_script_shell: bash
36+
EZBIDS_PLATFORM: ${{ matrix.platform }}
37+
EZBIDS_ARCH: ${{ matrix.arch }}
38+
39+
steps:
40+
- name: Checkout
41+
uses: actions/checkout@v4
42+
with:
43+
submodules: recursive
44+
45+
- name: Setup Node.js
46+
uses: actions/setup-node@v4
47+
with:
48+
node-version: '20'
49+
cache: npm
50+
51+
- name: Install dependencies
52+
run: npm ci
53+
54+
- name: Fetch binaries
55+
run: ./fetch-binaries.sh ${{ matrix.platform }} ${{ matrix.arch }}
56+
env:
57+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
58+
59+
- name: Pack test app and smoke test binaries
60+
run: npm run electron:pack-test && npm run electron:smoke-test

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -115,7 +115,7 @@ Electron build and packaging logic is split between root workspace scripts (`pac
115115
- **`npm run fetch-binaries:macos`** -> `./fetch-binaries.sh darwin arm64`
116116
- **`npm run fetch-binaries:linux`** -> `./fetch-binaries.sh linux amd64`
117117
- **`npm run fetch-binaries:windows`** -> `./fetch-binaries.sh windows amd64`
118-
- **`npm run electron:pack-test`** -> fetch binaries, run Electron build, then `electron-builder --dir` (unsigned/unpacked app output for testing packaging contents)
118+
- **`npm run electron:pack-test`** -> run Electron build, then `electron-builder --dir` (unsigned/unpacked app output for testing packaging contents; run a `fetch-binaries:*` script first if `handler/bin` is missing)
119119
- **`npm run electron:pack`** -> full build + `electron-builder` distributables (DMG/EXE/AppImage/DEB depending on platform/target)
120120

121121
Note: packaging/signing keys (for example Apple certificate/API key variables) are only needed for signed release workflows, not for local desktop development.

electron/build/afterSign.js

Lines changed: 0 additions & 103 deletions
This file was deleted.

electron/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
"build:electron-main": "esbuild main.ts --bundle --platform=node --format=cjs --target=es2020 --outfile=dist/main.cjs --external:electron --external:electron-store --external:ts-node-dev",
1616
"build:electron-preload": "mkdir -p dist && esbuild preload/preload.ts --bundle --platform=node --format=cjs --target=es6 --outfile=preload/preload.js --external:electron --external:electron-store --external:ts-node-dev && cp preload/preload.js dist/preload.js",
1717
"build:electron": "rm -rf dist && npm run build:electron-api && npm run build:electron-handler && npm run build:electron-handler-scripts && npm run build:electron-python && npm run build:electron-templates && npm run build:electron-bids-spec && npm run build:electron-frontend && npm run build:electron-main && npm run build:electron-preload",
18-
"app:dir": "CSC_IDENTITY_AUTO_DISCOVERY=false env -u APPLE_API_KEY -u APPLE_API_KEY_ID -u APPLE_API_ISSUER electron-builder --dir",
18+
"app:dir": "CSC_IDENTITY_AUTO_DISCOVERY=false env -u APPLE_API_KEY -u APPLE_API_KEY_ID -u APPLE_API_ISSUER electron-builder --dir -c.mac.identity=null",
1919
"app:dist": "electron-builder",
2020
"app:build-dist": "npm run build:electron && npm run app:dist"
2121
},

handler/preprocess.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ async function runDcm2niix(itemPath: string): Promise<{ status: number; stderr:
8383
/** Run dcm2niix4pet for one path; appends to pet2bids.done on success. Uses shipped Python interpreter. */
8484
async function runDcm2niix4Pet(itemPath: string): Promise<{ status: number; stderr: string }> {
8585
log(`----------------------- dcm2niix4pet: ${itemPath} ------------------------`);
86-
const r = await runPython(['-m', 'dcm2niix4pet', '--silent', itemPath], {
86+
const r = await runPython(['-m', 'pypet2bids.dcm2niix4pet', '--silent', itemPath], {
8787
cwd: resolvedRoot,
8888
timeout: CMD_TIMEOUT_MS,
8989
reject: true,
@@ -97,7 +97,7 @@ async function runDcm2niix4Pet(itemPath: string): Promise<{ status: number; stde
9797
/** Run ecatpet2bids for one path; appends to pet2bids.done on success. Uses shipped Python interpreter. */
9898
async function runEcatPet2Bids(itemPath: string): Promise<{ status: number; stderr: string }> {
9999
log(`----------------------- ecatpet2bids: ${itemPath} ------------------------`);
100-
const r = await runPython(['-m', 'ecatpet2bids', itemPath, '--convert'], {
100+
const r = await runPython(['-m', 'pypet2bids.ecat_cli', itemPath, '--convert'], {
101101
cwd: resolvedRoot,
102102
timeout: CMD_TIMEOUT_MS,
103103
});

package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,8 @@
2323
"ui:dev": "npm run dev -w ui",
2424
"ui:build": "npm run build -w ui",
2525
"electron:start-dev": "npm run start-dev -w ezbids-electron",
26-
"electron:pack-test": "npm run fetch-binaries && npm run build:electron -w ezbids-electron && npm run app:dir -w ezbids-electron",
26+
"electron:pack-test": "npm run build:electron -w ezbids-electron && npm run app:dir -w ezbids-electron",
27+
"electron:smoke-test": "./test/smoke-test-packaged-binaries.sh",
2728
"electron:pack": "npm run app:build-dist -w ezbids-electron",
2829
"fetch-binaries:macos": "./fetch-binaries.sh darwin arm64",
2930
"fetch-binaries:linux": "./fetch-binaries.sh linux amd64",

0 commit comments

Comments
 (0)