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
|
2022-06-11 13:35:20 +02:00
|
|
|
IS_SKYLINE_SIGNED: ${{ secrets.KEYSTORE != '' }}
|
2019-12-11 18:02:42 +01:00
|
|
|
|
|
|
|
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:
|
2022-05-30 19:18:34 +02:00
|
|
|
path: ~/.gradle/
|
2022-05-30 20:58:40 +02:00
|
|
|
key: ${{ runner.os }}-gradle-${{ hashFiles('**/build.gradle') }}-${{ hashFiles('app/**/*.xml') }}-${{ hashFiles('app/**.kt', 'app/**.java') }}
|
|
|
|
restore-keys: |
|
|
|
|
${{ runner.os }}-gradle-${{ hashFiles('**/build.gradle') }}-${{ hashFiles('app/**/*.xml') }}-
|
|
|
|
${{ runner.os }}-gradle-${{ hashFiles('**/build.gradle') }}-
|
|
|
|
${{ runner.os }}-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:
|
2022-05-30 19:17:07 +02:00
|
|
|
path: |
|
|
|
|
app/.cxx/
|
|
|
|
app/build/intermediates/cxx/
|
2022-05-30 20:58:40 +02:00
|
|
|
key: ${{ runner.os }}-cxx-${{ hashFiles('app/**/CMakeLists.txt') }}-${{ hashFiles('app/**/*.h', 'app/**/*.hpp', 'app/**/*.cpp', 'app/**/*.S') }}
|
|
|
|
restore-keys: |
|
|
|
|
${{ runner.os }}-cxx-${{ hashFiles('app/**/CMakeLists.txt') }}-
|
|
|
|
${{ runner.os }}-cxx-
|
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
|
2022-06-11 13:35:20 +02:00
|
|
|
if: ${{ env.IS_SKYLINE_SIGNED == 'true' }}
|
2022-05-30 17:23:17 +02:00
|
|
|
env:
|
|
|
|
KEYSTORE_ENCODED: ${{ secrets.KEYSTORE }}
|
2022-06-11 13:35:20 +02:00
|
|
|
run: echo $KEYSTORE_ENCODED | base64 --decode > "/home/runner/keystore.jks"
|
2022-05-30 17:23:17 +02:00
|
|
|
|
2021-03-26 19:12:19 +01:00
|
|
|
- name: Android Assemble
|
2022-05-30 17:23:17 +02:00
|
|
|
env:
|
2022-06-11 13:35:20 +02:00
|
|
|
SIGNING_STORE_PATH: "/home/runner/keystore.jks"
|
2022-05-30 17:23:17 +02:00
|
|
|
SIGNING_STORE_PASSWORD: ${{ secrets.SIGNING_STORE_PASSWORD }}
|
|
|
|
SIGNING_KEY_ALIAS: ${{ secrets.SIGNING_KEY_ALIAS }}
|
|
|
|
SIGNING_KEY_PASSWORD: ${{ secrets.SIGNING_KEY_PASSWORD }}
|
2022-05-30 19:18:34 +02:00
|
|
|
run: ./gradlew --stacktrace --configuration-cache --build-cache --parallel --configure-on-demand assemble
|
2019-12-11 18:02:42 +01:00
|
|
|
|
2022-06-11 13:35:20 +02:00
|
|
|
- name: Rename APKs (Signed)
|
|
|
|
if: ${{ env.IS_SKYLINE_SIGNED == 'true' }}
|
2022-05-30 17:40:22 +02:00
|
|
|
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
|
|
|
|
|
2022-06-11 13:35:20 +02:00
|
|
|
- name: Upload Signed Debug APK
|
|
|
|
if: ${{ env.IS_SKYLINE_SIGNED == 'true' }}
|
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
|
|
|
|
2022-06-11 13:35:20 +02:00
|
|
|
- name: Upload Signed Release APK
|
|
|
|
if: ${{ env.IS_SKYLINE_SIGNED == 'true' }}
|
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
|
|
|
|
2022-06-11 13:35:20 +02:00
|
|
|
- name: Rename APKs (Unsigned)
|
|
|
|
if: ${{ env.IS_SKYLINE_SIGNED == 'false' }}
|
|
|
|
run: |
|
|
|
|
mv app/build/outputs/apk/debug/app-debug.apk skyline-$GITHUB_RUN_NUMBER-unsigned-debug.apk
|
|
|
|
mv app/build/outputs/apk/release/app-release.apk skyline-$GITHUB_RUN_NUMBER-unsigned-release.apk
|
|
|
|
|
|
|
|
- name: Upload Unsigned Debug APK
|
|
|
|
if: ${{ env.IS_SKYLINE_SIGNED == 'false' }}
|
|
|
|
uses: actions/upload-artifact@v3
|
|
|
|
with:
|
|
|
|
name: skyline-${{ github.run_number }}-unsigned-debug.apk
|
|
|
|
path: skyline-${{ github.run_number }}-unsigned-debug.apk
|
|
|
|
|
|
|
|
- name: Upload Unsigned Release APK
|
|
|
|
if: ${{ env.IS_SKYLINE_SIGNED == 'false' }}
|
|
|
|
uses: actions/upload-artifact@v3
|
|
|
|
with:
|
|
|
|
name: skyline-${{ github.run_number }}-unsigned-release.apk
|
|
|
|
path: skyline-${{ github.run_number }}-unsigned-release.apk
|