tauri-action icon indicating copy to clipboard operation
tauri-action copied to clipboard

Error failed to bundle project: error running bundle_dmg.sh

Open TheBlindM opened this issue 1 year ago • 8 comments

action_yaml:

name: "publish"


on:
  push:
   
    tags:
      - 'v*' 

# This is the example from the readme.
# On each push to the `release` branch it will create or update a GitHub release, build your app, and upload the artifacts to the release.

jobs:
  publish-tauri:
    permissions:
      contents: write
    strategy:
      fail-fast: false
      matrix:
        include:
          - platform: "macos-latest" # for Arm based macs (M1 and above).
            args: "--target aarch64-apple-darwin"
#          - platform: "macos-latest" # for Intel based macs.
#            args: "--target x86_64-apple-darwin"
          - platform: "ubuntu-22.04" # for Tauri v1 you could replace this with ubuntu-20.04.
            args: ""
#          - platform: "windows-latest"
#            args: ""

    runs-on: ${{ matrix.platform }}
    steps:
      - uses: actions/checkout@v4

      - name: setup node
        uses: actions/setup-node@v4
        with:
          node-version: lts/*

      - name: install Rust stable
        uses: dtolnay/rust-toolchain@stable
        with:
          # Those targets are only used on macos runners so it's in an `if` to slightly speed up windows and linux builds.
          targets: ${{ matrix.platform == 'macos-latest' && 'aarch64-apple-darwin,x86_64-apple-darwin' || '' }}

      - name: install dependencies (ubuntu only)
        if: matrix.platform == 'ubuntu-22.04' # This must match the platform value defined above.
        run: |
          sudo apt-get update
          sudo apt-get install -y libwebkit2gtk-4.0-dev libwebkit2gtk-4.1-dev libappindicator3-dev librsvg2-dev patchelf
        # webkitgtk 4.0 is for Tauri v1 - webkitgtk 4.1 is for Tauri v2.
        # You can remove the one that doesn't apply to your app to speed up the workflow a bit.

      - name: install frontend dependencies
        run: yarn install # change this to npm, pnpm or bun depending on which one you use.

      - uses: tauri-apps/tauri-action@v0
        env:
          GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
          TAURI_PRIVATE_KEY: ${{ secrets.TAURI_PRIVATE_KEY }}
          TAURI_KEY_PASSWORD: ${{ secrets.TAURI_KEY_PASSWORD }}

        with:
          tagName: app-v__VERSION__ # the action automatically replaces \_\_VERSION\_\_ with the app version.
          releaseName: "App v__VERSION__"
          releaseBody: "See the assets to download this version and install."
          releaseDraft: true
          prerelease: false
          args: ${{ matrix.args }}


tauri.conf.json

{
  "$schema": "../node_modules/@tauri-apps/cli/schema.json",
  "build": {
    "beforeBuildCommand": "npm run build",
    "beforeDevCommand": "npm run dev",
    "devPath": "http://localhost:3201",
    "distDir": "../dist"
  },
  "package": {
    "productName": "T-Shell",
    "version": "1.0.0"
  },
  "tauri": {
    "allowlist": {
      "all": false,
      "shell": {
        "all": true,
        "open": true
      },
      "dialog": {
        "open": true
      },
      "clipboard": {
        "all": true,
        "writeText": true,
        "readText": true
      },
      "fs": {
        "all": true
      },
      "window": {
        "all": true
      }
    },
    "bundle": {
      "active": true,
      "category": "DeveloperTool",
      "copyright": "",
      "deb": {
        "depends": []
      },
      "externalBin": [],
      "icon": [
				"icons/shell32x32.png",
				"icons/shell128x128.png",
				"icons/shell-icon.icns",
				"icons/shell-icon.ico"
      ],
      "identifier": "com.theBlind.tShell-Plus",
      "longDescription": "T-Shell-Plus",
      "macOS": {
        "entitlements": null,
        "exceptionDomain": "",
        "frameworks": [],
        "providerShortName": null,
        "signingIdentity": null
      },
      "resources": [
        "./script"
      ],
      "shortDescription": "",
      "targets": "all",
      "windows": {
        "certificateThumbprint": null,
        "digestAlgorithm": "sha256",
        "timestampUrl": ""
      }
    },
    "security": {
      "csp": null
    },
		"updater": {
			"active": true,
			"endpoints": [
				"........................"
			],
			"dialog": false,
			"pubkey": "......................."
		},
    "windows": [
      {
        "fullscreen": false,
        "height": 700,
        "resizable": true,
        "title": "T-Shell",
        "width": 1200,
        "minWidth": 1000,
        "minHeight": 700,
        "decorations": false,
        "transparent": true,
        "center": true
      }
    ]
  }
}

err_msg:

warning: `app` (bin "app") generated 4 warnings (run `cargo fix --bin "app"` to apply 3 suggestions)
    Finished `release` profile [optimized] target(s) in 5m 32s
    Bundling T-Shell.app (/Users/runner/work/t-shell-plus-r/t-shell-plus-r/src-tauri/target/aarch64-apple-darwin/release/bundle/macos/T-Shell.app)
    Bundling T-Shell_1.0.0_aarch64.dmg (/Users/runner/work/t-shell-plus-r/t-shell-plus-r/src-tauri/target/aarch64-apple-darwin/release/bundle/dmg/T-Shell_1.0.0_aarch64.dmg)
     Running bundle_dmg.sh
       Error failed to bundle project: error running bundle_dmg.sh
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 --target aarch64-apple-darwin

Not enabling the updater is normal

TheBlindM avatar May 25 '24 09:05 TheBlindM

Can you add --verbose to the tauri-actions args config and post the new logs you'll get?

FabianLars avatar May 25 '24 13:05 FabianLars

Can you add --verbose to the tauri-actions args config and post the new logs you'll get?

warning: `app` (bin "app") generated 4 warnings (run `cargo fix --bin "app"` to apply 3 suggestions)
    Finished `release` profile [optimized] target(s) in 5m 06s
    Bundling [tauri_bundler::bundle::macos::app] T-Shell.app (/Users/runner/work/t-shell-plus-r/t-shell-plus-r/src-tauri/target/aarch64-apple-darwin/release/bundle/macos/T-Shell.app)
    Bundling [tauri_bundler::bundle::macos::dmg] T-Shell_1.0.0_aarch64.dmg (/Users/runner/work/t-shell-plus-r/t-shell-plus-r/src-tauri/target/aarch64-apple-darwin/release/bundle/dmg/T-Shell_1.0.0_aarch64.dmg)
     Running [tauri_bundler::bundle::macos::dmg] bundle_dmg.sh
     Running [tauri_bundler::bundle::common] Command `/Users/runner/work/t-shell-plus-r/t-shell-plus-r/src-tauri/target/aarch64-apple-darwin/release/bundle/dmg/bundle_dmg.sh  --volname T-Shell --icon T-Shell.app 180 170 --app-drop-link 480 170 --window-size 660 400 --hide-extension T-Shell.app --volicon /Users/runner/work/t-shell-plus-r/t-shell-plus-r/src-tauri/target/aarch64-apple-darwin/release/bundle/dmg/shell-icon.icns --skip-jenkins T-Shell_1.0.0_aarch64.dmg T-Shell.app`
+ WINX=10
+ WINY=60
+ WINW=500
+ WINH=350
+ ICON_SIZE=128
+ TEXT_SIZE=16
+ FORMAT=UDZO
+ ADD_FILE_SOURCES=()
+ ADD_FILE_TARGETS=()
+ IMAGEKEY=
+ HDIUTIL_VERBOSITY=
+ SANDBOX_SAFE=0
+ BLESS=0
+ SKIP_JENKINS=0
+ MAXIMUM_UNMOUNTING_ATTEMPTS=3
+ POSITION_CLAUSE=
+ HIDING_CLAUSE=
+ [[ - = \- ]]
+ case $1 in
+ VOLUME_NAME=T-Shell
+ shift
+ shift
+ case $FORMAT in
+ IMAGEKEY='-imagekey zlib-level=9'
+ [[ - = \- ]]
+ case $1 in
+ POSITION_CLAUSE='set position of item "T-Shell.app" to {180, 170}
		'
+ shift
+ shift
+ shift
+ shift
+ case $FORMAT in
+ IMAGEKEY='-imagekey zlib-level=9'
+ [[ - = \- ]]
+ case $1 in
+ APPLICATION_LINK=480
+ APPLICATION_CLAUSE='set position of item "Applications" to {480, 170}
		'
+ shift
+ shift
+ shift
+ case $FORMAT in
+ IMAGEKEY='-imagekey zlib-level=9'
+ [[ - = \- ]]
+ case $1 in
+ WINW=660
+ WINH=400
+ shift
+ shift
+ shift
+ case $FORMAT in
+ IMAGEKEY='-imagekey zlib-level=9'
+ [[ - = \- ]]
+ case $1 in
+ HIDING_CLAUSE='set the extension hidden of item "T-Shell.app" to true
		'
+ shift
+ shift
+ case $FORMAT in
+ IMAGEKEY='-imagekey zlib-level=9'
+ [[ - = \- ]]
+ case $1 in
+ VOLUME_ICON_FILE=/Users/runner/work/t-shell-plus-r/t-shell-plus-r/src-tauri/target/aarch64-apple-darwin/release/bundle/dmg/shell-icon.icns
+ shift
+ shift
+ case $FORMAT in
+ IMAGEKEY='-imagekey zlib-level=9'
+ [[ - = \- ]]
+ case $1 in
+ SKIP_JENKINS=1
+ shift
+ case $FORMAT in
+ IMAGEKEY='-imagekey zlib-level=9'
+ [[ T = \- ]]
+ [[ -z T-Shell.app ]]
+++ dirname /Users/runner/work/t-shell-plus-r/t-shell-plus-r/src-tauri/target/aarch64-apple-darwin/release/bundle/dmg/bundle_dmg.sh
++ cd /Users/runner/work/t-shell-plus-r/t-shell-plus-r/src-tauri/target/aarch64-apple-darwin/release/bundle/dmg
++ pwd
+ SCRIPT_DIR=/Users/runner/work/t-shell-plus-r/t-shell-plus-r/src-tauri/target/aarch64-apple-darwin/release/bundle/dmg
+ DMG_PATH=T-Shell_1.0.0_aarch64.dmg
++ dirname T-Shell_1.0.0_aarch64.dmg
+ DMG_DIRNAME=.
++ cd .
++ pwd
+ DMG_DIR=/Users/runner/work/t-shell-plus-r/t-shell-plus-r/src-tauri/target/aarch64-apple-darwin/release/bundle/macos
++ basename T-Shell_1.0.0_aarch64.dmg
+ DMG_NAME=T-Shell_1.0.0_aarch64.dmg
+ DMG_TEMP_NAME=/Users/runner/work/t-shell-plus-r/t-shell-plus-r/src-tauri/target/aarch64-apple-darwin/release/bundle/macos/rw.T-Shell_1.0.0_aarch64.dmg
++ cd T-Shell.app
++ pwd
+ SRC_FOLDER=/Users/runner/work/t-shell-plus-r/t-shell-plus-r/src-tauri/target/aarch64-apple-darwin/release/bundle/macos/T-Shell.app
+ [[ .dmg != \.\d\m\g ]]
+ [[ -z T-Shell ]]
+ BREW_INSTALL=0
+ AUX_PATH=/Users/runner/work/t-shell-plus-r/t-shell-plus-r/src-tauri/target/aarch64-apple-darwin/release/bundle/dmg/support
+ '[' 0 -eq 0 ']'
+ test -d /Users/runner/work/t-shell-plus-r/t-shell-plus-r/src-tauri/target/aarch64-apple-darwin/release/bundle/dmg/support
+ [[ -f /Users/runner/work/t-shell-plus-r/t-shell-plus-r/src-tauri/target/aarch64-apple-darwin/release/bundle/macos/T-Shell.app/.DS_Store ]]
+ echo 'Creating disk image...'
Creating disk image...
+ [[ -f /Users/runner/work/t-shell-plus-r/t-shell-plus-r/src-tauri/target/aarch64-apple-darwin/release/bundle/macos/rw.T-Shell_1.0.0_aarch64.dmg ]]
+ CUSTOM_SIZE=
+ [[ -n '' ]]
+ '[' 0 -eq 0 ']'
+ hdiutil create -srcfolder /Users/runner/work/t-shell-plus-r/t-shell-plus-r/src-tauri/target/aarch64-apple-darwin/release/bundle/macos/T-Shell.app -volname T-Shell -fs HFS+ -fsargs '-c c=64,a=16,e=16' -format UDRW /Users/runner/work/t-shell-plus-r/t-shell-plus-r/src-tauri/target/aarch64-apple-darwin/release/bundle/macos/rw.T-Shell_1.0.0_aarch64.dmg
hdiutil: create failed - Resource busy
       Error [tauri_cli_node] failed to bundle project: error running bundle_dmg.sh
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 -v --target aarch64-apple-darwin

TheBlindM avatar May 26 '24 00:05 TheBlindM

Does this happen on every build?

FabianLars avatar May 26 '24 10:05 FabianLars

Happened for me also.

swb-buildarchetype avatar Jun 28 '24 02:06 swb-buildarchetype

@FabianLars I see the same error, can we somehow disable Running bundle_dmg.sh ? https://github.com/PasteBar/PasteBarApp/actions/runs/10017712559/job/27692392306

kurdin avatar Jul 20 '24 05:07 kurdin

@kurdin You can disable bundle_dmg.sh by disabling the .dmg target as a whole. To do that you have to modify the bundle.targets config in tauri.conf.json from "all" to an array of the targets you do want to build, or use the --bundle app cli flag to only build the .app bundle.

FabianLars avatar Jul 23 '24 10:07 FabianLars

@FabianLars Yeah, that would fix the CI issue but instead of --bundle app it should be --bundles app

In case, anyone seen this issue, here is my github action step to build a Tauri App

      - name: Build Tauri App
        uses: tauri-apps/tauri-action@v0
        env:
          GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
        with:
          args: "--target aarch64-apple-darwin --bundles app"

Thank you for all your help @FabianLars 🙏

kurdin avatar Jul 23 '24 14:07 kurdin

bundle_dmg.sh seems to fail locally too, the dmg is created and mounted, then destroyed a minute later

jswhisperer avatar Dec 27 '24 22:12 jswhisperer

In case, anyone seen this issue, here is my github action step to build a Tauri App

There's a special place in heaven for people like you @kurdin

nukeop avatar Aug 05 '25 22:08 nukeop

Since there shouldn't be anything that we can do on the action side i'll close this in favor of https://github.com/tauri-apps/tauri/issues/3055

FabianLars avatar Nov 17 '25 21:11 FabianLars