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

Handle universal and aarch64 targets

Open andr-ec opened this issue 3 years ago • 0 comments

I can currently build for aarch64 targets by using a self-hosted action runner on an apple silicone mac. The problem is that all the paths aren't automatically recognized:

2022-03-17T18:01:22.2682550Z    Finished 2 bundles at:
2022-03-17T18:01:22.2683610Z         /Users/user/actions-runner/_work/project/project/target/release/bundle/macos/Project.app
2022-03-17T18:01:22.2700850Z         /Users/user/actions-runner/_work/project/project/target/release/bundle/dmg/Project_0.1.21_aarch64.dmg
2022-03-17T18:01:22.2701870Z [vite-plugin-tauri]  Tauri build finished.
2022-03-17T18:01:22.3124470Z Expected artifacts paths:
2022-03-17T18:01:22.3225410Z /Users/user/actions-runner/_work/project/project/target/release/bundle/dmg/Project_0.1.21_x64.dmg
2022-03-17T18:01:22.3248440Z /Users/user/actions-runner/_work/project/project/target/release/bundle/macos/Project.app
2022-03-17T18:01:22.3255780Z /Users/user/actions-runner/_work/project/project/target/release/bundle/macos/Project.app.tar.gz
2022-03-17T18:01:22.3258900Z /Users/user/actions-runner/_work/project/project/target/release/bundle/macos/Project.app.tar.gz.sig
2022-03-17T18:01:22.3260130Z Artifacts: /Users/user/actions-runner/_work/project/project/target/release/bundle/macos/Project.app.
2022-03-17T18:01:22.6631630Z Found release with tag 0.1.21.
2022-03-17T18:01:22.6632090Z 
2022-03-17T18:01:22.6665300Z 
2022-03-17T18:01:22.6669470Z 
2022-03-17T18:01:22.6671720Z running tar [
2022-03-17T18:01:22.6672460Z   'czf',
2022-03-17T18:01:22.6673430Z   '/Users/user/actions-runner/_work/project/project/target/release/bundle/macos/Project.app.tar.gz',
2022-03-17T18:01:22.6674240Z   '-C',
2022-03-17T18:01:22.6675050Z   '/Users/user/actions-runner/_work/project/project/target/release/bundle/macos',
2022-03-17T18:01:22.6675810Z   'Project.app'
2022-03-17T18:01:22.6676340Z ]

In this case only Project.app is recognized but Project_0.1.21_aarch64.dmg is ignored because aarch64 doesn't match process.arch used in the code here: https://github.com/tauri-apps/tauri-action/blob/9816b49a0578c5711c6e0c340fedd192414fd8d8/packages/core/index.ts#L248

Similarly I can build universal apps:

     with:
        args: -- --target universal-apple-darwin

But the problem here is that tauri-action doesn't recognize any of the artifacts because they don't match the expected path names

2022-03-17T20:20:45.3165570Z  Finished 2 bundles at:
2022-03-17T20:20:45.3167070Z         /Users/user/actions-runner/_work/myproject/myproject/target/universal-apple-darwin/release/bundle/macos/Project.app
2022-03-17T20:20:45.3168430Z         /Users/user/actions-runner/_work/myproject/myproject/target/universal-apple-darwin/release/bundle/dmg/Project_0.1.21_universal.dmg
2022-03-17T20:20:45.3189960Z [vite-plugin-tauri]  Tauri build finished.
2022-03-17T20:20:45.3616230Z Expected artifacts paths:
2022-03-17T20:20:45.3617800Z /Users/user/actions-runner/_work/myproject/myproject/target/release/bundle/dmg/Project_0.1.21_x64.dmg
2022-03-17T20:20:45.3619020Z /Users/user/actions-runner/_work/myproject/myproject/target/release/bundle/macos/Project.app
2022-03-17T20:20:45.3620360Z /Users/user/actions-runner/_work/myproject/myproject/target/release/bundle/macos/Project.app.tar.gz
2022-03-17T20:20:45.3621590Z /Users/user/actions-runner/_work/myproject/myproject/target/release/bundle/macos/Project.app.tar.gz.sig
2022-03-17T20:20:45.3657480Z [error]No artifacts were found.

specifically /target/universal-apple-darwin/release/bundle/macos/ doesn't match /target/release/bundle/macos/

Possible solutions:

  • add an environment variable/parameter for arch and then fall back on process.arch if not defined and add universal-apple-darwin, x86_64-apple-darwin, aarch64-apple-darwin as a possible path to look for artifacts.
  • add environment variables/parameters for the full path of each of the artifacts

andr-ec avatar Mar 17 '22 20:03 andr-ec