forked from strato-emu/strato
-
Notifications
You must be signed in to change notification settings - Fork 1
85 lines (72 loc) · 3.02 KB
/
build.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
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
# A workflow to verify the build on every push to the master branch
name: Build
on:
push:
branches: [ master ]
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Git Checkout
uses: actions/checkout@v4
with:
submodules: recursive
- name: Restore CCache
uses: hendrikmuhs/[email protected]
with:
max-size: 3Gi
- name: Restore Gradle Cache
uses: actions/cache@v4
with:
path: ~/.gradle/
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-
- name: Set up Java
uses: actions/setup-java@v4
with:
java-version: 17
distribution: "temurin"
- name: Install Ninja Build
run: |
sudo apt-get install -y ninja-build
ln -s /usr/bin/ninja .
- name: Decode Keystore
env:
KEYSTORE_ENCODED: ${{ secrets.KEYSTORE }}
run: echo $KEYSTORE_ENCODED | base64 --decode > "/home/runner/keystore.jks"
- name: Android Assemble
env:
SIGNING_STORE_PATH: "/home/runner/keystore.jks"
SIGNING_STORE_PASSWORD: ${{ secrets.SIGNING_STORE_PASSWORD }}
SIGNING_KEY_ALIAS: ${{ secrets.SIGNING_KEY_ALIAS }}
SIGNING_KEY_PASSWORD: ${{ secrets.SIGNING_KEY_PASSWORD }}
CMAKE_C_COMPILER_LAUNCHER: "ccache"
CMAKE_CXX_COMPILER_LAUNCHER: "ccache"
CCACHE_COMPILERCHECK: "string:${{ env.NDK_VERSION }}"
run: |
./gradlew --stacktrace --configuration-cache --build-cache --parallel --configure-on-demand assembleMainlineRelease
# ./gradlew --stacktrace --configuration-cache --build-cache --parallel --configure-on-demand assembleMainlineRelease assembleDevReldebug
- name: Compute git short sha
shell: bash
run: echo "git_short_sha=$(git rev-parse --short HEAD)" >> $GITHUB_ENV
# - if : failure()
# uses: actions/upload-artifact@v4
# with:
# name: strato-${{ env.git_short_sha }}-failed-build-report.zip
# path: /home/runner/work/stratos/stratos/build/reports/*
# - if : success()
# uses: actions/upload-artifact@v4
# with:
# name: strato-${{ env.git_short_sha }}-success-build-report.zip
# path: /home/runner/work/stratos/stratos/build/reports/configuration-cache/*
- uses: actions/upload-artifact@v4
with:
name: strato-${{ env.git_short_sha }}-release.apk
path: app/build/outputs/apk/mainline/release/app-mainline-release.apk
# - uses: actions/upload-artifact@v4
# with:
# name: strato-${{ env.git_short_sha }}-debug.apk
# path: app/build/outputs/apk/dev/reldebug/app-dev-reldebug.apk