2019-12-11 18:02:42 +01:00
|
|
|
name: CI
|
|
|
|
|
2021-03-26 19:12:19 +01:00
|
|
|
on: [ push, pull_request ]
|
2019-12-11 18:02:42 +01:00
|
|
|
|
|
|
|
jobs:
|
|
|
|
build:
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
env:
|
|
|
|
JVM_OPTS: -Xmx6G
|
|
|
|
|
|
|
|
steps:
|
2021-03-26 19:12:19 +01:00
|
|
|
- name: Git Checkout
|
|
|
|
uses: actions/checkout@v2
|
|
|
|
with:
|
|
|
|
submodules: recursive
|
2019-12-11 18:02:42 +01:00
|
|
|
|
2021-03-26 19:12:19 +01:00
|
|
|
- name: Restore Gradle Cache
|
2022-04-07 11:21:01 +02:00
|
|
|
uses: actions/cache@v3
|
2021-03-26 19:12:19 +01:00
|
|
|
with:
|
|
|
|
path: /root/.gradle/
|
|
|
|
key: ${{ runner.os }}-gradle-${{ hashFiles('**/build.gradle') }}
|
2019-12-11 18:02:42 +01:00
|
|
|
|
2021-03-26 19:12:19 +01:00
|
|
|
- name: Restore CXX Cache
|
2022-04-07 11:21:01 +02:00
|
|
|
uses: actions/cache@v3
|
2021-03-26 19:12:19 +01:00
|
|
|
with:
|
|
|
|
path: app/.cxx/
|
|
|
|
key: ${{ runner.os }}-cxx-${{ hashFiles('**/CMakeLists.txt') }}
|
2019-12-11 18:02:42 +01:00
|
|
|
|
2021-10-31 00:03:27 +02:00
|
|
|
- name: Install Ninja Build
|
2021-03-26 19:12:19 +01:00
|
|
|
run: |
|
|
|
|
sudo apt-get install -y ninja-build
|
2021-10-31 00:03:27 +02:00
|
|
|
ln -s /usr/bin/ninja .
|
|
|
|
|
|
|
|
- name: Install CMake & Android NDK
|
2022-03-29 10:26:36 +02:00
|
|
|
run: echo "yes" | $ANDROID_HOME/tools/bin/sdkmanager "cmake;3.18.1" "ndk;25.0.8221429" --channel=3 | grep -v = || true
|
2019-12-11 18:02:42 +01:00
|
|
|
|
2022-05-30 17:23:17 +02:00
|
|
|
- name: Decode Keystore
|
|
|
|
env:
|
|
|
|
KEYSTORE_ENCODED: ${{ secrets.KEYSTORE }}
|
|
|
|
run: echo $KEYSTORE_ENCODED | base64 --decode > "$HOME/keystore.jks"
|
|
|
|
|
2021-03-26 19:12:19 +01:00
|
|
|
- name: Android Assemble
|
2022-05-30 17:23:17 +02:00
|
|
|
env:
|
|
|
|
SIGNING_STORE_PASSWORD: ${{ secrets.SIGNING_STORE_PASSWORD }}
|
|
|
|
SIGNING_KEY_ALIAS: ${{ secrets.SIGNING_KEY_ALIAS }}
|
|
|
|
SIGNING_KEY_PASSWORD: ${{ secrets.SIGNING_KEY_PASSWORD }}
|
2021-04-03 22:58:49 +02:00
|
|
|
run: ./gradlew --stacktrace assemble
|
2019-12-11 18:02:42 +01:00
|
|
|
|
2022-05-30 17:40:22 +02:00
|
|
|
- name: Rename APKs
|
|
|
|
run: |
|
|
|
|
mv app/build/outputs/apk/debug/app-debug.apk skyline-$GITHUB_RUN_NUMBER-debug.apk
|
|
|
|
mv app/build/outputs/apk/release/app-release.apk skyline-$GITHUB_RUN_NUMBER-release.apk
|
|
|
|
|
2021-03-26 19:12:19 +01:00
|
|
|
- name: Upload Debug APK
|
2022-05-30 17:40:22 +02:00
|
|
|
uses: actions/upload-artifact@v3
|
2021-03-26 19:12:19 +01:00
|
|
|
with:
|
2022-05-30 17:40:22 +02:00
|
|
|
name: skyline-${{ github.run_number }}-debug.apk
|
|
|
|
path: skyline-${{ github.run_number }}-debug.apk
|
2019-12-11 18:02:42 +01:00
|
|
|
|
2021-03-26 19:12:19 +01:00
|
|
|
- name: Upload Release APK
|
2022-05-30 17:40:22 +02:00
|
|
|
uses: actions/upload-artifact@v3
|
2021-03-26 19:12:19 +01:00
|
|
|
with:
|
2022-05-30 17:40:22 +02:00
|
|
|
name: skyline-${{ github.run_number }}-release.apk
|
|
|
|
path: skyline-${{ github.run_number }}-release.apk
|
2019-12-11 18:02:42 +01:00
|
|
|
|
2021-03-26 19:12:19 +01:00
|
|
|
- name: Delete Build Folder
|
|
|
|
run: rm -rf app/build/
|