tauri-apps / tauri-action

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

[Bug] Resulting DMG has incorrect icon positions and window size #740

Open roniemartinez opened 6 months ago

roniemartinez commented 6 months ago

Tested only on v2 beta.

Building for MacOS with code signing and notarization creates a DMG with incorrect icon positions and window size as compared to a one built locally. There are no configuration change between environments.

Local build: image

Workflow build using tauri-action:

FabianLars commented 6 months ago

Hi, are you using an intel or arm mac locally? Which runner do you use in github?

Asking because i just saw this https://github.com/create-dmg/create-dmg/issues/171

roniemartinez commented 6 months ago

I am using the macos-latest runner on Github.

Locally, I am using Intel.

FabianLars commented 6 months ago

hmm, afaik macos-latest still uses intel until next month or so, so it's probably not that. I also found some old-ish releases from my action test repos and see the same issue. I also know that the create-dmg script indeed works differently in CI because it relies on Finder though i can't remember this being a general problem, i could swear it used to work 🤔

venkr commented 5 months ago

I've also just run into the same issue - it looks like running tauri build locally works perfectly (ie: respects DmgConfig) but the tauri-action doesn't do that and seems to result in something that looks like the default .dmg

To confirm platform info:

venkr commented 5 months ago

Some more investigation, this seems to be a well documented issue w/ people noticing it from 2018 through 2023 (https://github.com/create-dmg/create-dmg/issues/72) - where since you can't give create-dmg access to control Finder, it fails on CI.

venkr commented 5 months ago

Turns out this is expected behavior, a skip-jenkins flag is passed to the dmg script in CI

if let Some(value) = env::var_os("CI") {
    if value == "true" {
      bundle_dmg_cmd.arg("--skip-jenkins");
    }
  } 

For us - setting CI: false in the env for this step solved it and it seems to work great!

But be warned it looks like modifying the dmg aesthetics in CI can cause issues, so it's still unclear to us if it's working but flakily or whether its just that this issue has been fixed, eg, in current macOS or newer runners.

roniemartinez commented 5 months ago

I can confirm that adding CI: false fixes the DMG layout.

FabianLars commented 5 months ago

Thanks for the research :) I'd appreciate it if a few more people could test this.

If there are no problems reported I will add it to the docs/examples with a comment to change it to true if build issues are encountered.

jLynx commented 2 months ago

Can confirm this also fixed our problem for adding a background image for the DMG. Note that now macos-latest now uses M1 apple silicon.

Fix: Add CI: false to the env on your build pipeline fixed the issue.

Discord issue: https://discord.com/channels/616186924390023171/1263642177439928441

ayangweb commented 2 weeks ago

@roniemartinez @jLynx Hey 👋, excuse me. This solution does work! But if you do this, is the app running stable? There won't be any potential risks, right?

jLynx commented 2 weeks ago

@ayangweb yes it's stable for us, no users have logged any issues

ayangweb commented 2 weeks ago

@ayangweb yes it's stable for us, no users have logged any issues

Ok, thanks, I decided to use it!