-
Notifications
You must be signed in to change notification settings - Fork 1
56 lines (47 loc) · 1.9 KB
/
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
name: Android CI
on:
push:
branches: [ "main", "dev" ]
pull_request:
branches: [ "main", "dev" ]
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: set up JDK 11
uses: actions/setup-java@v3
with:
distribution: 'temurin'
java-version: '17'
cache: 'gradle'
- name: Grant execute permission for gradlew
run: chmod +x gradlew
- name: Add Properties to local.properties
run: |
echo ${{ secrets.DISCORD_BUG_WEBHOOK_EXTRA }} >> local.properties
echo "store_password = ${{ secrets.SIGNING_STORE_PASSWORD }}" >> local.properties
echo "key_alias = ${{ secrets.SIGNING_KEY_ALIAS }}" >> local.properties
echo "key_password = ${{ secrets.SIGNING_KEY_PASSWORD }}" >> local.properties
# Here we need to decode keystore.jks from base64 string and place it
# in the folder specified in the release signing configuration
- name: Decode Keystore
run: |
mkdir -p app/keystore
touch app/keystore/android_keystore.jks
echo ${{ secrets.KEYSTORE }} | base64 -d > app/keystore/android_keystore.jks
# Build and sign APK ("-x test" argument is used to skip tests)
- name: Build APK
run: ./gradlew :app:assembleDebug -x test
# Show information about the APK's signing certificates
#- name: Verify Signature
# run: $ANDROID_SDK_ROOT/build-tools/33.0.1/apksigner verify --print-certs app/build/outputs/apk/release/Chouten.apk
- name: Upload a Build Artifact
uses: actions/[email protected]
with:
name: Chouten
path: "app/build/outputs/apk/debug/app-debug.apk"
- name: Upload the APK to Discord
shell: bash
run: |
curl -F "debug=@app/build/outputs/apk/debug/app-debug.apk" ${{ secrets.DISCORD_WEBHOOK_URL }}