dAppServer / wails-build-action

GitHub action to build Wails.io
European Union Public License 1.2
38 stars 34 forks source link

Action fails with wails 2.3.1 on MacOS due to ditto error #11

Open gmlewis opened 1 year ago

gmlewis commented 1 year ago

When running this action on GitHub with the darwin/universal platform and wails version 2.3.1, the run fails on the ditto step with the following error:

Run wails build --platform darwin/universal -webview2 download -o wailsTest
Wails CLI v2.3.1

# Build Options

Platform(s)        | darwin/universal                                     
Compiler           | /Users/runner/hostedtoolcache/go/1.19.4/x64/bin/go   
Skip Bindings      | false                                                
Build Mode         | production                                           
Frontend Directory | /Users/runner/work/cohort-wails/cohort-wails/frontend
Obfuscated         | false                                                
Skip Frontend      | false                                                
Compress           | false                                                
Package            | true                                                 
Clean Bin Dir      | false                                                
LDFlags            |                                                      
Tags               | []                                                   
Race Detector      | false                                                
Output File        | wailsTest                                            

# Building target: darwin/universal

  • Generating bindings: Done.
  • Installing frontend dependencies: Done.
  • Compiling frontend: Done.
  • Compiling application: Done.
  • Packaging application: Done.
Built '/Users/runner/work/cohort-wails/cohort-wails/build/bin/cohort-wails.app/Contents/MacOS/cohort-wails' in 3m25.443s.

 ♥   If Wails is useful to you or your company, please consider sponsoring the project:
https://github.com/sponsors/leaanthony
Run chmod +x build/bin/*/Contents/MacOS/*
  chmod +x build/bin/*/Contents/MacOS/*
  shell: /bin/bash --noprofile --norc -e -o pipefail {0}
Run ditto -c -k ./build/bin/wailsTest.app ./build/bin/wailsTest.app.zip
  ditto -c -k ./build/bin/wailsTest.app ./build/bin/wailsTest.app.zip
  shell: /bin/bash --noprofile --norc -e -o pipefail {0}
ditto: Cannot get the real path for source './build/bin/wailsTest.app'
Error: Process completed with exit code 1.
Snider commented 1 year ago

Hiya,

We found a bug in wails for macOS builds with a different name.

image

https://github.com/dAppServer/wails-build-action/actions/runs/3885309312/jobs/6629024935

You can "fix" this using the same 'build-name' as defined in the wails app settings; linux and windows honour this so its a bug for @leaanthony

macos:
    runs-on: macos-latest
    steps:
      # Checkout code
      - uses: actions/checkout@v3
        with:
          submodules: recursive
      - uses: dAppServer/wails-build-action@v2
        with:
          build-name: cohort-wails
          build-platform: darwin/universal
          wails-build-webview2: "embed"
          wails-version: "v2.3.1"
          go-version: ^1.18
          sign: "false"
leaanthony commented 1 year ago

Interesting! Please open a ticket on the Wails repo 🙏

Snider commented 1 year ago

Interesting! Please open a ticket on the Wails repo 🙏

https://github.com/wailsapp/wails/issues/2290 :) 🙏

Snider commented 1 year ago

Just to update people interested in this @gwynforthewyn is working on the fix atm, once Wails publishes a version with her fix, this issue will be resolved by increasing the wails version.

Cystemzz commented 11 months ago

Any updates on this?

phuclh commented 10 months ago

Any updates on this, I got this error when building macOS

ditto: Can't archive multiple sources
Usage: ditto [ <options> ] src [ ... src ] dst
Error: Process completed with exit code 1.
phuclh commented 10 months ago

Any updates on this, I got this error when building macOS

ditto: Can't archive multiple sources
Usage: ditto [ <options> ] src [ ... src ] dst
Error: Process completed with exit code 1.

Looks like the space in file name caused this error, but when I tried to remove the space, then got another error

ditto: Cannot get the real path for source './build/bin/App.app'

gwynforthewyn commented 10 months ago

Huh; I thought I had fixed this long ago. I can try dusting off my recollections of wails : )

phuclh commented 10 months ago

Huh; I thought I had fixed this long ago. I can try dusting off my recollections of wails : )

Is it possible for you to take a look at it one more time?

txbrown commented 9 months ago

Any updates on this, I got this error when building macOS

ditto: Can't archive multiple sources
Usage: ditto [ <options> ] src [ ... src ] dst
Error: Process completed with exit code 1.

Just bumping this issue as I am also facing this issue at the moment.

txbrown commented 9 months ago

It seems this issue happens whenever the app name has a space. My app is named "MIDI Scout" and renaming to "MIDIScout" fixed the issue.

pmabres commented 8 months ago

I would recommend to just copy this action and include it into your own repo and apply some fixes yourself. If you are working with a monorepo for example, you'll see that this fails when you have a custom path for your app working directory:

    - name: Build .app zip file
      if: runner.os == 'macOS'
      working-directory: ${{ inputs.app-working-directory }}
      shell: bash
      run: |
        ditto -c -k ${{ inputs.app-working-directory }}/build/bin/${{inputs.build-name}}.app ${{ inputs.app-working-directory }}/build/bin/${{inputs.build-name}}.app.zip

This is due to the fact that working-directory: ${{ inputs.app-working-directory }} is being used whilst also ditto tries to compress the file using app-working-directory as well.

This issue is seen across many different places: name: Building Installer name: Notarising Installer and zip

and also the last few release steps are missing that as well:

# Upload build assets
    - uses: actions/upload-artifact@v3
      if: inputs.package == 'true'
      with:
        name: Wails Build ${{runner.os}} ${{inputs.build-name}}
        path: |
          */bin/
          *\bin\*
    - name: Release
      uses: softprops/action-gh-release@v1
      if: inputs.package == 'true' && startsWith(github.ref, 'refs/tags/')
      with:
        files: |
          */bin/*

should have ${{ inputs.app-working-directory }} embedded in the path filter of each action

jordanamr commented 1 month ago

Still unsolved.