1
0
forked from boos/BoosAPI

fix: harden mac release architecture verification

This commit is contained in:
Cita
2026-03-19 20:49:21 +08:00
parent 36e9a85664
commit 6c3a09da86
+1 -27
View File
@@ -234,33 +234,7 @@ jobs:
env: env:
expectedMacArch: ${{ matrix.expectedMacArch }} expectedMacArch: ${{ matrix.expectedMacArch }}
run: | run: |
set -euo pipefail node scripts/desktop/verifyMacArchitecture.mjs --release-dir release --expected-arch "$expectedMacArch"
mapfile -t app_binaries < <(find release -type f -path '*/Metapi.app/Contents/MacOS/Metapi')
if [ "${#app_binaries[@]}" -eq 0 ]; then
echo "No packaged macOS app binary found under release/"
exit 1
fi
for binary in "${app_binaries[@]}"; do
archs="$(lipo -archs "$binary" 2>/dev/null | xargs)"
echo "$binary => ${archs:-unknown}"
if [ -z "${archs}" ]; then
echo "Unable to detect architecture via lipo"
exit 1
fi
if [ "${expectedMacArch}" = "x64" ]; then
[ "${archs}" = "x86_64" ] || {
echo "Expected x86_64-only binary but got: ${archs}"
exit 1
}
else
[ "${archs}" = "arm64" ] || {
echo "Expected arm64-only binary but got: ${archs}"
exit 1
}
fi
done
- name: Upload desktop package - name: Upload desktop package
uses: actions/upload-artifact@v7 uses: actions/upload-artifact@v7