forked from MiPushFramework/MiPushFramework
-
Notifications
You must be signed in to change notification settings - Fork 4
62 lines (52 loc) · 1.93 KB
/
main.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
on: [push, pull_request]
jobs:
build:
name: Build on ${{ matrix.os }}
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [ ubuntu-latest ]
steps:
- name: Check out
uses: actions/checkout@v2
- name: Gradle wrapper validation
uses: gradle/wrapper-validation-action@v1
- name: Set up JDK 8
uses: actions/setup-java@v1
with:
java-version: '8'
- name: Cache Gradle
uses: actions/cache@v2
with:
path: |
~/.gradle/caches
~/.gradle/wrapper
key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle') }}
restore-keys: ${{ runner.os }}-gradle-
- name: Make gradlew executable
run: chmod +x ./gradlew
- name: Build Release with Gradle
run: |
./gradlew exportVersion --daemon
./gradlew :push:assembleRelease --daemon --parallel
- name: Sign Apk
run: |
PASSWD=$(echo $RANDOM | md5sum | head -c 15)
ALIAS="random"
keytool -genkey -noprompt -v -keystore android.keystore -alias ${ALIAS} -keyalg RSA -keysize 2048 -validity 10000 -keypass ${PASSWD} -storepass ${PASSWD} -dname "CN=xx, OU=xx, O=xx, L=xx, S=xx, C=xx"
apksigner=${ANDROID_SDK_ROOT}/build-tools/30.0.3/apksigner
$apksigner sign --ks ./android.keystore \
--ks-pass pass:${PASSWD} \
--ks-key-alias ${ALIAS} \
--key-pass pass:${PASSWD} \
--in "./push/build/outputs/apk/release/push-release.apk" \
--out "./push/build/outputs/apk/release/push-release-signed.apk"
- name: List out dir
run: ls -l ./push/build/outputs/apk/release
- name: Upload build artifact
uses: actions/upload-artifact@v2
if: runner.os == 'Linux'
with:
name: SNAPSHOT
path: ./push/build/outputs/apk/release/