-
Notifications
You must be signed in to change notification settings - Fork 7
42 lines (39 loc) · 1.55 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
on: [push, pull_request]
name: Build
jobs:
check:
name: Check
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/setup-java@v1
with:
java-version: 17
- run: |
git clone https://github.com/UnifiedPush/android-example example
cd example
sed -i -e '/delToDevFcm/d' -e 's-//toDevFcm//--' app/build.gradle settings.gradle
./gradlew assembleFcm --stacktrace
- uses: actions/upload-artifact@v2
with:
name: example
path: example/app/build/outputs/apk/fcm/debug/app-fcm-debug.apk
- if: startsWith(github.ref, 'refs/tags/')
run: |
cd example/app/build/outputs/apk/fcm/release/
echo $RELEASE_KEY | base64 -d > release-key.jks
jarsigner -verbose -sigalg SHA1withRSA -digestalg SHA1 -keystore release-key.jks -storepass $STOREPASS -keypass $KEYPASS app-fcm-release-unsigned.apk unifiedpush
jarsigner -verify app-fcm-release-unsigned.apk
sudo apt-get install zipalign -y
zipalign -v 4 app-fcm-release-unsigned.apk UP-Example-Fcm.apk
env:
RELEASE_KEY: ${{ secrets.RELEASE_KEY }}
KEYPASS: ${{ secrets.KEYPASS }}
STOREPASS: ${{ secrets.STOREPASS }}
- if: startsWith(github.ref, 'refs/tags/')
uses: svenstaro/upload-release-action@v2
with:
repo_token: ${{ secrets.GITHUB_TOKEN }}
file: example/app/build/outputs/apk/fcm/release/UP-Example-Fcm.apk
tag: ${{ github.ref }}
overwrite: true