-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #9 from InvoxiPlayGames/egui-universal-actions
[macOS] Build Universal macOS app in CI
- Loading branch information
Showing
5 changed files
with
93 additions
and
15 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,3 @@ | ||
target/ | ||
temp/ | ||
.DS_Store |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> | ||
<plist version="1.0"> | ||
<dict> | ||
<key>CFBundleDevelopmentRegion</key> | ||
<string>English</string> | ||
<key>CFBundleDisplayName</key> | ||
<string>moonlight installer</string> | ||
<key>CFBundleExecutable</key> | ||
<string>moonlight-installer</string> | ||
<key>CFBundleIconFile</key> | ||
<string>Icon.icns</string> | ||
<key>CFBundleIdentifier</key> | ||
<string>io.github.moonlight-mod.moonlight-installer</string> | ||
<key>CFBundleInfoDictionaryVersion</key> | ||
<string>6.0</string> | ||
<key>CFBundleName</key> | ||
<string>moonlight installer</string> | ||
<key>CFBundlePackageType</key> | ||
<string>APPL</string> | ||
<key>CFBundleShortVersionString</key> | ||
<string>0.2.0</string> | ||
<key>CFBundleVersion</key> | ||
<string>0.2.0</string> | ||
<key>CSResourcesFileMapped</key> | ||
<true/> | ||
<key>LSRequiresCarbon</key> | ||
<true/> | ||
<key>NSHighResolutionCapable</key> | ||
<true/> | ||
</dict> | ||
</plist> |
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
#!/bin/sh | ||
|
||
# Packaging script to build a macOS .app bundle | ||
# If no arguments are passed, will build a single-architecture .app using the binary at | ||
# ./target/release/moonlight-installer | ||
# Specifying "bundle" will combine the binaries at | ||
# ./target/x86_64-apple-darwin/release/moonlight-installer | ||
# ./target/aarch64-apple-darwin/release/moonlight-installer | ||
|
||
APPNAME="moonlight installer.app" | ||
EXENAME=moonlight-installer | ||
ICON=assets/icon.icns | ||
PLIST=assets/Info.plist | ||
|
||
# Clear the temp folders | ||
rm -rf temp | ||
if [[ "$1" == "clean" ]]; then | ||
exit | ||
fi | ||
|
||
# Make our temporary folders | ||
mkdir -p temp/app | ||
|
||
if [[ "$1" == "bundle" ]]; then | ||
EXECUTABLE=temp/$EXENAME | ||
echo "Creating universal binary..." | ||
lipo -create target/x86_64-apple-darwin/release/$EXENAME target/aarch64-apple-darwin/release/$EXENAME -output $EXECUTABLE | ||
else | ||
EXECUTABLE=target/release/$EXENAME | ||
fi | ||
|
||
# Make the app directory structure | ||
APPDIR="temp/app/$APPNAME" | ||
echo "Building app bundle..." | ||
mkdir -p "$APPDIR/Contents/MacOS" | ||
mkdir -p "$APPDIR/Contents/Resources" | ||
# Copy our assets to it | ||
cp $PLIST "$APPDIR/Contents/Info.plist" | ||
cp $ICON "$APPDIR/Contents/Resources/Icon.icns" | ||
# Copy the merged binary | ||
cp $EXECUTABLE "$APPDIR/Contents/MacOS/$EXENAME" | ||
|
||
# Apply an ad-hoc signature | ||
echo "Code signing..." | ||
codesign --force --deep -s - "$APPDIR" | ||
|
||
echo "Built '$APPDIR'" |