To all the devs, hi. Here is step by step guide for releasing a macOS binary. First of all make sure you have `xcode`, `brew` and `git` installed. Make sure that you have done the first time setup of `xcode`.
Make sure that you have installed requierd dependencies. If not, paste this in terminal:
Make sure that you leave `CMAKE_BUILD_TYPE` on `Release` and the minimum macOS should be `macOS 11.0` you can't go lower than that (at least on apple silicon macs).
There is an issue that the `Qt` doesn't get copied to the app so it will crash when someone who doesn't have `Qt` installed.
## Making dmg file
There is a file named `suyu-macOS-arm64raw.dmg`. Open `Disk Utility`. PLEASE DO IN THIS ORDER DO AND MAKE SURE THAT YOU DON'T SKIP ANY OF THIS AND TEST AT THE END.
First thing is you open `suyu-macOS-arm64raw.dmg`. You do this (so it won't get misplaced):
![first step](assets/image.png)
Second, you copy and replace the binary that is from `build/bin` to the mounted drive that we opened up.
Third, you revert view back to icons:
![third step](assets/image-1.png)
check if everything is alright or not. check the binary is right and check if the binary works.
DO NOT MOVE ANYTHING OR CHANGE THE SIZE OF ANYTHING.
fourth, you have to go to `disk utility` and unmount the disk
fifth is the sensitive part. you have to go to `images->convert` in `disk utility`:
![fifth step](assets/image-2.png)
you have to convert the image to `read-only`:
![read-only](assets/image-3.png)
change the name to whatever you want or you can name it the way it is inside the picture.
click on convert.
sixth, you don't have to skip this part. You have to convert the new image (the read-only one) to `compressed` and name it `suyu-macOS-<CPU_ARCHITECTURE>.dmg`:
![sixth step](assets/image-4.png)
check the size of the final dmg file and see if you can copy anything into it. It should be read-only and compressed.
## Changing the background of the dmg file
If you want to update the background of the dmg file, first make sure that your image is 540x380 pixels (or you can resize it but don't make the image too big since the pixels you choose will make it bigger or smaller, you can change the aspect ratio but what I recommend is 540x380 pixels).
In the `suyu-macOS-arm64raw.dmg`, right click (control click) on the background. Click on `show view options`:
![show view options](assets/image-5.png)
Inside that you need to drag and drop the image into this place: