tauri-apps / tauri-action

Build your Web application as a Tauri binary for macOS, Linux and Windows
https://tauri.app
MIT License
939 stars 153 forks source link

App is damaged and can't be opened on macOS when built in a GitHub action #866

Closed errmayank closed 3 months ago

errmayank commented 3 months ago

I haven't tested it on other systems but am i doing something wrong here? I built a basic svelte starter app using tauri action but the app seems to be broken when i try to install it, i'm on arm based mac.

It runs fine if i build it locally and then try to install.

Screenshot 2024-07-25 at 13 11 19

Here's the repro https://github.com/errmayank/test-tauri-app

You can also try downloading it from the assets in the release here https://github.com/errmayank/test-tauri-app/releases/tag/v0.0.1

Here's my info

[✔] Environment
    - OS: Mac OS 14.5.0 X64
    ✔ Xcode Command Line Tools: installed
    ✔ rustc: 1.78.0 (9b00956e5 2024-04-29)
    ✔ cargo: 1.78.0 (54d8815d0 2024-03-26)
    ✔ rustup: 1.27.1 (54dd3d00f 2024-04-24)
    ✔ Rust toolchain: stable-aarch64-apple-darwin (default)
    - node: 20.16.0
    - pnpm: 9.6.0
    - yarn: 1.22.22
    - npm: 10.8.1

[-] Packages
    - tauri [RUST]: 2.0.0-beta.24
    - tauri-build [RUST]: 2.0.0-beta.19
    - wry [RUST]: 0.41.0
    - tao [RUST]: 0.28.1
    - @tauri-apps/api [NPM]: 2.0.0-beta.15
    - @tauri-apps/cli [NPM]: 2.0.0-beta.22

[-] App
    - build-type: bundle
    - CSP: unset
    - frontendDist: ../build
    - devUrl: http://localhost:1420/
    - framework: Svelte
    - bundler: Vite

I also tried using fix-path-env but that didn't help

errmayank commented 3 months ago

Ah, it seems like an apple "security" thing which i'm guessing happened because i didn't sign the application?

For now, i fixed it by running

xattr -c /Applications/test-tauri-app.app
FabianLars commented 3 months ago

yup, that's apple's "fault". You can set "signingIdentity": "-" in tauri.conf.json to ad-hoc (self) sign it which basically makes it behave like it does after you run xattr -c