-
Notifications
You must be signed in to change notification settings - Fork 4
79 lines (69 loc) · 2.21 KB
/
ci.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
name: Android CI
on:
push:
branches:
- master
- develop
- testing
jobs:
unit_tests:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Set up JDK 17
uses: actions/setup-java@v3
with:
distribution: 'temurin'
java-version: 17
- name: Run Unit Tests
run: ./gradlew testDebugUnitTest
android_tests:
runs-on: macos-12
steps:
- uses: actions/checkout@v3
- name: Set up JDK 17
uses: actions/setup-java@v3
with:
distribution: 'temurin'
java-version: 17
- name: Start Emulator and Run Instrumented Tests
uses: reactivecircus/android-emulator-runner@v2
with:
api-level: 29
script: ./gradlew connectedDebugAndroidTest
build_and_release:
runs-on: ubuntu-latest
needs: [unit_tests, android_tests]
steps:
- uses: actions/checkout@v3
- name: Set up JDK 17
uses: actions/setup-java@v3
with:
java-version: '17'
distribution: 'temurin'
cache: gradle
- name: Decode keystore
run: echo "${{ secrets.KEYSTORE_BASE64 }}" | base64 -d > ${{ github.workspace }}/key_store.jks
- name: Setup Gradle
uses: gradle/gradle-build-action@v2
- name: Build app
run: ./gradlew assembleRelease
env:
KEYSTORE_PATH: ${{ github.workspace }}/key_store.jks
RELEASE_STORE_PASSWORD: ${{ secrets.RELEASE_STORE_PASSWORD }}
RELEASE_KEY_ALIAS: ${{ secrets.RELEASE_KEY_ALIAS }}
RELEASE_KEY_PASSWORD: ${{ secrets.RELEASE_KEY_PASSWORD }}
- name: Retrieve Version
run: echo "APP_VERSION_NAME=$(grep '^versionName=' gradle.properties | cut -d'=' -f2)" >> $GITHUB_ENV
- name: Create Release on GitHub
uses: softprops/action-gh-release@v1
if: github.ref == 'refs/heads/master'
env:
GITHUB_TOKEN: ${{ secrets.SHIORI_TOKEN }}
with:
tag_name: v${{ env.APP_VERSION_NAME }}
name: Release - v${{ env.APP_VERSION_NAME }}
generate_release_notes: true
prerelease: false
files: |
presentation/build/outputs/apk/release/*.apk