-
-
Notifications
You must be signed in to change notification settings - Fork 174
134 lines (131 loc) · 4.63 KB
/
gradle.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
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
name: Gradle
on:
push:
branches: [ develop ]
pull_request:
branches: [ develop ]
jobs:
build-develop:
runs-on: macos-latest
concurrency:
group: build-${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
env:
ACRA_EMAIL: ${{ secrets.ACRA_EMAIL }}
steps:
- uses: actions/checkout@v4
- name: Set up JDK 11
uses: actions/setup-java@v4
with:
java-version: '11'
distribution: 'adopt'
- name: Grant execute permission for gradlew
run: chmod +x gradlew
- name: Spotless
run: ./gradlew spotlessCheck
- name: Assemble
run: ./gradlew assembleDevelopDebug
- name: Unit tests
run: ./gradlew testDevelopDebugUnitTest
- name: Espresso tests
uses: reactivecircus/android-emulator-runner@v2
with:
api-level: 22
script: ./gradlew connectedDevelopDebugAndroidTest
- name: Generate coverage report
run: ./gradlew jacocoTestReport
- name: Upload codecov
uses: codecov/codecov-action@v3
with:
files: ./app/build/reports/jacoco/jacocoTestReport/jacocoTestReport.xml
- name: Upload Reports
uses: actions/upload-artifact@v4
if: always()
with:
name: Unit Test Reports
path: ${{ github.workspace }}/**/build/reports/**/*
retention-days: 5
publish-develop:
needs: build-develop
if: github.ref == 'refs/heads/develop'
runs-on: ubuntu-latest
concurrency:
group: publish-develop-${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
env:
ACRA_EMAIL: ${{ secrets.ACRA_EMAIL }}
steps:
- uses: actions/checkout@v4
- name: Set up JDK 11
uses: actions/setup-java@v4
with:
java-version: '11'
distribution: 'adopt'
- name: Grant execute permission for gradlew
run: chmod +x gradlew
- name: Extract upload store
run: 'echo "$UPLOAD_STORE_BASE64" | base64 --decode > app/upload-keystore.jks'
shell: bash
env:
UPLOAD_STORE_BASE64: ${{secrets.UPLOAD_STORE_BASE64}}
- name: Bundle develop
if: github.ref == 'refs/heads/develop'
run: ./gradlew :app:bundleDevelopRelease
env:
UPLOAD_KEYSTORE_PASSWORD: ${{secrets.UPLOAD_KEYSTORE_PASSWORD}}
UPLOAD_KEY_ALIAS: ${{secrets.UPLOAD_KEY_ALIAS}}
UPLOAD_KEY_PASSWORD: ${{secrets.UPLOAD_KEY_PASSWORD}}
- name: Publish develop to google play
if: github.ref == 'refs/heads/develop'
uses: r0adkll/[email protected]
continue-on-error: true
with:
serviceAccountJsonPlainText: ${{ secrets.SERVICE_ACCOUNT_JSON_PLAIN_TEXT }}
packageName: com.better.alarm
releaseFiles: app/build/outputs/bundle/developRelease/app-develop-release.aab
track: internal
inAppUpdatePriority: 2
# whatsNewDirectory: distribution/whatsnew
# mappingFile: app/build/outputs/mapping/release/mapping.txt
publish-premium:
needs: build-develop
if: github.ref == 'refs/heads/develop'
runs-on: ubuntu-latest
concurrency:
group: publish-premium-${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
env:
ACRA_EMAIL: ${{ secrets.ACRA_EMAIL }}
steps:
- uses: actions/checkout@v4
- name: Set up JDK 11
uses: actions/setup-java@v4
with:
java-version: '11'
distribution: 'adopt'
- name: Grant execute permission for gradlew
run: chmod +x gradlew
- name: Extract upload store
run: 'echo "$UPLOAD_STORE_BASE64" | base64 --decode > app/upload-keystore.jks'
shell: bash
env:
UPLOAD_STORE_BASE64: ${{secrets.UPLOAD_STORE_BASE64}}
- name: Bundle premium
if: github.ref == 'refs/heads/develop'
run: ./gradlew :app:bundlePremiumRelease
env:
UPLOAD_KEYSTORE_PASSWORD: ${{secrets.UPLOAD_KEYSTORE_PASSWORD}}
UPLOAD_KEY_ALIAS: ${{secrets.UPLOAD_KEY_ALIAS}}
UPLOAD_KEY_PASSWORD: ${{secrets.UPLOAD_KEY_PASSWORD}}
- name: Publish premium to google play
if: github.ref == 'refs/heads/develop'
uses: r0adkll/[email protected]
continue-on-error: true
with:
serviceAccountJsonPlainText: ${{ secrets.SERVICE_ACCOUNT_JSON_PLAIN_TEXT }}
packageName: com.premium.alarm
releaseFiles: app/build/outputs/bundle/premiumRelease/app-premium-release.aab
track: internal
inAppUpdatePriority: 2
# whatsNewDirectory: distribution/whatsnew
# mappingFile: app/build/outputs/mapping/release/mapping.txt