Skip to content

Commit 8263256

Browse files
authored
Create macOS .app bundle (#2859) #patch
1 parent f97a779 commit 8263256

File tree

1 file changed

+59
-0
lines changed

1 file changed

+59
-0
lines changed

.github/workflows/create_release.yml

Lines changed: 59 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -103,6 +103,65 @@ jobs:
103103
shell: bash
104104
run: |
105105
git rev-parse HEAD > Publish/commit_id.txt
106+
107+
- name: "Create macOS .app bundle"
108+
if: matrix.build == 'osx-arm64'
109+
shell: bash
110+
env:
111+
VERSION: ${{ needs.create_release.outputs.tag }}
112+
run: |
113+
set -euo pipefail
114+
115+
APP_NAME="ImperatorToCK3"
116+
APP_DIR="Publish/${APP_NAME}.app"
117+
CONTENTS_DIR="${APP_DIR}/Contents"
118+
MACOS_DIR="${CONTENTS_DIR}/MacOS"
119+
120+
mkdir -p "${MACOS_DIR}"
121+
122+
cat > "${CONTENTS_DIR}/Info.plist" <<PLIST
123+
<?xml version="1.0" encoding="UTF-8"?>
124+
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
125+
<plist version="1.0">
126+
<dict>
127+
<key>CFBundleDevelopmentRegion</key>
128+
<string>en</string>
129+
<key>CFBundleDisplayName</key>
130+
<string>${APP_NAME}</string>
131+
<key>CFBundleExecutable</key>
132+
<string>ConverterFrontend</string>
133+
<key>CFBundleIdentifier</key>
134+
<string>com.paradoxgameconverters.imperator-to-ck3</string>
135+
<key>CFBundleInfoDictionaryVersion</key>
136+
<string>6.0</string>
137+
<key>CFBundleName</key>
138+
<string>${APP_NAME}</string>
139+
<key>CFBundlePackageType</key>
140+
<string>APPL</string>
141+
<key>CFBundleShortVersionString</key>
142+
<string>${VERSION}</string>
143+
<key>CFBundleVersion</key>
144+
<string>${VERSION}</string>
145+
</dict>
146+
</plist>
147+
PLIST
148+
149+
# Move everything we published into the app bundle so the frontend can
150+
# find the backend and assets relative to AppContext.BaseDirectory.
151+
shopt -s dotglob nullglob
152+
for item in Publish/*; do
153+
if [ "${item}" = "${APP_DIR}" ]; then
154+
continue
155+
fi
156+
mv "${item}" "${MACOS_DIR}/"
157+
done
158+
159+
chmod +x "${MACOS_DIR}/ConverterFrontend"
160+
161+
echo "Signing .app bundle (ad-hoc)..."
162+
codesign --force --deep -s - "${APP_DIR}"
163+
echo "Verifying signature..."
164+
codesign -dv --verbose=4 "${APP_DIR}"
106165
- name: "Install sed and Inno Setup for Windows"
107166
if: matrix.build == 'win-x64'
108167
run: |

0 commit comments

Comments
 (0)