-
-
Notifications
You must be signed in to change notification settings - Fork 2
93 lines (79 loc) · 2.73 KB
/
build_push.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
name: CI
on:
push:
branches:
- main
- stable
tags:
- v*
pull_request:
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
build:
name: Build app
runs-on: ubuntu-latest
steps:
- name: Clone repo
uses: actions/checkout@v4
with:
submodules: 'recursive'
- name: Validate Gradle Wrapper
uses: gradle/wrapper-validation-action@v1
- name: Set up JDK
uses: actions/setup-java@v4
with:
java-version: 17
distribution: adopt
- name: Set up Node.js
uses: actions/setup-node@v4
with:
node-version: '16'
- name: Setup Gradle
uses: gradle/gradle-build-action@v2
- name: Build app
run: ./gradlew bundlePlaystoreRelease
# Sign app bundle and create release for tags
- name: Sign app bundle
if: startsWith(github.ref, 'refs/tags/') && github.repository == 'LiveTL/android'
uses: r0adkll/sign-android-release@v1
with:
releaseDirectory: app/build/outputs/bundle/playstoreRelease
signingKeyBase64: ${{ secrets.KEY_B64 }}
alias: ${{ secrets.ALIAS }}
keyStorePassword: ${{ secrets.PASSWORD }}
keyPassword: ${{ secrets.PASSWORD }}
- name: Prepare build metadata
if: startsWith(github.ref, 'refs/tags/') && github.repository == 'LiveTL/android'
run: |
set -x
echo "VERSION_TAG=${GITHUB_REF/refs\/tags\//}" >> $GITHUB_ENV
if [[ "${{ github.event.ref }}" =~ "-beta" ]]
then
echo "GOOGLE_PLAY_TRACK=beta" >> $GITHUB_ENV
else
echo "GOOGLE_PLAY_TRACK=production" >> $GITHUB_ENV
fi
- name: Create release
if: startsWith(github.ref, 'refs/tags/') && github.repository == 'LiveTL/android'
uses: softprops/action-gh-release@v1
with:
tag_name: ${{ env.VERSION_TAG }}
name: LiveTL for Android ${{ env.VERSION_TAG }}
files: |
${{ env.SIGNED_RELEASE_FILE }}
draft: true
prerelease: false
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Publish to Google Play
if: startsWith(github.ref, 'refs/tags/') && github.repository == 'LiveTL/android'
uses: r0adkll/[email protected]
with:
serviceAccountJsonPlainText: ${{ secrets.GOOGLE_PLAY_SERVICE_ACCOUNT_JSON }}
packageName: com.livetl.android
releaseFile: ${{ env.SIGNED_RELEASE_FILE }}
# mappingFile: app/build/outputs/mapping/playstoreRelease/mapping.txt
track: ${{ env.GOOGLE_PLAY_TRACK }}
whatsNewDirectory: distribution/whatsnew