Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
43 changes: 41 additions & 2 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -43,8 +43,10 @@ jobs:
build_script: desktop:build:win
eb_cache: C:/Users/runneradmin/AppData/Local/Temp/eb-cache-${{ github.run_id }}
eb_tmp: C:/Users/runneradmin/AppData/Local/Temp/eb-tmp-${{ github.run_id }}
# - os: macos-latest
# build_script: desktop:build:mac
- os: macos-latest
build_script: desktop:build:mac
eb_cache: ${{ github.workspace }}/.tmp/electron-builder-cache-${{ github.run_id }}-macos-latest
eb_tmp: ${{ github.workspace }}/.tmp/electron-builder-tmp-${{ github.run_id }}-macos-latest
- os: ubuntu-latest
build_script: desktop:build:linux
eb_cache: ${{ github.workspace }}/.tmp/electron-builder-cache-${{ github.run_id }}-ubuntu-latest
Expand Down Expand Up @@ -122,6 +124,24 @@ jobs:
echo "ELECTRON_BUILDER_TMPDIR=$TMP" >> "$GITHUB_ENV"
echo "ELECTRON_BUILDER_TMP_DIR=$TMP" >> "$GITHUB_ENV"

- name: Ensure electron-builder cache dirs (macOS)
if: matrix.os == 'macos-latest'
shell: bash
run: |
CACHE="${ELECTRON_BUILDER_CACHE:-/tmp/electron-builder-cache-${GITHUB_RUN_ID}-macos-latest}"
TMP="${ELECTRON_BUILDER_TMPDIR:-/tmp/electron-builder-tmp-${GITHUB_RUN_ID}-macos-latest}"
if ! mkdir -p "$CACHE" "$TMP" 2>/dev/null; then
CACHE="/tmp/electron-builder-cache-${GITHUB_RUN_ID}-macos-latest"
TMP="/tmp/electron-builder-tmp-${GITHUB_RUN_ID}-macos-latest"
mkdir -p "$CACHE" "$TMP"
fi
chmod -R 777 "$CACHE" "$TMP"
echo "ELECTRON_BUILDER_CACHE=$CACHE" >> "$GITHUB_ENV"
echo "ELECTRON_BUILDER_TMPDIR=$TMP" >> "$GITHUB_ENV"
echo "ELECTRON_BUILDER_TMP_DIR=$TMP" >> "$GITHUB_ENV"
echo "runner: $(uname -a)"
sw_vers

- name: Install system dependencies (Linux)
if: matrix.os == 'ubuntu-latest'
run: |
Expand All @@ -148,6 +168,25 @@ jobs:
- name: Build desktop application
run: pnpm ${{ matrix.build_script }}

- name: Verify macOS artifacts
if: matrix.os == 'macos-latest'
shell: bash
run: |
ls -lh packages/desktop/out
dmg="$(find packages/desktop/out -maxdepth 1 -type f -name '*.dmg' | head -n 1)"
zip_archive="$(find packages/desktop/out -maxdepth 1 -type f -name '*.zip' | head -n 1)"
app="$(find packages/desktop/out -maxdepth 2 -type d -name '*.app' | head -n 1)"
if [ -z "$dmg" ] || [ -z "$zip_archive" ] || [ -z "$app" ]; then
echo "Missing macOS artifacts (dmg/zip/app)." >&2
exit 1
fi
if [ ! -s "$dmg" ] || [ ! -s "$zip_archive" ]; then
echo "Empty macOS artifacts (dmg/zip)." >&2
exit 1
fi
hdiutil verify "$dmg"
du -sh "$dmg" "$zip_archive" "$app"

- name: Upload artifacts to workflow
uses: actions/upload-artifact@v4
with:
Expand Down
5 changes: 4 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,9 @@
"electron",
"esbuild",
"vue-demi"
]
],
"patchedDependencies": {
"dmg-builder@26.0.12": "patches/dmg-builder.patch"
}
}
}
Binary file modified packages/desktop/build/dmg-background.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
23 changes: 12 additions & 11 deletions packages/desktop/electron-builder.yml
Original file line number Diff line number Diff line change
Expand Up @@ -68,14 +68,14 @@ mac:
- arm64
entitlementsInherit: build/entitlements.mac.plist
extendInfo:
- NSCameraUsageDescription: 'ExamAware needs access to your camera for exam monitoring and verification purposes.'
- NSMicrophoneUsageDescription: 'ExamAware needs access to your microphone for exam monitoring and audio recording.'
- NSDocumentsFolderUsageDescription: 'ExamAware needs access to your Documents folder to save and load exam files.'
- NSDownloadsFolderUsageDescription: 'ExamAware needs access to your Downloads folder to import exam materials.'
- CFBundleURLTypes:
- CFBundleURLName: 'ExamAware Document'
CFBundleURLSchemes:
- 'examaware'
NSCameraUsageDescription: 'ExamAware needs access to your camera for exam monitoring and verification purposes.'
NSMicrophoneUsageDescription: 'ExamAware needs access to your microphone for exam monitoring and audio recording.'
NSDocumentsFolderUsageDescription: 'ExamAware needs access to your Documents folder to save and load exam files.'
NSDownloadsFolderUsageDescription: 'ExamAware needs access to your Downloads folder to import exam materials.'
CFBundleURLTypes:
- CFBundleURLName: 'ExamAware Document'
CFBundleURLSchemes:
- 'examaware'
notarize: false
hardenedRuntime: true
gatekeeperAssess: false
Expand All @@ -87,13 +87,14 @@ dmg:
background: build/dmg-background.png
window:
width: 540
height: 380
# 380 为背景图内容高度,+32 是 macOS 窗口标题栏高度,保证 DMG 内容区与 540x380 背景图一致
height: 412
contents:
- x: 130
y: 220
y: 190
type: file
- x: 410
y: 220
y: 190
type: link
path: /Applications
linux:
Expand Down
11 changes: 11 additions & 0 deletions patches/dmg-builder.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
--- a/vendor/dmgbuild/core.py
+++ b/vendor/dmgbuild/core.py
@@ -255,7 +255,7 @@
icvp['backgroundColorBlue'] = float(c.b)
elif background_file:
alias = Alias.for_file(background_file)
- background_bmk = Bookmark.for_file(background_file)
+ # background_bmk = Bookmark.for_file(background_file) # macOS 26.2+ Finder: pBBk breaks DMG background rendering

icvp['backgroundType'] = 2
icvp['backgroundImageAlias'] = biplist.Data(alias.to_bytes())
13 changes: 9 additions & 4 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading