Skip to content

Commit 02b7fc7

Browse files
committed
build-for-Android
1 parent 6cb5cee commit 02b7fc7

File tree

1 file changed

+27
-1
lines changed

1 file changed

+27
-1
lines changed

.github/workflows/release.yml

Lines changed: 27 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,12 @@ on:
88
- "*.*.*"
99
pull_request:
1010

11+
# ToDo: adapt names
12+
env:
13+
# This variable is used to name release output files.
14+
GAME_EXECUTABLE_NAME: bevy_game
15+
GAME_OSX_APP_NAME: BevyGame
16+
1117
jobs:
1218
publish:
1319
name: Publish for ${{ matrix.target }}
@@ -47,4 +53,24 @@ jobs:
4753
repo_token: ${{ secrets.GITHUB_TOKEN }}
4854
file: tempo-trainer.zip
4955
asset_name: ${{ matrix.release_name }}.zip
50-
tag: ${{ github.ref }}
56+
tag: ${{ github.ref }}
57+
build-for-Android:
58+
runs-on: ubuntu-latest
59+
steps:
60+
- uses: actions/checkout@v4
61+
- uses: dtolnay/rust-toolchain@stable
62+
- uses: Swatinem/rust-cache@v2
63+
- name: Add Android targets
64+
# could add more targets like armv7-linux-androideabi here (then also add to cargo-apk config)
65+
run: rustup target add aarch64-linux-android
66+
- name: Install Cargo APK
67+
run: cargo install --force cargo-apk
68+
- name: Build app for Android
69+
# This uses a debug build, since release builds require keystore configuration
70+
# For AAB builds that can be pushed to the Play store, see the release-android-google-play workflow.
71+
run: ANDROID_NDK_ROOT=$ANDROID_NDK_LATEST_HOME cargo apk build --package mobile
72+
- name: Upload
73+
uses: actions/upload-artifact@v4
74+
with:
75+
name: ${{ env.GAME_OSX_APP_NAME }}.apk
76+
path: target/debug/apk/${{ env.GAME_OSX_APP_NAME }}.apk

0 commit comments

Comments
 (0)