Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add action to create .dmg for osx for new releases #83

Merged
merged 7 commits into from
May 22, 2020
Merged

Add action to create .dmg for osx for new releases #83

merged 7 commits into from
May 22, 2020

Conversation

girardof
Copy link
Contributor

Create a Github action to generate a .dmg file containing a .app
created with cargo bundle.

@ArturKovacs
Copy link
Owner

I'm so excited we're gonna have proper mac support 😀

But let's slow down, I do have some questions:
1, When you open the dmg file, do you see something like this? And if so is the name "Emulsion" and is the logo the Emulsion logo?

2, Let's say that someone has v2.1 installed on their Mac. How do they upgrade when v2.2 comes out? Do they just run the new dmg? And if so is this common knowledge or do you think this should be documented?

GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ needs.create_release.outputs.upload_url }}
asset_path: ${{ format('Emulsion-OSX.dmg', env.INSTALLER_NAME) }}
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think that this is the same as if you just wrote

asset_path: Emulsion-OSX.dmg

@girardof
Copy link
Contributor Author

I'm so excited we're gonna have proper mac support 😀

But let's slow down, I do have some questions:
1, When you open the dmg file, do you see something like this? And if so is the name "Emulsion" and is the logo the Emulsion logo?

2, Let's say that someone has v2.1 installed on their Mac. How do they upgrade when v2.2 comes out? Do they just run the new dmg? And if so is this common knowledge or do you think this should be documented?

  1. For now the .dmg is basic when opening it this is what I get :

Screenshot 2020-05-14 at 22 07 38

I need to drag and drop the Emulsion.app to the Application folder to install it. For having a background and link to the Application folder we might have to use something like this bash script or a solution like this one

  1. For updating usually yes the user have to re run the new .dmg and drag and drop the .app again, this will create a message like this :

Screenshot 2020-05-14 at 22 12 00

I would say it's a rather common knowledge but this is a tech person point of view.

Some software shows a popup with a link to the dmg when a new version is created for example virtual box :
Screenshot 2020-05-14 at 22 17 51

@ArturKovacs
Copy link
Owner

ArturKovacs commented May 14, 2020

Hmmm I don't want to ask too much from you. That's my greatest concern right now 😀 But I want to get this installer thingy right.

If you tell me what are approximately the image dimensions of for example the Firefox dmg, I'll create a background image with those dimensions, and I'd love if you could then put that background and the create-dmg script to for example a ./distribution/macos/ folder and have the workflow create a fancy pants dmg.

Would this be okay for you?

@girardof
Copy link
Contributor Author

I understand and it's not too much to ask don't worry. I'm not sure if I will have time to look at it tomorrow but I think I could during the weekend. I will tell you more about the size of the background at this point in time 🙂.

@ArturKovacs
Copy link
Owner

ArturKovacs commented May 16, 2020

I added a background image based on the resolution of the window from the screenshot you sent earlier. It is on the master, in distribution/macos so if you merge the master into this branch it will be available to you.

In case you need a different resolution image to make it look good, feel free to create another one from the svg. If you do that, you are going to need the Fira Sans font installed on your system.

Florian Girardo added 6 commits May 18, 2020 16:24
Create a Github action to generate a .dmg file containing a .app
created with cargo bundle.
The new .dmg has now a background image as well as a link for the
Application folder so the user can just drag and drop Emulsion's icon
into the Application folder to install it.
@girardof
Copy link
Contributor Author

Quick update, I tried to create a nice looking .dmg using create-dmg but came across the issue described here :
create-dmg/create-dmg#72

I'm not sure what to do now :(

@ArturKovacs
Copy link
Owner

Ahh this is baad :(

But this has to be possible, there's no way it's not possible to build a dmg on a CI machine.

I would suggest trying a different script/program. Like this nodejs one, or this one written in python.

@ArturKovacs
Copy link
Owner

@girardof
Copy link
Contributor Author

I tried with the node project which gave me this command to run :

create-dmg --background 'distribution/macos/background.png' \
           --window-size '750' '600' \
           --app-drop-link '550' '260' \
           --icon 'Emulsion.app' '210' '260' \
           --eula 'LICENSE.txt' \
           'Emulsion.dmg' 'target/release/bundle/osx/'

Locally this works perfectly but for some reason when running it inside a Github action I get this error :

Could not find `600`

I'm not familiar with Github actions, is there a reason for it not to accept options with two parameters ?

@ArturKovacs
Copy link
Owner

ArturKovacs commented May 22, 2020

Hmm. It seems that this program only supports the following options.

    --overwrite          Overwrite existing DMG with the same name
    --identity=<value>   Manually set code signing identity (automatic by default)
    --dmg-title=<value>  Manually set DMG title (must be <=27 characters) [default: App name]

But that's okay. It's still better than the default window in my opinion. So let's just stick with this nodejs script. So the command is going to be something like

create-dmg 'Emulsion.app'

@girardof
Copy link
Contributor Author

Sorry, I got confused between the bash and js projects that where both installed on my machine. I finally managed to create a .dmg.
I had to do a small hack because create-dmg return an error (it can't sign the .dmg), therefore the crete_dmg.sh script return true to avoid the action to stop.

@ArturKovacs
Copy link
Owner

Does the fact that the dmg is not signed interfere in any way with installing or using Emulsion?

@girardof
Copy link
Contributor Author

Screenshot 2020-05-22 at 22 05 30

@girardof
Copy link
Contributor Author

Does the fact that the dmg is not signed interfere in any way with installing or using Emulsion?

No, the only difference I a warning when installing it but it's common. I think you need an apple developer account to sign your .dmg.

@ArturKovacs
Copy link
Owner

Got it. Well that won't happen soon. Maybe one day...

But this is great! Thanks a whole lot I was completely helpless without you.

@ArturKovacs ArturKovacs merged commit 5c20a92 into ArturKovacs:master May 22, 2020
@girardof girardof deleted the github_action_for_osx branch May 22, 2020 20:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants