-
-
Notifications
You must be signed in to change notification settings - Fork 9
134 lines (114 loc) · 4.05 KB
/
publish.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
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
name: Deploy
on:
workflow_dispatch:
inputs:
track:
description: 'Release Track'
required: true
type: choice
default: production
options:
- production
- internal
push:
branches:
- master
paths:
- "**/src/main/**"
jobs:
preflight:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: diareuse/movie-metropolis/.github/actions/android@master
- uses: gradle/gradle-build-action@v3
with:
arguments: check
build-aab:
runs-on: ubuntu-latest
needs: preflight
steps:
- uses: actions/checkout@v4
- run: |
echo "${{ secrets.DEPLOY_SIGNING_KEY }}" | base64 --decode > keystore.jks
echo "${{ secrets.DEPLOY_SIGNING_PROPERTIES }}" | base64 --decode > keystore.properties
echo "${{ secrets.GOOGLE_SERVICES_JSON }}" | base64 --decode > app/google-services.json
echo "${{ secrets.SERVICE_ACCOUNT_JSON }}" | base64 --decode > service-account.json
echo "MM_BASIC_USER=${{ secrets.BASIC_USER }}" >> secrets.properties
echo "MM_BASIC_PASS=${{ secrets.BASIC_PASS }}" >> secrets.properties
echo "MM_CAPTCHA=${{ secrets.CAPTCHA }}" >> secrets.properties
echo "MM_TMDB=${{ secrets.TMDB }}" >> secrets.properties
- uses: lukasa1993/[email protected]
id: nextVersionCode
with:
serviceAccountJson: ./service-account.json
packageName: movie.metropolis.app
- run: |
versionNumber=${{steps.nextVersionCode.outputs.version}}
versionNumber=$(($versionNumber / 10 + 1))
sed -i "s/versionCode 1/versionCode $versionNumber/" buildSrc/src/main/groovy/movie.metropolis.app.gradle
- uses: diareuse/movie-metropolis/.github/actions/android@master
- name: Build with Gradle
uses: gradle/gradle-build-action@v3
with:
arguments: bundleRelease
- uses: actions/upload-artifact@v4
with:
name: release-bundle
path: |
app/**/*.aab
app/**/mapping.txt
if-no-files-found: error
- uses: actions/upload-artifact@v4
with:
name: release-wear-bundle
path: |
app-wear/**/*.aab
app-wear/**/mapping.txt
if-no-files-found: error
publish-wear:
runs-on: ubuntu-latest
needs: [ build-aab ]
steps:
- uses: actions/checkout@v4
- uses: actions/download-artifact@v4
with:
name: release-wear-bundle
- run: |
echo "${{ secrets.SERVICE_ACCOUNT_JSON }}" | base64 --decode > service-account.json
- id: track
run: |
TARGET_TRACK=${{ github.event.inputs.track }}
echo "track=${TARGET_TRACK:-"production"}" >> "$GITHUB_OUTPUT"
- uses: r0adkll/upload-google-play@v1
with:
serviceAccountJson: service-account.json
packageName: movie.metropolis.app
releaseFiles: build/outputs/bundle/release/*.aab
track: wear:${{ steps.track.outputs.track }}
status: completed
inAppUpdatePriority: 3
mappingFile: build/outputs/mapping/release/mapping.txt
publish-mobile:
runs-on: ubuntu-latest
needs: [ build-aab ]
steps:
- uses: actions/checkout@v4
- uses: actions/download-artifact@v4
with:
name: release-bundle
- run: |
echo "${{ secrets.SERVICE_ACCOUNT_JSON }}" | base64 --decode > service-account.json
- id: track
run: |
TARGET_TRACK=${{ github.event.inputs.track }}
echo "track=${TARGET_TRACK:-"production"}" >> "$GITHUB_OUTPUT"
- uses: r0adkll/upload-google-play@v1
with:
serviceAccountJson: service-account.json
packageName: movie.metropolis.app
releaseFiles: build/outputs/bundle/release/*.aab
track: ${{ steps.track.outputs.track }}
status: completed
inAppUpdatePriority: 3
mappingFile: build/outputs/mapping/release/mapping.txt