-
Notifications
You must be signed in to change notification settings - Fork 0
63 lines (63 loc) · 2.28 KB
/
deploy.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
name: CD
'on':
push:
branches:
- master
tags:
- v*
env:
GOOGLE_SERVICES_JSON: ${{ secrets.GOOGLE_SERVICES_JSON }}
KEYSTORE_FILE: ${{ secrets.KEYSTORE_FILE }}
KEYSTORE_PROPERTIES: ${{ secrets.KEYSTORE_PROPERTIES }}
SERVICE_ACCOUNT_JSON: ${{ secrets.SERVICE_ACCOUNT_JSON }}
jobs:
release:
runs-on: ubuntu-latest
if: startsWith(github.ref, 'refs/tags/')
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup Java
uses: actions/setup-java@v4
with:
distribution: zulu
java-version: '17'
- name: Create keystore file
run: echo $KEYSTORE_FILE | base64 -di > ${{ github.workspace }}/app/release.jks
- name: Create keystore.properties file
run: echo $KEYSTORE_PROPERTIES | base64 -di > ${{ github.workspace }}/keystore.properties
- name: Create Google Services JSON
run: |
mkdir ${{ github.workspace }}/app/src/prod
echo $GOOGLE_SERVICES_JSON | base64 -di > ${{ github.workspace }}/app/src/prod/google-services.json
- name: Create service account JSON
run: echo $SERVICE_ACCOUNT_JSON | base64 -di > ${{ github.workspace }}/service-account.json
- name: Build release APK
uses: gradle/gradle-build-action@v2.11.1
with:
arguments: ':app:assembleProdRelease'
- name: Build release bundle
uses: gradle/gradle-build-action@v2.11.1
with:
arguments: ':app:bundleProdRelease'
- name: Upload Release Build to Artifacts
uses: actions/upload-artifact@v4
with:
name: release-artifacts
path: |
app/build/outputs/apk/prod/release/
app/build/outputs/bundle/prodRelease/
- name: Create GitHub release
uses: softprops/action-gh-release@v1
with:
draft: true
files: app/build/outputs/apk/prod/release/app-prod-release.apk
generate_release_notes: true
- name: Upload app to Google Play
uses: r0adkll/upload-google-play@v1
with:
serviceAccountJson: ${{ github.workspace }}/service-account.json
packageName: com.toquete.boxbox
track: internal
status: draft
releaseFiles: app/build/outputs/bundle/prodRelease/app-prod-release.aab