-
Notifications
You must be signed in to change notification settings - Fork 0
38 lines (35 loc) · 1.27 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
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: 11
- run: ./gradlew build --stacktrace
- uses: actions/upload-artifact@v2
with:
name: build
path: app/build/outputs/apk/debug/app-debug.apk
- if: startsWith(github.ref, 'refs/tags/')
run: |
cd app/build/outputs/apk/release
echo $RELEASE_KEY | base64 -d > release-key.jks
jarsigner -verbose -sigalg SHA1withRSA -digestalg SHA1 -keystore release-key.jks -storepass $STOREPASS -keypass $KEYPASS app-release-unsigned.apk np2p
jarsigner -verify app-release-unsigned.apk
sudo apt-get install zipalign -y
zipalign -v 4 app-release-unsigned.apk np2p.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: app/build/outputs/apk/release/np2p.apk
tag: ${{ github.ref }}
overwrite: true