-
Notifications
You must be signed in to change notification settings - Fork 0
94 lines (90 loc) · 3.46 KB
/
push.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
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
name: Build
on:
push:
branches: [ "dev", "main" ]
pull_request:
branches: [ "dev", "main" ]
workflow_dispatch:
jobs:
debug:
name: Build Apk
runs-on: ubuntu-latest
steps:
- run: echo "The job was automatically triggered by a ${{ github.event_name }} event"
- run: echo "This job is running on a ${{ runner.os }} server hosted by GitHub!"
- uses: actions/checkout@v3
- run: echo "The ${{ github.repository }} repository has been cloned"
- run: echo "Setting up JDK"
- name: set up JDK 17
uses: actions/setup-java@v3
with:
java-version: '17'
distribution: 'temurin'
cache: gradle
- run: java --version
- run: env
- run: echo "JDK 17 has been set up"
- name: Set up keystore
run: |
echo "${{ secrets.PILLAPP_KEYSTORE }}" > app/keystore.jks.asc
gpg -d --passphrase "${{ secrets.STORE_DECRYPT_KEY }}" --batch app/keystore.jks.asc > app/keystore.jks
- run: echo "Keystore has been set up"
- name: Set up local.properties
run: |
echo "${{ secrets.LOCAL_PROPERTIES }}" > local.properties.asc
gpg -d --passphrase "${{ secrets.STORE_DECRYPT_KEY }}" --batch local.properties.asc > local.properties
- run: echo "local.properties has been set up"
- run: echo "Ready to build"
- name: Grant execute permission for gradlew
run: chmod +x gradlew
- run: echo "Building Debug APK."
- name: Build with Gradle
run: ./gradlew build
- run: echo "Build status report=${{ job.status }}."
- uses: actions/upload-artifact@v3
with:
name: PillApp-${{ github.run_number }}.apk
path: app/build/outputs/apk/debug/*.apk
- uses: actions/upload-artifact@v3
with:
name: PillApp-${{ github.run_number }}.apk
path: app/build/outputs/apk/release/*.apk
build:
name: Generate App Bundle
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: set up JDK 17
uses: actions/setup-java@v3
with:
java-version: '17'
distribution: 'temurin'
cache: gradle
- name: Set up keystore
run: |
echo "${{ secrets.PILLAPP_KEYSTORE }}" > app/keystore.jks.asc
gpg -d --passphrase "${{ secrets.STORE_DECRYPT_KEY }}" --batch app/keystore.jks.asc > app/keystore.jks
- run: echo "Keystore has been set up"
- name: Set up local.properties
run: |
echo "${{ secrets.LOCAL_PROPERTIES }}" > local.properties.asc
gpg -d --passphrase "${{ secrets.STORE_DECRYPT_KEY }}" --batch local.properties.asc > local.properties
- run: echo "local.properties has been set up"
- run: chmod +x gradlew
- name: Bundle 'release' with Gradle
run: ./gradlew assembleRelease
- name: Sign AAB
id: sign_aab
uses: r0adkll/sign-android-release@v1
with:
releaseDirectory: app/release
signingKeyBase64: ${{ secrets.SIGNING_KEY_STORE_BASE64 }}
alias: ${{ secrets.SIGNING_KEY_ALIAS }}
keyStorePassword: ${{ secrets.SIGNING_STORE_PASSWORD }}
keyPassword: ${{ secrets.SIGNING_KEY_PASSWORD }}
- run: echo "Build status report=${{ job.status }}."
- name: Upload App Bundle
uses: actions/upload-artifact@v1
with:
name: PillApp-${{ github.run_number }}.aab
path: ${{steps.sign_aab.outputs.signedReleaseFile}}