diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 6a3129e..ccef07e 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -41,7 +41,7 @@ jobs: - name: Install build dependencies for macOS if: contains(matrix.platform, 'macos') - run: brew install create-dmg + run: npm install --global appdmg - name: Install build dependencies for Linux if: contains(matrix.platform, 'ubuntu') diff --git a/.gitignore b/.gitignore index 05533c9..9eda200 100644 --- a/.gitignore +++ b/.gitignore @@ -3,6 +3,9 @@ /build/version.txt /build/bin/ /build/windows/installer/tmp/ +/build/darwin/dmg_settings.json + +/releases /frontend/node_modules/ /frontend/dist/ diff --git a/build/README.md b/build/README.md index 1ae2f67..955bc2c 100644 --- a/build/README.md +++ b/build/README.md @@ -1,6 +1,6 @@ # Build Directory -The build directory is used to house all the build files and assets for your application. +The build directory is used to house all the build files and assets for your application. The structure is: @@ -10,10 +10,7 @@ The structure is: ## Mac -The `darwin` directory holds files specific to Mac builds. -These may be customised and used as part of the build. To return these files to the default state, simply delete them -and -build with `wails build`. +The `darwin` directory holds files specific to Mac builds. These may be customised and used as part of the build. To return these files to the default state, simply delete them and build with `wails build`. The directory contains the following files: @@ -22,14 +19,9 @@ The directory contains the following files: ## Windows -The `windows` directory contains the manifest and rc files used when building with `wails build`. -These may be customised for your application. To return these files to the default state, simply delete them and -build with `wails build`. +The `windows` directory contains the manifest and rc files used when building with `wails build`. These may be customised for your application. To return these files to the default state, simply delete them and build with `wails build`. -- `icon.ico` - The icon used for the application. This is used when building using `wails build`. If you wish to - use a different icon, simply replace this file with your own. If it is missing, a new `icon.ico` file - will be created using the `appicon.png` file in the build directory. +- `icon.ico` - The icon used for the application. This is used when building using `wails build`. If you wish to use a different icon, simply replace this file with your own. If it is missing, a new `icon.ico` file will be created using the `appicon.png` file in the build directory. - `installer/*` - The files used to create the Windows installer. These are used when building using `wails build`. -- `info.json` - Application details used for Windows builds. The data here will be used by the Windows installer, - as well as the application itself (right click the exe -> properties -> details) -- `wails.exe.manifest` - The main application manifest file. \ No newline at end of file +- `info.json` - Application details used for Windows builds. The data here will be used by the Windows installer, as well as the application itself (right click the exe -> properties -> details) +- `wails.exe.manifest` - The main application manifest file. diff --git a/build/darwin/ci_generate.sh b/build/darwin/ci_generate.sh index 40a8380..4c9a98b 100755 --- a/build/darwin/ci_generate.sh +++ b/build/darwin/ci_generate.sh @@ -1,7 +1,27 @@ #!/bin/sh +# Cleanup +rm -rf releases +rm -rf build/bin mkdir releases -mkdir emptydir +mkdir -p build/bin + +# Settings +cat > build/darwin/dmg_settings.json << EOF +{ + "title": "Rolens", + "background": "$(pwd)/build/darwin/dmg_background.png", + "icon-size": 100, + "window": { + "size": { "width": 155, "height": 250 }, + "position": { "x": 360, "y": 360 } + }, + "contents": [ + { "x": 750, "y": 500, "type": "link", "path": "/Applications" }, + { "x": 595, "y": 250, "type": "file", "path": "$(pwd)/build/bin/Rolens.app" } + ] +} +EOF # AMD/Intel wails build -platform darwin/amd64 @@ -15,10 +35,13 @@ wails build -platform darwin/amd64 # --background build/darwin/dmg_background.png \ # --add-file Rolens.app build/bin/Rolens.app 595 250 \ # build/bin/Rolens.dmg emptydir +# appdmg build/darwin/dmg_settings.json build/bin/Rolens.dmg tar -czvf releases/rolens-$1-amd64.tar.gz --directory build/bin Rolens.app +# Cleanup +rm -rf build/bin/Rolens.app + # ARM/AppleM1 -rm -rf build/bin wails build -platform darwin/arm64 # create-dmg \ # --volname Rolens \ @@ -30,4 +53,8 @@ wails build -platform darwin/arm64 # --background build/darwin/dmg_background.png \ # --add-file Rolens.app build/bin/Rolens.app 595 250 \ # build/bin/Rolens.dmg emptydir +# appdmg build/darwin/dmg_settings.json build/bin/Rolens.dmg tar -czvf releases/rolens-$1-arm64.tar.gz --directory build/bin Rolens.app + +# Cleanup +rm -rf build/bin/Rolens.app