mirror of
https://github.com/anomalyco/hex.git
synced 2026-12-03 19:58:24 +08:00
Release: stop expecting libmoonshine in Hex.app; a failed macOS signing no longer blocks dev publishing (#496)
#424 removed Moonshine (and #430 Smart Turn's onnxruntime), but sign-macos.sh still required libmoonshine.dylib, so every Release since 0.0.0-dev-249 failed at sign-macos and nothing published. The bundle's code allowlist now requires only hex, scrawl-helper, and the microphone driver, and accepts libonnxruntime only if a build still bundles it. On the dev channel, publish no longer waits on macOS: when signing or verification fails, Linux and Windows still publish (only a verified macOS build is ever included), and the run still fails visibly. Stable still requires every platform.
This commit is contained in:
@@ -48,11 +48,16 @@ check_layout() { # <file> <magic numbers in hex>...
|
||||
check_layout "$background" 4d4d002a 49492a00
|
||||
check_layout "$finder" 0000000142756431
|
||||
|
||||
# Every Mach-O in the bundle must be one this script signs.
|
||||
expected=$(printf '%s\n' Contents/MacOS/hex Contents/MacOS/scrawl-helper \
|
||||
Contents/Library/HexMicrophone.driver/Contents/MacOS/HexMicrophoneDriver \
|
||||
Contents/Frameworks/libmoonshine.dylib Contents/Frameworks/libonnxruntime.1.23.2.dylib | LC_ALL=C sort)
|
||||
# Every Mach-O in the bundle must be one this script signs: these always,
|
||||
# and libonnxruntime only while a build still bundles it.
|
||||
required=$(printf '%s\n' Contents/MacOS/hex Contents/MacOS/scrawl-helper \
|
||||
Contents/Library/HexMicrophone.driver/Contents/MacOS/HexMicrophoneDriver | LC_ALL=C sort)
|
||||
optional=Contents/Frameworks/libonnxruntime.1.23.2.dylib
|
||||
found=$(cd "$app" && find . -type f -exec sh -c 'file -b "$1" | grep -q Mach-O && printf "%s\n" "${1#./}"' _ {} \; | LC_ALL=C sort)
|
||||
expected=$required
|
||||
if printf '%s\n' "$found" | grep -qxF "$optional"; then
|
||||
expected=$(printf '%s\n%s\n' "$required" "$optional" | LC_ALL=C sort)
|
||||
fi
|
||||
[ "$found" = "$expected" ] || die "Unexpected code in Hex.app: $(diff <(echo "$expected") <(echo "$found") | grep '^[<>]' | tr '\n' ' ')"
|
||||
|
||||
sign() {
|
||||
@@ -62,8 +67,7 @@ notarize() {
|
||||
xcrun notarytool submit "$1" --key "$HEX_NOTARY_KEY" --key-id "$HEX_NOTARY_KEY_ID" --issuer "$HEX_NOTARY_ISSUER" --wait --timeout 45m
|
||||
}
|
||||
|
||||
sign "$app/Contents/Frameworks/libonnxruntime.1.23.2.dylib"
|
||||
sign "$app/Contents/Frameworks/libmoonshine.dylib"
|
||||
if [ -f "$app/$optional" ]; then sign "$app/$optional"; fi
|
||||
sign "$app/Contents/Library/HexMicrophone.driver"
|
||||
# The capture experiment's movie decoder; Hex runs it, so it needs no entitlement.
|
||||
sign --identifier anomaly.hex.scrawl-helper "$app/Contents/MacOS/scrawl-helper"
|
||||
|
||||
@@ -426,8 +426,10 @@ jobs:
|
||||
if: >-
|
||||
${{ !cancelled() && needs.plan.outputs.channel != 'check'
|
||||
&& needs.build.result == 'success' && needs.installers.result == 'success'
|
||||
&& needs.sign-macos.result == 'success' && needs.sign-windows.result == 'success'
|
||||
&& (needs.verify-macos.result == 'success' || needs.sign-macos.outputs.signed != 'true')
|
||||
&& needs.sign-windows.result == 'success'
|
||||
&& (needs.plan.outputs.channel == 'dev'
|
||||
|| (needs.sign-macos.result == 'success'
|
||||
&& (needs.verify-macos.result == 'success' || needs.sign-macos.outputs.signed != 'true')))
|
||||
&& (needs.sign-windows-installers.result == 'success' || needs.sign-windows.outputs.signed != 'true') }}
|
||||
runs-on: ubuntu-24.04
|
||||
environment: release
|
||||
@@ -446,7 +448,10 @@ jobs:
|
||||
- name: Download
|
||||
uses: ./.github/release/download
|
||||
with:
|
||||
pattern: "{build-linux-*,sign-macos,sign-windows,sign-windows-installers}"
|
||||
# A dev release goes out without macOS when its signing or
|
||||
# verification fails (the run still fails, so it is seen); only a
|
||||
# verified macOS build is ever published.
|
||||
pattern: ${{ (needs.sign-macos.result == 'success' && needs.verify-macos.result == 'success') && '{build-linux-*,sign-macos,sign-windows,sign-windows-installers}' || '{build-linux-*,sign-windows,sign-windows-installers}' }}
|
||||
digests: >-
|
||||
build-linux-x86_64=${{ needs.build.outputs.linux-x64-digest }}
|
||||
build-linux-aarch64=${{ needs.build.outputs.linux-arm64-digest }}
|
||||
|
||||
Reference in New Issue
Block a user