forked from osfans/trime
-
Notifications
You must be signed in to change notification settings - Fork 1
79 lines (67 loc) · 2.1 KB
/
commit-ci.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
name: commit ci
on: [push]
env:
CI_NAME: Commit CI
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout last commit
uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Get branch name
id: vars
run: |
echo ${GITHUB_REF#refs/*/}
echo CI_BRANCH=${GITHUB_REF#refs/*/} >> $GITHUB_ENV
- name: Calculate JNI cache hash
id: cache-hash
run: script/cache-hash.sh
- name: Fetch JNI cache
uses: actions/cache@v3
id: jni-cache
with:
path: "app/prebuilt"
key: jni-debug-${{ steps.cache-hash.outputs.hash }}
- name: Fetch submodules
if: ${{ !steps.jni-cache.outputs.cache-hit }}
run: |
git submodule update --init --recursive
- name: Setup Java
uses: actions/setup-java@v3
with:
distribution: "temurin"
java-version: 17
# will restore cache of dependencies and wrappers
cache: 'gradle'
- name: Setup Android SDK
uses: android-actions/setup-android@v2
- name: Install dependency
run: ./script/dependency.sh
- name: Build Trime
run: make debug
- name: Add JNI cache
if: ${{ !steps.jni-cache.outputs.cache-hit }}
run: cp -R app/build/intermediates/stripped_native_libs/debug/out/lib app/prebuilt
- name: Upload Trime artifact
uses: actions/upload-artifact@v3
with:
name: trime
path: app/build/outputs/apk/**/*.apk
# keep 90 days
retention-days: 90
- name: Upload Trime artifact (ARM64_V8A only)
uses: actions/upload-artifact@v3
with:
name: trime_arm64_v8a
path: app/build/outputs/apk/**/*arm64-v8a-debug.apk
# keep 90 days
retention-days: 90
- name: Upload jni artifact (librime_jni.so)
uses: actions/upload-artifact@v3
with:
name: librime_jni
path: app/build/intermediates/stripped_native_libs/debug/out/lib/*
# keep 90 days
retention-days: 90