From c4af181dd7df75d18a0c8cc006751cae336e87e5 Mon Sep 17 00:00:00 2001 From: LucaCappelletti94 Date: Mon, 12 Oct 2026 16:28:59 +0200 Subject: [PATCH] Sign the tauri example for macOS pushes and build it in CI --- .github/workflows/ci.yml | 15 +++++++++++++++ examples/tauri/.gitignore | 1 + examples/tauri/entitlements.plist | 8 ++++++++ examples/tauri/tauri.conf.json | 6 +++++- 4 files changed, 29 insertions(+), 1 deletion(-) create mode 100644 examples/tauri/entitlements.plist diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 0db7898..1bda9a5 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -632,3 +632,18 @@ jobs: nm -gU "$binary" | grep -q ___pushups_background_handler || { echo "no background handler in $binary"; exit 1; } done done + # The Tauri build needs its CLI, and CI has no signing identity, so the app comes out unsigned. + - name: Build the Tauri app, unsigned, and check the handler and the aps-environment entitlement + run: | + cargo install tauri-cli --locked --version 2.12.1 + (cd examples/tauri && cargo tauri build --debug --bundles app) + app=$(find examples/tauri/target/debug/bundle/macos -maxdepth 1 -name "*.app" | head -n1) + binary="$app/Contents/MacOS/pushups-tauri-example" + nm -gU "$binary" | grep -q ___pushups_background_handler || { echo "no background handler in $binary"; exit 1; } + entitlements=$(codesign -d --entitlements - "$binary" 2>/dev/null || true) + if [ -n "$entitlements" ]; then + echo "$entitlements" | grep -q "com.apple.developer.aps-environment" || { echo "no aps-environment in the Tauri app entitlements"; exit 1; } + else + # An unsigned build applies no entitlements, so check the file the signed build applies. + grep -q "com.apple.developer.aps-environment" examples/tauri/entitlements.plist || { echo "no aps-environment in examples/tauri/entitlements.plist"; exit 1; } + fi diff --git a/examples/tauri/.gitignore b/examples/tauri/.gitignore index d57a05f..af8350e 100644 --- a/examples/tauri/.gitignore +++ b/examples/tauri/.gitignore @@ -1,3 +1,4 @@ /target /gen /google-services.json +/embedded.provisionprofile diff --git a/examples/tauri/entitlements.plist b/examples/tauri/entitlements.plist new file mode 100644 index 0000000..1da788e --- /dev/null +++ b/examples/tauri/entitlements.plist @@ -0,0 +1,8 @@ + + + + + com.apple.developer.aps-environment + development + + diff --git a/examples/tauri/tauri.conf.json b/examples/tauri/tauri.conf.json index 73f16be..e6804d1 100644 --- a/examples/tauri/tauri.conf.json +++ b/examples/tauri/tauri.conf.json @@ -20,6 +20,10 @@ "../../assets/brand/png/icon-macos-128.png", "../../assets/brand/png/icon-macos-32.png", "../../assets/brand/icon-macos.ico" - ] + ], + "macOS": { + "entitlements": "entitlements.plist", + "hardenedRuntime": false + } } }