-
Notifications
You must be signed in to change notification settings - Fork 0
74 lines (61 loc) · 2.15 KB
/
build.yaml
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
name: Build and Release
on:
push:
branches:
- master
workflow_dispatch:
permissions:
contents: write
packages: write
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v2
- name: Set up JDK 17
uses: actions/setup-java@v2
with:
distribution: "zulu"
java-version: "17"
- name: Cache Gradle packages
uses: actions/cache@v2
with:
path: |
~/.gradle/caches
~/.gradle/wrapper
key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle*', '**/gradle-wrapper.properties') }}
restore-keys: ${{ runner.os }}-gradle-
- name: Decode and Set Up Keystore
run: |
echo "${{ secrets.KEYSTORE_BASE64_ENCODED }}" | base64 -d > keystore.jks
- name: Setup keystore.properties
run: |
echo "store.file=keystore.jks" >> keystore.properties
echo "store.password=${{ secrets.KEYSTORE_PASSWORD }}" >> keystore.properties
echo "key.alias=tutortoise" >> keystore.properties
echo "key.password=${{ secrets.KEY_PASSWORD }}" >> keystore.properties
- name: Setup local.properties
run: |
echo "base.url=${{ secrets.BASE_URL }}" >> local.properties
echo "google.oauth.client.id=${{ secrets.GOOGLE_OAUTH_CLIENT_ID }}" >> local.properties
- name: Build Release APK
run: ./gradlew assembleRelease
env:
CI: true
- name: List APK Directory Contents
run: ls -alh app/build/outputs/apk/release/
- name: Upload APK as Artifact
uses: actions/upload-artifact@v3
with:
name: app-release
path: app/build/outputs/apk/release/app-release.apk
- name: Upload APK to Release
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: app/build/outputs/apk/release/app-release.apk
asset_name: app-release.apk
asset_content_type: application/vnd.android.package-archive