forked from Anuken/Mindustry
-
Notifications
You must be signed in to change notification settings - Fork 0
36 lines (34 loc) · 1.23 KB
/
android.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
name: Android CI
on:
workflow_dispatch:
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 1
- name: Set env
run: echo "suffix=${GITHUB_REF#refs/*/}" >> $GITHUB_ENV
- name: set up JDK 17
uses: actions/setup-java@v4
with:
java-version: '17'
distribution: 'adopt'
cache: 'gradle'
- name: Build with Gradle
run: |
echo "BODY=$(git rev-parse HEAD)" >> $GITHUB_ENV
sed -i 's/applicationId "io.anuke.mindustry"/applicationId "io.anuke.mindustry.be"/g' android/build.gradle
sed -i 's/"io.anuke.mindustry"/"io.anuke.mindustry.be"/g' android/AndroidManifest.xml
sed -i 's/Mindustry/Mindustry BE/g' android/res/values/strings.xml
./gradlew pack
./gradlew android:assembleDebug --stacktrace
mv android/build/outputs/apk/debug/android-debug.apk android/build/outputs/apk/debug/Mindustry-BE-Android-${suffix}.apk
echo "JDK directory: $JDK_DIR"
echo $PWD
- name: Upload Android artifacts
uses: actions/upload-artifact@v4
with:
name: mindustry_debug.zip
path: android/build/outputs/apk/debug/Mindustry-BE-Android-${{ env.suffix }}.apk