-
-
Notifications
You must be signed in to change notification settings - Fork 0
80 lines (72 loc) · 2.52 KB
/
build.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
name: Build
on:
push:
branches:
- 'main'
jobs:
Build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions-ecosystem/[email protected]
id: regex-match
with:
text: ${{ github.event.head_commit.message }}
regex: '^v[0-9]+\.[0-9]+\.[0-9]+$'
- name: Setup JDK
uses: actions/setup-java@v3
with:
distribution: 'zulu'
java-version: '17'
cache: 'gradle'
- name: Access Api keys
env:
clientId: ${{ secrets.CLIENT_ID }}
clientSecret: ${{ secrets.CLIENT_SECRET }}
path: app/src/main/res/values/secrets.xml
run: |
touch $path
echo \<resources\> >> $path
echo \<string name=\"CLIENT_ID\"\>$clientId\</string\> >> $path
echo \<string name=\"CLIENT_SECRET\"\>$clientSecret\</string\> >> $path
echo \</resources\> >> $path
- name: Build APK
id: build
run: bash ./gradlew assembleRelease
- name: Sign APK
id: sign_apk
uses: r0adkll/sign-android-release@v1
with:
releaseDirectory: app/build/outputs/apk/release
signingKeyBase64: ${{ secrets.SIGNINGKEYBASE64 }}
alias: ${{ secrets.ALIAS }}
keyStorePassword: ${{ secrets.KEYSTOREPASSWORD }}
keyPassword: ${{ secrets.KEYPASSWORD }}
- name: Build Changelog
if: ${{ steps.regex-match.outputs.match != '' }}
id: changelog
uses: ardalanamini/auto-changelog@v3
with:
mention-authors: false
mention-new-contributors: false
include-compare: false
semver: false
- name: Create Release
if: ${{ steps.regex-match.outputs.match != '' }}
id: create_release
uses: ncipollo/release-action@v1
with:
body: ${{ steps.changelog.outputs.changelog }}
tag: ${{ github.event.head_commit.message }}
name: Release ${{ github.event.head_commit.message }}
token: ${{ secrets.GITHUB_TOKEN }}
- name: Upload APK
if: ${{ steps.regex-match.outputs.match != '' }}
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ github.token }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: ${{steps.sign_apk.outputs.signedReleaseFile}}
asset_name: app-release-signed-${{ github.event.head_commit.message }}.apk
asset_content_type: application/zip