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

Build GKv3 installer (DMG) for MacOS #455

Merged
merged 3 commits into from
Apr 17, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
Expand Up @@ -25,3 +25,6 @@ csharp_new_line_before_finally = false
[*.{md,yml}]
indent_style = space
indent_size = 2

[*.sh]
end_of_line = lf
Copy link
Contributor Author

Choose a reason for hiding this comment

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

VS Code refused to save .sh files with LF without this configuration

28 changes: 28 additions & 0 deletions .github/workflows/package-mac.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
name: Package GEDKeeper3 for MacOS

on:
push:
branches: [ "master" ]
pull_request:
branches: [ "master" ]

jobs:
mac:

runs-on: macos-12

steps:
- uses: actions/checkout@v3
- name: Setup .NET
uses: actions/setup-dotnet@v3
with:
dotnet-version: 6.0.x
- name: Build
run: dotnet build -c MacOS_Debug -p:EnableDmgBuild=true
working-directory: projects/GKv3
- name: Upload DMG file
Copy link
Contributor Author

Choose a reason for hiding this comment

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

It crates an artifact that can be downloaded from Actions tab (Actions -> 'Package GEDKeeper 3 for MacOS' -> workflow run, at the bottom of 'Summary' page). Then it can be downloaded from there and distributed as a normal release file.

uses: actions/upload-artifact@v3
with:
name: GEDKeeper3
path: projects/GKv3/GEDKeeper3/bin/MacOS_Debug/*.dmg
if-no-files-found: error
12 changes: 12 additions & 0 deletions build_v3.mac.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
#!/bin/sh

dotnet build projects/GKv3/GEDKeeper3.sln -c MacOS_Debug -p:MacBuildBundle=true

# For details how to create a proper DMG HSF+ file see here: https://stackoverflow.com/a/7553878/259946.
# The ISO9660/HFS is a supported format for DMG files and can be treated as uncompressed DMG.

# sudo apt install mkisofs
Copy link
Contributor Author

Choose a reason for hiding this comment

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

mkisofs/genisoimage produces ISO-9660 that is a valid DMG file that can be mounted on MacOS. See the link above how to make a compressed DMG file from ISO.

cd projects/GKv3/GEDKeeper3/bin/MacOS_Debug
mkisofs -V GEDKeeper -D -R -apple -no-pad -o GEDKeeper3-x64.dmg osx-x64
mkisofs -V GEDKeeper -D -R -apple -no-pad -o GEDKeeper3-arm64.dmg osx-arm64
cd -
6 changes: 3 additions & 3 deletions projects/GKv3/.run/GEDKeeper3.Mac.run.xml
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
<component name="ProjectRunConfigurationManager">
<configuration default="false" name="GEDKeeper3.Mac" type="DotNetProject" factoryName=".NET Project">
<option name="EXE_PATH" value="$PROJECT_DIR$/GEDKeeper3/bin/MacOS_Debug/net6.0/GEDKeeper3.app/Contents/MacOS/GEDKeeper3" />
Copy link
Contributor Author

Choose a reason for hiding this comment

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

This has changed because now we have a single target framework.

<option name="EXE_PATH" value="$PROJECT_DIR$/GEDKeeper3/bin/MacOS_Debug/GEDKeeper3.app/Contents/MacOS/GEDKeeper3" />
<option name="PROGRAM_PARAMETERS" value="" />
<option name="WORKING_DIRECTORY" value="$PROJECT_DIR$/GEDKeeper3/bin/MacOS_Debug/net6.0" />
<option name="WORKING_DIRECTORY" value="$PROJECT_DIR$/GEDKeeper3/bin/MacOS_Debug/" />
<option name="PASS_PARENT_ENVS" value="1" />
<option name="USE_EXTERNAL_CONSOLE" value="0" />
<option name="USE_MONO" value="0" />
Expand All @@ -17,4 +17,4 @@
<option name="Build" />
</method>
</configuration>
</component>
</component>