-
-
Notifications
You must be signed in to change notification settings - Fork 30
89 lines (76 loc) · 2.81 KB
/
android-build.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
80
81
82
83
84
85
86
87
88
name: "Build: Android"
on:
workflow_dispatch:
keystore:
type: string
description: base64 keystore
workflow_call:
push:
branches: [ "main" ]
pull_request:
branches: [ "main" ]
env:
KEY_ALIAS: ${{ secrets.KEY_ALIAS }}
KEY_PASS: ${{ secrets.KEY_PASS }}
KEY_STORE_PASS: ${{ secrets.KEY_STORE_PASS }}
KEYSTORE: ${{ secrets.KEYSTORE }}
jobs:
build-android:
runs-on: ubuntu-latest
steps:
- name: 'Checkout'
uses: actions/checkout@v3
- name: 'Install yarn Dependencies'
run: |
yarn install
- uses: actions/setup-java@v3
with:
distribution: temurin
java-version: 19
- name: Setup Gradle
uses: gradle/gradle-build-action@v2
- name: Decode Keystore
id: decode_keystore
uses: timheuer/[email protected]
with:
fileName: 'keystore.jks'
fileDir: './'
encodedString: ${{ env.KEYSTORE }}
- name: 'Build Android Release'
run: |
cd android
./gradlew assembleRelease
- name: 'Check for non-FOSS libraries'
run: |
wget https://github.com/iBotPeaches/Apktool/releases/download/v2.7.0/apktool_2.7.0.jar
wget https://github.com/iBotPeaches/Apktool/raw/master/scripts/linux/apktool
# clone the repo
git clone https://gitlab.com/IzzyOnDroid/repo.git
# create a directory for Apktool and move the apktool* files there
mkdir -p repo/lib/radar/tool
mv apktool* repo/lib/radar/tool
# create an alias for ease of use
chmod u+x repo/lib/radar/tool/apktool
mv repo/lib/radar/tool/apktool_2.7.0.jar repo/lib/radar/tool/apktool.jar
repo/bin/scanapk.php android/app/build/outputs/apk/release/app-universal-release.apk
- name: 'Get Commit Hash'
id: commit
uses: pr-mpt/actions-commit-hash@v1
- name: 'Upload universal .apk Release Artifac'
uses: actions/upload-artifact@v3
if: ${{ github.event_name != 'pull_request' }}
with:
name: nostros-${{ github.ref_name }}-universal.apk
path: android/app/build/outputs/apk/release/app-universal-release.apk
- name: 'Upload arm64-v8a .apk Release Artifac'
uses: actions/upload-artifact@v3
if: ${{ github.event_name != 'pull_request' }}
with:
name: nostros-${{ github.ref_name }}-arm64-v8a.apk
path: android/app/build/outputs/apk/release/app-arm64-v8a-release.apk
- name: 'Upload armeabi-v7a .apk Release Artifac'
uses: actions/upload-artifact@v3
if: ${{ github.event_name != 'pull_request' }}
with:
name: nostros-${{ github.ref_name }}-armeabi-v7a.apk
path: android/app/build/outputs/apk/release/app-armeabi-v7a-release.apk