-
Notifications
You must be signed in to change notification settings - Fork 0
106 lines (93 loc) · 3.32 KB
/
master.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
name: Release App
on:
push:
branches:
- master
tags:
- 'v*'
- '!*alpha*'
- '!*beta*'
- '!*rc*'
permissions:
contents: write
# jobs are run in parallel on different machines
# all steps run in series
jobs:
release:
name: Release App
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Setup build tool version variable
shell: bash
run: |
BUILD_TOOL_VERSION=$(ls /usr/local/lib/android/sdk/build-tools/ | tail -n 1)
echo "BUILD_TOOL_VERSION=$BUILD_TOOL_VERSION" >> $GITHUB_ENV
echo Last build tool version is: $BUILD_TOOL_VERSION
- name: Set up JDK
uses: actions/setup-java@v3
with:
distribution: 'temurin' #Eclipse
java-version: '17'
- name: Make gradlew executable
run: chmod +x ./gradlew
- name: Run Linters and Test
run: ./gradlew check
- name: Upload Reports if not tag
uses: actions/upload-artifact@v3
if: startsWith(github.ref, 'refs/tags/') == false
with:
name: test-reports
path: app/build/reports
- name: Zip Test Results
uses: montudor/action-zip@v1
if: startsWith(github.ref, 'refs/tags/')
with:
args: zip -qq -r test-reports.zip app/build/reports
- name: Build with Gradle
if: startsWith(github.ref, 'refs/tags/')
run: ./gradlew build
# Waiting Play Store integration..
# - name: Build Release AAB
# run: ./gradlew bundleRelease
#path app/build/outputs/bundle/release/app-release.aab
- name: Build Release APK
if: startsWith(github.ref, 'refs/tags/')
run: ./gradlew assembleRelease --stacktrace
#path app/build/outputs/apk/release/app-release-unsigned.apk
- name: Rename Release APK
#skip app-release-unsigned-signed.apk case
if: startsWith(github.ref, 'refs/tags/')
run: mv app/build/outputs/apk/release/app-release-unsigned.apk app/build/outputs/apk/release/app-release.apk
- name: Sign APK Release
id: sign_apk
uses: r0adkll/sign-android-release@v1
if: startsWith(github.ref, 'refs/tags/')
with:
releaseDirectory: app/build/outputs/apk/release
signingKeyBase64: ${{ secrets.KEY_STORE_FILE }}
keyStorePassword: ${{ secrets.KEY_STORE_PASSWORD }}
alias: ${{ secrets.KEY_ALIAS }}
keyPassword: ${{ secrets.KEY_PASSWORD }}
env:
BUILD_TOOLS_VERSION: ${{ env.BUILD_TOOL_VERSION }}
# Waiting Play Store integration..
# - name: Sign AAB
# id: sign_aab
# uses: r0adkll/sign-android-release@v1
# with:
# releaseDirectory: app/build/outputs/bundle/release
# signingKeyBase64: ${{ secrets.KEY_STORE_FILE }}
# keyStorePassword: ${{ secrets.KEY_STORE_PASSWORD }}
# alias: ${{ secrets.KEY_ALIAS }}
# keyPassword: ${{ secrets.KEY_PASSWORD }}
#path ${{steps.sign_aab.outputs.signedReleaseFile}}
- name: Release
uses: softprops/action-gh-release@v1
if: startsWith(github.ref, 'refs/tags/')
with:
name: Release ${{ github.ref_name }}
files: |
${{steps.sign_apk.outputs.signedReleaseFile}}
test-reports.zip