-
Notifications
You must be signed in to change notification settings - Fork 39
75 lines (64 loc) · 2.3 KB
/
android.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
name: Android CI
on:
push:
branches: [ master ]
paths-ignore:
- "README.md"
pull_request:
workflow_dispatch:
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
with:
submodules: true
- name: Write key
if: ${{ github.event_name != 'pull_request' || github.ref_type == 'tag' }}
run: |
if [ ! -z "${{ secrets.SIGNING_KEY }}" ]; then
echo androidStorePassword='${{ secrets.KEY_STORE_PASSWORD }}' >> local.properties
echo androidKeyAlias='xiao_wine' >> local.properties
echo androidKeyPassword='${{ secrets.KEY_STORE_PASSWORD }}' >> local.properties
echo androidStoreFile=`pwd`/key.jks >> local.properties
echo ${{ secrets.SIGNING_KEY }} | base64 --decode > key.jks
fi
- name: Setup JDK
uses: actions/setup-java@v4
with:
distribution: 'zulu'
java-version: 21
- name: Setup Gradle
uses: gradle/actions/setup-gradle@v4
with:
cache-read-only: ${{ github.ref != 'refs/heads/master' }}
- name: Build with Gradle
run: |
mkdir -p ./doc
echo "$(echo `(cat ./app/src/main/assets/app_rules.json)` | grep -o '"appRulesVersion": [0-9]*' | grep -o '[0-9]*')" > ./doc/app_rules_version
cp ./app/src/main/assets/app_rules.json ./doc/app_rules.json
wget -O ./doc/notice_list.json https://xiaowine.github.io/Lyric-Getter/notice_list.json
./gradlew assemble
./gradlew bundleRelease
- name: Deploy
if: ${{ github.event_name != 'pull_request' }}
uses: peaceiris/actions-gh-pages@v4
with:
github_token: ${{ github.token }}
publish_dir: ./doc
- name: Upload Release APK
uses: actions/upload-artifact@v4
with:
name: Lyric Getter release
path: ./app/build/outputs/apk/release
- name: Upload Debug APK
uses: actions/upload-artifact@v4
with:
name: Lyric Getter debug
path: ./app/build/outputs/apk/debug
- name: Upload Release Mapping
uses: actions/upload-artifact@v4
with:
name: Lyric Getter mapping
path: ./app/build/outputs/mapping/release/mapping.txt