-
-
Notifications
You must be signed in to change notification settings - Fork 0
75 lines (67 loc) · 2.34 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
name: Build
on:
push:
branches:
- 'main'
jobs:
Build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: kaisugi/[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@v4
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 App
id: build
run: bash ./gradlew assembleRelease
- name: Move files
if: ${{ steps.regex-match.outputs.match != '' }}
run: mv app/build/outputs/apk/release/app-release-unsigned.apk app/build/outputs/app-release.apk
- name: Sign App
if: ${{ steps.regex-match.outputs.match != '' }}
id: sign_app
uses: ilharp/[email protected]
with:
releaseDir: app/build/outputs
signingKey: ${{ secrets.SIGNINGKEYBASE64 }}
keyAlias: ${{ secrets.ALIAS }}
keyStorePassword: ${{ secrets.KEYSTOREPASSWORD }}
keyPassword: ${{ secrets.KEYPASSWORD }}
- name: Build Changelog
if: ${{ steps.regex-match.outputs.match != '' }}
id: changelog
uses: ardalanamini/auto-changelog@v4
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/[email protected]
with:
artifacts: "app/build/outputs/app-release-signed.apk"
body: ${{ steps.changelog.outputs.changelog }}
tag: ${{ github.event.head_commit.message }}
name: Release ${{ github.event.head_commit.message }}
token: ${{ secrets.GITHUB_TOKEN }}