-
Notifications
You must be signed in to change notification settings - Fork 6
attempt to build mac app bundle #232
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
base: master
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -13,7 +13,6 @@ FG_GREEN=$(tput setaf 46) | |||||||||||||||||||||||||||||
| BG_GREEN=$(tput setab 46) | ||||||||||||||||||||||||||||||
| RESET=$(tput sgr0) | ||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||
| # 1. Get the version from the first command-line argument | ||||||||||||||||||||||||||||||
| if [ -z "$1" ]; then | ||||||||||||||||||||||||||||||
| echo "Error: Please provide the version as the first argument." | ||||||||||||||||||||||||||||||
|
|
@@ -27,54 +26,121 @@ echo "=== Building Object Editor v${FG_BLUE}$version${RESET} for ${FG_BLUE}$fram | |||||||||||||||||||||||||||||
| # read .net version from csproj file | ||||||||||||||||||||||||||||||
| framework=$(grep '<TargetFramework>' Gui/Gui.csproj | sed 's/.*<TargetFramework>\(.*\)<\/TargetFramework>.*/\1/') | ||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||
| build_windows() { | ||||||||||||||||||||||||||||||
| echo "Building the ${FG_BLUE}Editor${RESET} (win-x64)" | ||||||||||||||||||||||||||||||
| dotnet publish Gui/Gui.csproj -c Release -p:WarningLevel=0 -p:PublishSingleFile=true -p:Version=$version --self-contained --runtime win-x64 | ||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||
| echo "Building the ${FG_BLUE}Updater${RESET} (win-x64)" | ||||||||||||||||||||||||||||||
| dotnet publish GuiUpdater/GuiUpdater.csproj -c Release -p:PublishSingleFile=true -p:Version=$version --self-contained --runtime win-x64 | ||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||
| echo "Copying ${FG_BLUE}Updater${RESET} files into ${FG_BLUE}Gui${RESET} folders (win-x64)" | ||||||||||||||||||||||||||||||
| cp GuiUpdater/bin/Release/$framework/win-x64/publish/* Gui/bin/Release/$framework/win-x64/publish | ||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||
| echo "Zipping ${FG_BLUE}win-x64${RESET}" | ||||||||||||||||||||||||||||||
| pushd "Gui/bin/Release/$framework/win-x64/publish" | ||||||||||||||||||||||||||||||
| zip -r "object-editor-$version-win-x64.zip" . | ||||||||||||||||||||||||||||||
| mv "object-editor-$version-win-x64.zip" ../../.. | ||||||||||||||||||||||||||||||
| popd | ||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||
| build_linux() { | ||||||||||||||||||||||||||||||
| echo "Building the ${FG_BLUE}Editor${RESET} (linux-x64)" | ||||||||||||||||||||||||||||||
| dotnet publish Gui/Gui.csproj -c Release -p:WarningLevel=0 -p:PublishSingleFile=true -p:Version=$version --self-contained --runtime linux-x64 | ||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||
| echo "Building the ${FG_BLUE}Updater${RESET} (linux-x64)" | ||||||||||||||||||||||||||||||
| dotnet publish GuiUpdater/GuiUpdater.csproj -c Release -p:PublishSingleFile=true -p:Version=$version --self-contained --runtime linux-x64 | ||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||
| echo "Copying ${FG_BLUE}Updater${RESET} files into ${FG_BLUE}Gui${RESET} folders (linux-x64)" | ||||||||||||||||||||||||||||||
| cp GuiUpdater/bin/Release/$framework/linux-x64/publish/* Gui/bin/Release/$framework/linux-x64/publish | ||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||
| echo "Zipping ${FG_BLUE}linux-x64${RESET}" | ||||||||||||||||||||||||||||||
| pushd "Gui/bin/Release/$framework/linux-x64/publish" | ||||||||||||||||||||||||||||||
| chmod +x "./ObjectEditor" | ||||||||||||||||||||||||||||||
| chmod +x "./ObjectEditorUpdater" | ||||||||||||||||||||||||||||||
| touch "object-editor-$version-linux-x64.tar" | ||||||||||||||||||||||||||||||
| tar --exclude="object-editor-$version-linux-x64.tar" -jcf "object-editor-$version-linux-x64.tar" . | ||||||||||||||||||||||||||||||
| mv "object-editor-$version-linux-x64.tar" ../../.. | ||||||||||||||||||||||||||||||
| popd | ||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||
| build_macos() { | ||||||||||||||||||||||||||||||
| # macOS bundle settings | ||||||||||||||||||||||||||||||
| app_name="ObjectEditor" | ||||||||||||||||||||||||||||||
| mac_bundle_id="com.openloco.objecteditor" | ||||||||||||||||||||||||||||||
| macos_publish_dir="Gui/bin/Release/$framework/osx-x64/publish" | ||||||||||||||||||||||||||||||
| macos_bundle_dir="$macos_publish_dir/$app_name.app" | ||||||||||||||||||||||||||||||
| macos_plist_template="Gui/Packaging/macOS/Info.plist" | ||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||
| macos_plist_template="Gui/Packaging/macOS/Info.plist" |
Copilot
AI
Feb 4, 2026
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The generated Info.plist declares CFBundleIconFile as loco_icon.icns, but the repo doesn't contain Gui/Assets/loco_icon.icns (only .ico/.png). As written, the bundle will never include the icon you declare. Either add/generate an .icns during the build (e.g., from the PNG) or update the plist/icon copy logic to match an actual bundled icon file.
| <string>loco_icon.icns</string> | |
| </dict> | |
| </plist> | |
| EOF | |
| if [ -f "Gui/Assets/loco_icon.icns" ]; then | |
| cp "Gui/Assets/loco_icon.icns" "$macos_bundle_dir/Contents/Resources/" | |
| <string>loco_icon.png</string> | |
| </dict> | |
| </plist> | |
| EOF | |
| if [ -f "Gui/Assets/loco_icon.png" ]; then | |
| cp "Gui/Assets/loco_icon.png" "$macos_bundle_dir/Contents/Resources/" |
Copilot
AI
Feb 4, 2026
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
dotnet restore is run explicitly, but dotnet publish will restore again unless --no-restore is passed. This adds unnecessary work and can significantly slow CI packaging. Add --no-restore to the publishes (or remove the explicit restores if you prefer publish-driven restores).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The Linux artifact is created with
tar -j(bzip2 compression) but is named*.tarand the log says "Zipping". This produces a misleading filename/content-type for consumers of the build output. Rename the output to*.tar.bz2(or drop-jif you intend an uncompressed tar) and adjust the log message accordingly.