-
Notifications
You must be signed in to change notification settings - Fork 0
143 lines (126 loc) · 3.93 KB
/
publishing.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
135
136
137
138
139
140
141
142
143
name: Publishing
on:
push:
branches:
- develop
- hotfix/*
- release/*
tags:
- v*.*.*
jobs:
build:
name: Build
runs-on: ubuntu-latest
environment: google-play-store
steps:
- name: Checkout code
uses: actions/checkout@v4
with:
fetch-depth: 0
submodules: true
- name: Setup Java
uses: actions/setup-java@v4
with:
distribution: 'temurin'
java-version: '17'
cache: 'gradle'
- name: Set up keystore
env:
KEYSTORE_B64: ${{ secrets.KEYSTORE_B64 }}
run: echo $KEYSTORE_B64 | base64 --decode > /tmp/fyreplace.keystore
- name: Set up Google services
env:
GOOGLE_SERVICES_B64: ${{ secrets.GOOGLE_SERVICES_B64 }}
run: echo $GOOGLE_SERVICES_B64 | base64 --decode > app/google-services.json
- name: Build app
env:
KEYSTORE_PATH: /tmp/fyreplace.keystore
KEYSTORE_PASSWORD: ${{ secrets.KEYSTORE_PASSWORD }}
KEY_ALIAS: ${{ vars.KEY_ALIAS }}
KEY_PASSWORD: ${{ secrets.KEY_PASSWORD }}
SENTRY_DSN: ${{ secrets.SENTRY_DSN }}
SENTRY_ORG: ${{ vars.SENTRY_ORG }}
SENTRY_PROJECT: ${{ vars.SENTRY_PROJECT }}
SENTRY_AUTH_TOKEN: ${{ secrets.SENTRY_AUTH_TOKEN }}
run: ./gradlew assembleRelease bundleRelease
- name: Upload Google APK
uses: actions/upload-artifact@v4
with:
name: Fyreplace.google.apk
path: app/build/outputs/apk/google/release/app-google-release.apk
if-no-files-found: error
- name: Upload Libre APK
uses: actions/upload-artifact@v4
with:
name: Fyreplace.libre.apk
path: app/build/outputs/apk/libre/release/app-libre-release.apk
if-no-files-found: error
- name: Upload Google AAB
uses: actions/upload-artifact@v4
with:
name: Fyreplace.google.aab
path: app/build/outputs/bundle/googleRelease/app-google-release.aab
if-no-files-found: error
- name: Upload Libre AAB
uses: actions/upload-artifact@v4
with:
name: Fyreplace.libre.aab
path: app/build/outputs/bundle/libreRelease/app-libre-release.aab
if-no-files-found: error
test:
name: Test
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
with:
fetch-depth: 0
submodules: true
- name: Setup Java
uses: actions/setup-java@v4
with:
distribution: 'temurin'
java-version: '17'
cache: 'gradle'
- name: Run tests
run: ./gradlew test
publish:
name: Publish
needs:
- build
- test
runs-on: ubuntu-latest
environment: google-play-store
steps:
- name: Checkout code
uses: actions/checkout@v4
with:
fetch-depth: 0
submodules: true
- name: Set up artifact directory
run: mkdir -p build
- name: Download Google AAB
uses: actions/download-artifact@v4
with:
name: Fyreplace.google.aab
path: build
- name: Set up Google service account
env:
GCLOUD_SERVICE_ACCOUNT_CREDENTIALS_B64: ${{ secrets.GCLOUD_SERVICE_ACCOUNT_CREDENTIALS_B64 }}
run: echo $GCLOUD_SERVICE_ACCOUNT_CREDENTIALS_B64 | base64 --decode > build/google-service-account.json
- name: Upload AAB to Google Play
run: |
case "${{ github.ref_name }}" in
v*.*.*)
export track=beta;;
hotfix/*)
export track=beta;;
*)
export track=internal;;
esac
fastlane supply \
--track $track \
--changes_not_sent_for_review true \
--json_key build/google-service-account.json \
--aab build/*.aab \
--package_name ${{ vars.PACKAGE_NAME }}