-
-
Notifications
You must be signed in to change notification settings - Fork 9
88 lines (76 loc) · 2.64 KB
/
ci_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
name: CI Build
on:
workflow_dispatch:
push:
branches: [ main ]
tags: [ v* ]
paths-ignore:
- '*.md'
- '.github/**'
- '!.github/workflows/**'
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Write key
run: |
if [ ! -z "${{ secrets.KEY_STORE }}" ]; then
echo androidStorePassword='${{ secrets.KEY_STORE_PASSWORD }}' >> gradle.properties
echo androidKeyAlias='${{ secrets.ALIAS }}' >> gradle.properties
echo androidKeyPassword='${{ secrets.KEY_PASSWORD }}' >> gradle.properties
echo androidStoreFile='key.jks' >> gradle.properties
echo ${{ secrets.KEY_STORE }} | base64 --decode > key.jks
fi
- name: Checkout libxposed/api
uses: actions/checkout@v4
with:
repository: libxposed/api
path: libxposed/api
- name: Checkout libxposed/service
uses: actions/checkout@v4
with:
repository: libxposed/service
path: libxposed/service
- name: Setup Java
uses: actions/setup-java@v4
with:
distribution: "temurin"
java-version: "21"
- name: Setup Gradle
uses: gradle/gradle-build-action@v2
with:
gradle-home-cache-cleanup: true
- name: Build dependencies
working-directory: libxposed
run: |
echo 'org.gradle.caching=true' >> ~/.gradle/gradle.properties
echo 'org.gradle.parallel=true' >> ~/.gradle/gradle.properties
echo 'org.gradle.jvmargs=-Xmx2048m -Dfile.encoding=UTF-8 -XX:+UseParallelGC' >> ~/.gradle/gradle.properties
echo 'android.native.buildOutput=verbose' >> ~/.gradle/gradle.properties
cd api
./gradlew publishToMavenLocal
cd ../service
./gradlew publishToMavenLocal
- name: Setup Java
uses: actions/setup-java@v4
with:
distribution: "temurin"
java-version: "17"
- name: Build with Gradle
run: |
./gradlew :app:assembleRelease
echo "RELEASE_APK_PATH=$(find app/build/outputs/apk/release -name '*.apk')" >> $GITHUB_ENV
if [ "${{ github.ref_type }}" == "tag" ]; then
echo "NAME_SUFFIX=${{ github.ref_name }}" >> $GITHUB_ENV
else
echo "NAME_SUFFIX=${{ github.event.head_commit.id }}" >> $GITHUB_ENV
fi
- name: Upload Artifacts
uses: actions/upload-artifact@v4
with:
path: ${{ env.RELEASE_APK_PATH }}
name: MiCTS_${{ env.NAME_SUFFIX }}