-
Notifications
You must be signed in to change notification settings - Fork 12
107 lines (91 loc) · 2.89 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
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
name: build
on:
workflow_call:
inputs:
branch:
required: true
type: string
secrets:
KEYSTORE:
required: true
KEYSTORE_KEY:
required: true
jobs:
ci-build:
name: Lygisk Build ${{ inputs.branch }}
runs-on: ubuntu-latest
env:
SCCACHE_DIRECT: false
steps:
- name: Checkout
uses: actions/checkout@v4
with:
ref: ci-build-${{ inputs.branch }}
submodules: 'recursive'
fetch-depth: 0
- name: Set up JDK 21
uses: actions/setup-java@v4
with:
distribution: 'temurin'
java-version: '21'
- name: Set up Python 3
uses: actions/setup-python@v5
with:
python-version: '3.x'
- name: Set up sccache
uses: hendrikmuhs/[email protected]
with:
variant: sccache
key: ${{ runner.os }}-${{ github.sha }}
restore-keys: ${{ runner.os }}
max-size: 10000M
- name: Cache Gradle dependencies
uses: actions/cache@v4
with:
path: |
~/.gradle/caches
~/.gradle/wrapper
!~/.gradle/caches/build-cache-*
key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle.kts') }}
restore-keys: ${{ runner.os }}-gradle-
- name: Cache build cache
uses: actions/cache@v4
with:
path: |
~/.gradle/caches/build-cache-*
key: gradle-build-cache-${{ github.sha }}
restore-keys: gradle-build-cache-
- name: Set up NDK
run: python build.py -v ndk
- name: Set version
if: inputs.branch == 'stable' || inputs.branch == 'beta'
run: |
VERSION_CODE=$(cat gradle.properties | grep 'magisk.versionCode' | cut -f2 -d '=')
echo version=v$(echo $VERSION_CODE | cut -c1-2).$(echo $VERSION_CODE | cut -c1-2 --complement) > config.prop
- name: Import signing config
run: |
echo "${{ secrets.KEYSTORE }}" | base64 -d > keystore.jks
echo "keyStore=keystore.jks" >> config.prop
echo "keyStorePass=${{ secrets.KEYSTORE_KEY }}" >> config.prop
echo "keyAlias=lygisk" >> config.prop
echo "keyPass=${{ secrets.KEYSTORE_KEY }}" >> config.prop
- name: Build release
run: |
python build.py -vr all
- name: Build debug
run: |
python build.py -v all
- name: Stop gradle daemon
run: ./gradlew --stop
- name: Upload build artifact
uses: actions/upload-artifact@v4
with:
name: ${{ inputs.branch }}
path: out
compression-level: 9
- name: Upload mapping and native debug symbols
uses: actions/upload-artifact@v4
with:
name: ${{ inputs.branch }}-symbols
path: app/apk/build/outputs
compression-level: 9