-
-
Notifications
You must be signed in to change notification settings - Fork 5
210 lines (199 loc) · 6.64 KB
/
Build and Release.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
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
name: Build 🏗️ and Release 🚀
on:
push:
tags:
- v*
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Decode Keystore
id: decode_keystore
uses: timheuer/base64-to-file@v1
with:
fileName: 'keystore/keystore.jks'
encodedString: ${{ secrets.KEYSTORE }}
- uses: actions/checkout@v2
- name: set up JDK 17
uses: actions/setup-java@v1
with:
java-version: 17
distribution: 'temurin'
cache: gradle
- name: Make gradlew executable
run: chmod +x ./gradlew
- name: Decode google-services.json
env:
GOOGLE_SERVICES_JSON: ${{ secrets.APP_GOOGLE_JSON }}
run: echo $GOOGLE_SERVICES_JSON > ./bitapp/google-services.json
- name: Creating Local.Properties
env:
FIREBASE_WEB_CLIENT_ID: ${{ secrets.FIREBASE_WEB_CLIENT_ID }}
GEMINI_API_KEY: ${{ secrets.GEMINI_API_KEY }}
run: |
echo "firebaseWebClient=${FIREBASE_WEB_CLIENT_ID}" >> ./local.properties
echo "apiKey=${GEMINI_API_KEY}" >> ./local.properties
- name: Copy Keystore to Project
run: |
mkdir -p ./bitapp/keystore
cp ${{ steps.decode_keystore.outputs.filePath }} './bitapp/keystore/keystore.jks'
echo ${{ steps.decode_keystore.outputs.filePath }}
ls -la ./bitapp
- name: Build Release APK and Bundle
run: ./gradlew :bitapp:assembleGlobalRelease --stacktrace :bitapp:bundleGlobalRelease --stacktrace
env:
SIGNING_KEY_ALIAS: ${{ secrets.SIGNING_KEY_ALIAS }}
SIGNING_KEY_PASSWORD: ${{ secrets.SIGNING_KEY_PASSWORD }}
SIGNING_STORE_PASSWORD: ${{ secrets.SIGNING_STORE_PASSWORD }}
- name: Upload APK
uses: actions/upload-artifact@v2
with:
name: apk
retention-days: 1
path: bitapp/build/outputs/apk/global/release/bitapp-global-release.apk
- name: Upload Bundle
uses: actions/upload-artifact@v2
with:
name: bundle
retention-days: 1
path: bitapp/build/outputs/bundle/globalRelease/bitapp-global-release.aab
release:
name: Publish APK to GitHub
needs: build
runs-on: ubuntu-latest
steps:
- name: Download APK from build
uses: actions/download-artifact@v3
with:
name: apk
- name: Download Bundle from build
uses: actions/download-artifact@v3
with:
name: bundle
- name: Rename file to match tag
run: |
echo ${{ github.ref }}
v=$(echo ${{ github.ref }} | cut -c 11-)
echo $v
mv bitapp-global-release.apk bitapp-$v.apk
mv bitapp-global-release.aab bitapp-$v.aab
- name: Upload APK to Release
env:
GITHUB_TOKEN: ${{ secrets.ACCOUNT_TOKEN }}
uses: softprops/action-gh-release@v1
with:
fail_on_missing: true
files: |
bitapp-*.apk
bitapp-*.aab
tag_name: ${{ steps.create_release.outputs.tag_name }}
name: ${{ github.event.inputs.releaseName }}
token: ${{ secrets.ACCOUNT_TOKEN }}
buildDocs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Setup JDK 17
uses: actions/setup-java@v2
with:
java-version: '17'
distribution: 'temurin'
cache: gradle
- name: Make gradlew executable
run: chmod +x gradlew
- name: Decode google-services.json
env:
GOOGLE_SERVICES_JSON: ${{ secrets.APP_GOOGLE_JSON }}
run: echo $GOOGLE_SERVICES_JSON > ./bitapp/google-services.json
- name: Creating Local.Properties
env:
FIREBASE_WEB_CLIENT_ID: ${{ secrets.FIREBASE_WEB_CLIENT_ID }}
GEMINI_API_KEY: ${{ secrets.GEMINI_API_KEY }}
run: |
echo "firebaseWebClient=${FIREBASE_WEB_CLIENT_ID}" >> ./local.properties
echo "apiKey=${GEMINI_API_KEY}" >> ./local.properties
- name: Generate Dokka docs
run: ./gradlew dokkaHtmlMultiModule
- name: Upload Kt docs
uses: actions/upload-artifact@v2
with:
name: kt-docs
path: build/dokka
retention-days: 1
- name: Uploading mk-docs
uses: actions/upload-artifact@v2
with:
name: mk-docs
path: mk-docs
retention-days: 1
setting-up:
runs-on: ubuntu-latest
needs: buildDocs
steps:
- name: Download docs
uses: actions/download-artifact@v3
with:
name: kt-docs
- name: Download MkDocs
uses: actions/download-artifact@v3
with:
name: mk-docs
- name: Copy docs
run: |
ls -la
mkdir -p copyDoc/generated
cp mkdocs.yml copyDoc/generated
mkdir -p copyDoc/generated/docs
cp -r docs/* copyDoc/generated/docs
ls -la copyDoc/generated/docs
mkdir -p copyDoc/generated/docs/app
cp -r htmlMultiModule/* copyDoc/generated/docs/app
ls -la copyDoc/generated/docs/app
- name: Upload docs
uses: actions/upload-artifact@v2
with:
name: generated-docs
path: copyDoc
retention-days: 1
deploy:
runs-on: ubuntu-latest
needs: setting-up
permissions: write-all
steps:
- uses: actions/checkout@v4
- name: Configure Git Credentials
run: |
git config user.name github-actions[bot]
git config user.email 41898282+github-actions[bot]@users.noreply.github.com
- uses: actions/setup-python@v4
with:
python-version: '3.x'
- run: echo "cache_id=$(date --utc '+%V')" >> $GITHUB_ENV
- uses: actions/cache@v3
with:
key: mkdocs-material-${{ env.cache_id }}
path: .cache
restore-keys: |
mkdocs-material-
- name: Download docs
uses: actions/download-artifact@v3
with:
name: generated-docs
- uses: joutvhu/get-release@v1
id: pre_release
with:
latest: true
pattern: 'pre.+'
prerelease: true
env:
GITHUB_TOKEN: ${{ secrets.ACCOUNT_TOKEN }}
- run: |
cd generated
sed -i -E "s/stable.+/stable: $(echo ${{ github.ref }} | cut -c 11-) /" mkdocs.yml
sed -i -E "s/pre_release.+/pre_release: $(echo ${{ steps.pre_release.outputs.tag_name }} | cut -c 13-) /" mkdocs.yml
pip install mkdocs-material
pip install mkdocs-glightbox
pip install mkdocs-markdownextradata-plugin
- run: |
cd generated
mkdocs gh-deploy --force