forked from RikkaApps/Shizuku
-
Notifications
You must be signed in to change notification settings - Fork 3
87 lines (84 loc) · 3.42 KB
/
app.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
name: App
on:
push:
branches: [ master ]
paths-ignore:
- '.github/ISSUE_TEMPLATE'
jobs:
build:
runs-on: ubuntu-20.04
if: ${{ !startsWith(github.event.head_commit.message, '[skip ci]') && github.repository_owner == 'RikkaApps' }}
steps:
- name: Checkout
uses: actions/checkout@v3
with:
submodules: 'recursive'
fetch-depth: 0
- name: Setup Java
uses: actions/setup-java@v3
with:
distribution: 'temurin'
java-version: '17'
cache: 'gradle'
- name: Write key
if: github.event_name != 'pull_request' && github.ref == 'refs/heads/master'
run: |
touch signing.properties
echo KEYSTORE_PASSWORD=${{ secrets.KEYSTORE_PASSWORD }} >> signing.properties
echo KEYSTORE_ALIAS=${{ secrets.KEYSTORE_ALIAS }} >> signing.properties
echo KEYSTORE_ALIAS_PASSWORD='${{ secrets.KEYSTORE_ALIAS_PASSWORD }}' >> signing.properties
echo KEYSTORE_FILE=../key.jks >> signing.properties
echo ${{ secrets.KEYSTORE }} | base64 --decode > key.jks
- name: Write temporary key
if: hashFiles('key.jks') == '' && !steps.vars.outputs.HAS_SECRET
run: |
keytool -genkey -alias a -dname CN=_ -storepass passwd -keypass passwd -keystore key.jks
echo KEYSTORE_PASSWORD=passwd >> signing.properties
echo KEYSTORE_ALIAS=a >> signing.properties
echo KEYSTORE_ALIAS_PASSWORD=passwd >> signing.properties
echo KEYSTORE_FILE=../key.jks >> signing.properties
- name: Cache Gradle Dependencies
uses: actions/cache@v3
with:
path: |
~/.gradle/caches
~/.gradle/wrapper
!~/.gradle/caches/build-cache-*
key: gradle-deps-app-${{ hashFiles('**/build.gradle') }}
restore-keys: |
gradle-deps
- name: Cache Gradle Build
uses: actions/cache@v3
with:
path: |
~/.gradle/caches/build-cache-*
key: gradle-builds-app-${{ github.sha }}
restore-keys: |
gradle-builds
- name: Build with Gradle
id: buildWithGradle
run: |
echo 'org.gradle.caching=true' >> gradle.properties
echo 'org.gradle.parallel=true' >> gradle.properties
echo 'org.gradle.vfs.watch=true' >> gradle.properties
echo 'org.gradle.jvmargs=-Xmx2048m' >> gradle.properties
./gradlew :manager:assembleRelease :manager:assembleDebug
releaseName=`ls manager/build/outputs/apk/release/shizuku*-v*-release.apk | awk -F '(/|.apk)' '{print $6}'` && echo "releaseName=$releaseName" >> $GITHUB_OUTPUT
debugName=`ls manager/build/outputs/apk/debug/shizuku*-v*-debug.apk | awk -F '(/|.apk)' '{print $6}'` && echo "debugName=$debugName" >> $GITHUB_OUTPUT
- name: Upload release
if: success()
uses: actions/upload-artifact@v3
with:
name: ${{ steps.buildWithGradle.outputs.releaseName }}
path: "manager/build/outputs/apk/release/*.apk"
- name: Upload debug
if: success()
uses: actions/upload-artifact@v3
with:
name: ${{ steps.buildWithGradle.outputs.debugName }}
path: "manager/build/outputs/apk/debug/*.apk"
- name: Upload mappings
uses: actions/upload-artifact@v3
with:
name: mappings
path: "manager/build/outputs/mapping/release"