macosgithub-actionscode-signingtauri

Tauri/Angular App for MacOS - After adding Signing, running bash script shuts down whole app


My app basically runs a bash script on a click of a button. That bash script creates some folders and zips in the selected directory.

This is all working quite fine when I run it locally or after building it locally.

After I tried to distribute my App to another MacBook, it just wouldn't run. So I added signing in my GitHub action, and I managed to run it.

But now on a click of a button that runs the script, the whole app shuts down.

I assumed it was connected to some privileges problems as I don't have the Entitlements file.

I was trying to add it by linking it in my tauri.conf.json file like this:

..."macOS": {
"entitlements": "resources/entitlements.mac.plist"

}...

Here is my Github actions file as well:

strategy:
  fail-fast: false
  matrix:
    platform: [macos-latest]

runs-on: ${{ matrix.platform }}
steps:
  - name: Checkout repository
    uses: actions/checkout@v4
  - name: setup NodeJS
    uses: actions/setup-node@v4
    with:
      cache: yarn
      node-version-file: '.nvmrc'
  - name: install Rust stable
    uses: actions-rs/toolchain@v1
    with:
      toolchain: stable
  - name: install webkit2gtk (ubuntu only)
    if: matrix.platform == 'ubuntu-latest'
    run: |
      sudo apt-get update
      sudo apt-get install -y webkit2gtk-4.0
  - name: install app dependencies and build it
    run: yarn && yarn build
  - uses: tauri-apps/tauri-action@v0
    env:
      GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
      ENABLE_CODE_SIGNING: ${{ secrets.APPLE_CERTIFICATE }}
      APPLE_CERTIFICATE: ${{ secrets.APPLE_CERTIFICATE }}
      APPLE_CERTIFICATE_PASSWORD:
        ${{ secrets.APPLE_CERTIFICATE_PASSWORD }}
      APPLE_SIGNING_IDENTITY:
        ${{ secrets.APPLE_SIGNING_IDENTITY }}
      APPLE_ID: ${{ secrets.APPLE_ID }}
      APPLE_PASSWORD: ${{ secrets.APPLE_PASSWORD }}
      APPLE_TEAM_ID: ${{ secrets.APPLE_TEAM_ID }}

    with:
      tagName: ${{ github.ref_name }}
      releaseName: "Synergy X ${{ github.ref_name }}"
      releaseBody: See the assets to download this version and install..
      releaseDraft: true
      prerelease: false`

But then my signing started to break for some reason.

Bundling Synergy X.app (/Users/runner/work/synergy-x/synergy-x/src-tauri/target/release/bundle/macos/Synergy X.app)
 Signing with identity "***"
    Info setup keychain from environment variables...
    Info Signing app bundle...
 Signing /Users/runner/work/synergy-x/synergy-x/src-tauri/target/release/bundle/macos/Synergy X.app/Contents/MacOS/Synergy X
    Info using entitlements file at resources/entitlements.mac.plist
   Error failed to bundle project: failed to sign app

error Command failed with exit code 1. info Visit ``https://yarnpkg.com/en/docs/cli/run`` for documentation about this command. Error: Command failed with exit code 1: yarn tauri build

This is my entitlements.mac.plist file.

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
    <key>com.apple.security.app-sandbox</key>
    <true/>
    <key>com.apple.security.files.user-selected.read-write</key>
    <true/>
    <key>com.apple.security.files.downloads.read-write</key>
    <true/>
</dict>
</plist>

Am I on the right track and does anyone have an example of how to sign with and setup entitlements privilege file?

Thanks


Solution

  • It was a 2 part problem.

    xml was not in right format..

    And I had creation of log file in the code, which was causing the error.

    So no log files in production.