2929 if : matrix.os == 'ubuntu-latest'
3030 run : sudo apt-get update && sudo apt-get install -y g++ pkg-config libx11-dev libasound2-dev libudev-dev libxkbcommon-x11-0 libwayland-dev
3131
32- # Use --profile dist so the binary lands in target/dist/ — which is where
33- # Package.wxs (WiX MSI) and the macOS DMG script expect to find it.
3432 - name : Build Project
3533 working-directory : ${{ matrix.project.path }}
3634 shell : bash
@@ -58,54 +56,18 @@ jobs:
5856 [ -d "credits" ] && cp -r credits dist/credits || true
5957 cd dist && tar -czf ../${{ matrix.project.name }}_ubuntu-latest.tar.gz *
6058
61- # Produces a proper .app bundle + DMG.
62- #
63- # The project is expected to ship a pre-configured app bundle skeleton at
64- # build/macos/src/Game.app/ containing at minimum:
65- # Contents/Info.plist – display name, bundle ID, version, icon ref
66- # Contents/Resources/ – .icns icon file
67- # Contents/PkgInfo – "APPL????"
68- #
69- # (This structure is created by bevy_game_template and is already present
70- # in the repository.) The binary and assets are then copied in and the
71- # bundle is renamed before packaging.
72- #
73- # If the skeleton is absent the step falls back to a minimal bundle with
74- # no Info.plist (runs fine, but macOS Gatekeeper will warn on open).
7559 - name : Prepare Artifacts (macOS DMG)
7660 if : matrix.os == 'macos-latest'
7761 shell : bash
7862 working-directory : ${{ matrix.project.path }}
7963 run : |
80- APP_BIN="${{ matrix.project.app_name }}"
81- PROJ_NAME="${{ matrix.project.name }}"
82-
83- # ── Locate or create the .app bundle skeleton ──────────────────────
84- TEMPLATE_APP=$(find build/macos/src -maxdepth 1 -name "*.app" -type d 2>/dev/null | head -1)
85-
86- if [ -n "$TEMPLATE_APP" ]; then
87- # Use the repo-supplied skeleton (has Info.plist, icon, PkgInfo).
88- BUNDLE="build/macos/src/$PROJ_NAME.app"
89- mv "$TEMPLATE_APP" "$BUNDLE"
90- else
91- # Fallback: bare-bones bundle without Info.plist.
92- echo "Warning: no .app skeleton found in build/macos/src/; creating a minimal bundle."
93- BUNDLE="build/macos/src/$PROJ_NAME.app"
94- mkdir -p "$BUNDLE/Contents"
95- fi
96-
97- # ── Copy binary and data into the bundle ───────────────────────────
98- mkdir -p "$BUNDLE/Contents/MacOS"
99- cp target/dist/$APP_BIN "$BUNDLE/Contents/MacOS/$APP_BIN"
100- [ -d "assets" ] && cp -r assets/ "$BUNDLE/Contents/MacOS/assets" || true
101- [ -d "credits" ] && cp -r credits/ "$BUNDLE/Contents/MacOS/credits" || true
102-
103- # ── Package as DMG ─────────────────────────────────────────────────
104- ln -sf /Applications build/macos/src/
105- hdiutil create -fs HFS+ \
106- -volname "$PROJ_NAME" \
107- -srcfolder build/macos/src \
108- "$PROJ_NAME.dmg"
64+ APP_NAME="${{ matrix.project.app_name }}"
65+ mkdir -p build/macos/src/$APP_NAME.app/Contents/MacOS/assets
66+ [ -d "assets" ] && cp -r assets/ build/macos/src/$APP_NAME.app/Contents/MacOS/assets || true
67+ [ -d "credits" ] && cp -r credits/ build/macos/src/$APP_NAME.app/Contents/MacOS/credits || true
68+ cp target/dist/$APP_NAME build/macos/src/$APP_NAME.app/Contents/MacOS/
69+ ln -s /Applications build/macos/src/
70+ hdiutil create -fs HFS+ -volname "${{ matrix.project.name }}" -srcfolder build/macos/src ${{ matrix.project.name }}.dmg
10971
11072 - name : Prepare Artifacts (Windows)
11173 if : matrix.os == 'windows-latest'
@@ -172,10 +134,6 @@ jobs:
172134 yes | $ANDROID_HOME/cmdline-tools/latest/bin/sdkmanager "platforms;android-35"
173135 cargo install --force cargo-apk
174136
175- # Run from the workspace root (not from inside mobile/) so that Cargo
176- # resolves the [workspace] section correctly and --package selects the
177- # right crate. This is what prevents the android-game-activity vs.
178- # android-native-activity feature-unification conflict.
179137 - name : Build Android
180138 if : matrix.target == 'android'
181139 working-directory : ${{ matrix.project.path }}
@@ -187,12 +145,6 @@ jobs:
187145 if : matrix.target == 'ios'
188146 run : rustup target add aarch64-apple-ios x86_64-apple-ios aarch64-apple-ios-sim
189147
190- # Xcode calls build_rust_deps.sh which runs `cargo rustc --crate-type
191- # staticlib --lib [--profile dist] --target aarch64-apple-ios`.
192- # The root lib must NOT have `crate-type = ["cdylib", ...]` — doing so
193- # causes Cargo to also produce a .dylib for iOS which the linker rejects
194- # (it finds macOS SDK frameworks instead of iOS SDK ones).
195- # That crate-type was removed from the root Cargo.toml.
196148 - name : Build iOS
197149 if : matrix.target == 'ios'
198150 working-directory : ${{ matrix.project.path }}
0 commit comments