1
0
mirror of https://github.com/garraflavatra/rolens.git synced 2025-01-18 21:17:59 +00:00

CI: trying to generate .dmg (not working yet)

This commit is contained in:
Romein van Buren 2023-06-23 18:25:42 +02:00
parent dc0094b27c
commit b5bb51c869
Signed by: romein
GPG Key ID: 0EFF8478ADDF6C49
4 changed files with 39 additions and 17 deletions

View File

@ -41,7 +41,7 @@ jobs:
- name: Install build dependencies for macOS - name: Install build dependencies for macOS
if: contains(matrix.platform, 'macos') if: contains(matrix.platform, 'macos')
run: brew install create-dmg run: npm install --global appdmg
- name: Install build dependencies for Linux - name: Install build dependencies for Linux
if: contains(matrix.platform, 'ubuntu') if: contains(matrix.platform, 'ubuntu')

3
.gitignore vendored
View File

@ -3,6 +3,9 @@
/build/version.txt /build/version.txt
/build/bin/ /build/bin/
/build/windows/installer/tmp/ /build/windows/installer/tmp/
/build/darwin/dmg_settings.json
/releases
/frontend/node_modules/ /frontend/node_modules/
/frontend/dist/ /frontend/dist/

View File

@ -1,6 +1,6 @@
# Build Directory # 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: The structure is:
@ -10,10 +10,7 @@ The structure is:
## Mac ## Mac
The `darwin` directory holds files specific to Mac builds. 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`.
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: The directory contains the following files:
@ -22,14 +19,9 @@ The directory contains the following files:
## Windows ## Windows
The `windows` directory contains the manifest and rc files used when building 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`.
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 - `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.
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`. - `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, - `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)
as well as the application itself (right click the exe -> properties -> details) - `wails.exe.manifest` - The main application manifest file.
- `wails.exe.manifest` - The main application manifest file.

View File

@ -1,7 +1,27 @@
#!/bin/sh #!/bin/sh
# Cleanup
rm -rf releases
rm -rf build/bin
mkdir releases 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 # AMD/Intel
wails build -platform darwin/amd64 wails build -platform darwin/amd64
@ -15,10 +35,13 @@ wails build -platform darwin/amd64
# --background build/darwin/dmg_background.png \ # --background build/darwin/dmg_background.png \
# --add-file Rolens.app build/bin/Rolens.app 595 250 \ # --add-file Rolens.app build/bin/Rolens.app 595 250 \
# build/bin/Rolens.dmg emptydir # 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 tar -czvf releases/rolens-$1-amd64.tar.gz --directory build/bin Rolens.app
# Cleanup
rm -rf build/bin/Rolens.app
# ARM/AppleM1 # ARM/AppleM1
rm -rf build/bin
wails build -platform darwin/arm64 wails build -platform darwin/arm64
# create-dmg \ # create-dmg \
# --volname Rolens \ # --volname Rolens \
@ -30,4 +53,8 @@ wails build -platform darwin/arm64
# --background build/darwin/dmg_background.png \ # --background build/darwin/dmg_background.png \
# --add-file Rolens.app build/bin/Rolens.app 595 250 \ # --add-file Rolens.app build/bin/Rolens.app 595 250 \
# build/bin/Rolens.dmg emptydir # 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 tar -czvf releases/rolens-$1-arm64.tar.gz --directory build/bin Rolens.app
# Cleanup
rm -rf build/bin/Rolens.app