2020 # macOS build
2121 - os : macos-latest
2222 build_type : Release
23- cmake_args : -DCMAKE_OSX_ARCHITECTURES="x86_64;arm64" - DCMAKE_BUILD_TYPE=Release
23+ cmake_args : -DCMAKE_BUILD_TYPE=Release
2424 # Windows build with Visual Studio
2525 - os : windows-latest
2626 build_type : Release
@@ -100,15 +100,25 @@ jobs:
100100 run : cmake --build build --parallel
101101
102102 # Package release for macOS: create a zip archive with the executable and assets
103- - name : Package release (macOS)
103+ # Generate a macOS .app bundle using the provided generator script and package it
104+ - name : Package .app (macOS)
104105 if : runner.os == 'macOS'
105106 run : |
106- mkdir -p packaged
107- cp build/mw_recreation packaged/
108- cp -r assets packaged/assets
109- zip -r macos-latest.zip packaged
110-
111- # Upload packaged release for macOS
107+ set -e
108+ # Ensure the generator script is executable
109+ chmod +x tools/macos_app_generator.sh
110+ # Run the script with the built binary and assets as arguments. This script
111+ # should create a .app bundle in the current directory or in a known location.
112+ tools/macos_app_generator.sh build/mw_recreation assets
113+ # Find the generated .app bundle (assumes only one .app is generated)
114+ APP_PATH=$(find . -name '*.app' -type d -print -quit)
115+ if [ -z "$APP_PATH" ]; then
116+ echo "No .app bundle found after running macos_app_generator.sh" && exit 1
117+ fi
118+ # Compress the .app bundle into a zip for distribution
119+ zip -r macos-latest.zip "$APP_PATH"
120+
121+ # Upload packaged .app for macOS
112122 - name : Upload release (macOS)
113123 if : runner.os == 'macOS'
114124 uses : actions/upload-artifact@v4
@@ -133,6 +143,69 @@ jobs:
133143 name : linux-latest
134144 path : linux-latest.tar.gz
135145
146+ # Build and package additional Linux distributions: AppImage and .deb
147+ - name : Package Linux AppImage
148+ if : runner.os == 'Linux'
149+ run : |
150+ set -e
151+ # Prepare AppDir structure for linuxdeploy
152+ mkdir -p appimage-build/AppDir/usr/bin
153+ cp build/mw_recreation appimage-build/AppDir/usr/bin/mw_recreation
154+ cp -r assets appimage-build/AppDir/usr/bin/assets
155+ # Create desktop entry for the AppImage
156+ mkdir -p appimage-build/AppDir/usr/share/applications
157+ cat > appimage-build/AppDir/usr/share/applications/mw_recreation.desktop <<'EOF'
158+ [Desktop Entry]
159+ Name=Music World Recreation
160+ Exec=mw_recreation
161+ Icon=mw_recreation
162+ Type=Application
163+ Categories=Game;
164+ EOF
165+ # Download linuxdeploy to bundle the AppImage
166+ wget -q https://github.com/linuxdeploy/linuxdeploy/releases/download/continuous/linuxdeploy-x86_64.AppImage -O linuxdeploy.AppImage
167+ chmod +x linuxdeploy.AppImage
168+ # Build the AppImage; this produces a file ending in .AppImage
169+ ./linuxdeploy.AppImage --appdir appimage-build/AppDir --output appimage
170+ # Rename the generated file to a predictable name
171+ mv *.AppImage mw_recreation.AppImage
172+
173+ - name : Package Linux .deb
174+ if : runner.os == 'Linux'
175+ run : |
176+ set -e
177+ # Prepare debian package directory structure
178+ mkdir -p debpkg/usr/bin
179+ cp build/mw_recreation debpkg/usr/bin/
180+ mkdir -p debpkg/usr/share/mw_recreation
181+ cp -r assets debpkg/usr/share/mw_recreation/
182+ mkdir -p debpkg/DEBIAN
183+ cat > debpkg/DEBIAN/control <<'EOF'
184+ Package: mw-recreation
185+ Version: 1.0.0
186+ Section: games
187+ Priority: optional
188+ Architecture: amd64
189+ Maintainer: Unknown
190+ Description: Music World Recreation game built with raylib
191+ EOF
192+ # Build the Debian package
193+ dpkg-deb --build debpkg mw_recreation.deb
194+
195+ - name : Upload Linux AppImage
196+ if : runner.os == 'Linux'
197+ uses : actions/upload-artifact@v4
198+ with :
199+ name : linux-appimage
200+ path : mw_recreation.AppImage
201+
202+ - name : Upload Linux deb
203+ if : runner.os == 'Linux'
204+ uses : actions/upload-artifact@v4
205+ with :
206+ name : linux-deb
207+ path : mw_recreation.deb
208+
136209 # Upload build artifacts. Separate steps are used for Windows and
137210 # non‑Windows because the executable is generated into different
138211 # directories on Visual Studio.
@@ -148,4 +221,4 @@ jobs:
148221 uses : actions/upload-artifact@v4
149222 with :
150223 name : mw_recreation-${{ matrix.os }}
151- path : build/mw_recreation
224+ path : build/mw_recreation
0 commit comments