-
Notifications
You must be signed in to change notification settings - Fork 40
300 lines (290 loc) · 8.89 KB
/
night.bastyon.com.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
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
name: Deploy to night.bastyon.com
on:
workflow_dispatch:
push:
branches:
- master
jobs:
prepare:
runs-on: ubuntu-latest
steps:
- name: Checkout git repository
uses: actions/checkout@v3
with:
ref: ${{ github.ref }}
- name: Save HEAD information
run: git --no-pager log --decorate=short --pretty=oneline -n1 > head.txt
- name: Archive repo
run: |
mkdir -p /tmp/repo
rsync -ah --exclude={'.git','.gitignore','.github','node_modules','.well-known'} ./ /tmp/repo/
cd /tmp/repo
tar czf /tmp/repo.tgz ./
- name: Upload artifact repo.tgz
uses: actions/upload-artifact@v3
with:
name: repo.tgz
path: /tmp/repo.tgz
- name: Save artifact head.txt
uses: actions/upload-artifact@v3
with:
name: head
path: ./head.txt
deploy-pre:
needs: prepare
runs-on: gui
steps:
- name: Download artifact
uses: actions/download-artifact@v3
with:
name: repo.tgz
- name: Install Node.js, NPM and Yarn
uses: actions/setup-node@v3
with:
node-version: 16
- name: Prepare
run: |
tar xzf repo.tgz
rm -rf repo.tgz
npm i
npm run build:proxy16
npm run minimize:bastyon -- -sha=${{ github.sha }}
- name: Copy to dest dir
run: rsync -ah --exclude={'.git','.gitignore','.github','package.json','package-lock.json','minimize.json','node_modules','.well-known','assets','proxy16','cordova','res','build'} ./ /docker/night/
- name: Reset nginx cache
run: /data/reset_cache.sh
shell: bash
- name: Clean work dir
run: rm -rf ./*
build-macos:
needs: prepare
runs-on: macos-latest
steps:
- name: Download artifact
uses: actions/download-artifact@v3
with:
name: repo.tgz
- name: Unpack artifact
run: tar xzf repo.tgz
- name: Install Node.js, NPM and Yarn
uses: actions/setup-node@v3
with:
node-version: 16
- name: Prepare building
run: |
npm i
npm run build:proxy16
npm run dev:bastyon -- -sha=${{ github.sha }}
- name: Prepare for app notarization
run: |
mkdir -p ~/private_keys/
echo '${{ secrets.APPLE_API_KEY }}' > ~/private_keys/AuthKey_${{ secrets.APPLE_API_KEY_ID }}.p8
echo '${{ secrets.APPLECERT }}' | base64 -d > applecert.p12
- name: Building
env:
APPLE_ID: ${{ secrets.APPLE_ID }}
APPLE_ID_PASSWORD: ${{ secrets.APPLE_ID_PASS }}
APPLE_TEAM_ID: ${{ secrets.APPLE_TEAM_ID }}
APPLE_APP_SPECIFIC_PASSWORD: ${{ secrets.APPLE_APP_SPECIFIC_PASSWORD }}
CSC_LINK: 'file://applecert.p12'
CSC_KEY_PASSWORD: ${{ secrets.APPLECERTPWD }}
run: |
npm run distm
ls -lh ./dist/
- name: Upload artifact
uses: actions/upload-artifact@v3
with:
name: macos
path: ./dist/BastyonSetup.dmg
build-unix:
needs: prepare
runs-on: ubuntu-latest
steps:
- name: Download artifact
uses: actions/download-artifact@v3
with:
name: repo.tgz
- name: Unpack artifact
run: tar xzf repo.tgz
- name: Install Node.js, NPM and Yarn
uses: actions/setup-node@v3
with:
node-version: 16
- name: Prepare building
run: |
apt update && apt install -y binutils rpm
npm i
npm run build:proxy16
npm run dev:bastyon -- -sha=${{ github.sha }}
- name: Building
run: |
npm run distl
ls -lh ./dist/
- name: Upload artifact
uses: actions/upload-artifact@v3
with:
name: unix
path: |
./dist/BastyonSetup.deb
./dist/BastyonSetup.rpm
./dist/Bastyon.AppImage
build-windows:
needs: prepare
runs-on: windows-latest
steps:
- name: Download artifact
uses: actions/download-artifact@v3
with:
name: repo.tgz
- name: Unpack artifact
run: tar xzf repo.tgz
- name: Install Node.js, NPM and Yarn
uses: actions/setup-node@v3
with:
node-version: 16
- name: Prepare building
run: |
npm i
npm run build:proxy16
npm run dev:bastyon -- -sha=${{ github.sha }}
- name: Building
run: |
npm run dist
ls .\dist\
- name: Upload artifact
uses: actions/upload-artifact@v3
with:
name: windows
path: ./dist/BastyonSetup.exe
build-android:
needs: prepare
runs-on: ubuntu-20.04
steps:
- name: Download artifact
uses: actions/download-artifact@v3
with:
name: repo.tgz
- name: Unpack artifact
run: tar xzf repo.tgz
- uses: actions/setup-java@v3
with:
distribution: 'temurin'
java-version: '11'
- name: Install Node.js, NPM and Yarn
uses: actions/setup-node@v3
with:
node-version: 16
- name: Install Cordova
run: |
npm i -g cordova@10
cordova --version
- name: Prepare building
run: |
npm i
npm run build:proxy16
npm run minimize:cordova -- -sha=${{ github.sha }}
cd ./cordova
npm i
- name: Prepare configuration
run: |
cd ./cordova
echo "${{ secrets.ANDROID_SECRET_KEY }}" | base64 -d > cert.keystore
echo "${{ secrets.ANDROID_BUILD_CONF }}" | base64 -d > build.json
echo "${{ secrets.ANDROID_FIREBASE_CONF }}" | base64 -d > google-services.json
ls -l cert.keystore
ls -l build.json
- name: Fixing Android Build Tool Issue
run: |
cd $ANDROID_HOME/build-tools/33.0.0
mv d8 dx
cd lib
mv d8.jar dx.jar
- name: Configure Cordova Plugins
run: |
cd ./cordova
npm run android-add
- name: Building
run: |
cd ./cordova
npm run android-build
- name: Rename apk binary
run: |
cd ./cordova/platforms/android/app/build/outputs/apk/release
ls -lh
mv app-release.apk Bastyon.apk
- name: Upload artifact
uses: actions/upload-artifact@v3
with:
name: android
path: ./cordova/platforms/android/app/build/outputs/apk/release/Bastyon.apk
build-android-gf:
needs: prepare
runs-on: ubuntu-20.04
steps:
- name: Download artifact
uses: actions/download-artifact@v3
with:
name: repo.tgz
- name: Unpack artifact
run: tar xzf repo.tgz
- uses: actions/setup-java@v3
with:
distribution: 'temurin'
java-version: '11'
- name: Install Node.js, NPM and Yarn
uses: actions/setup-node@v3
with:
node-version: 16
- name: Install Cordova
run: |
npm i -g cordova@10
cordova --version
- name: Prepare building
run: |
npm i
npm run build:proxy16
npm run minimize:cordova:gfree -- -sha=${{ github.sha }} -run=${{ github.run_number }}${{ github.run_attempt }}
cd ./cordova
npm i
- name: Prepare configuration
run: |
cd ./cordova
echo "${{ secrets.ANDROID_SECRET_KEY }}" | base64 -d > cert.keystore
echo "${{ secrets.ANDROID_BUILD_GFREE_CONF }}" | base64 -d > buildgfree.json
echo "${{ secrets.ANDROID_FIREBASE_CONF }}" | base64 -d > google-services.json
- name: Fixing Android Build Tool Issue
run: |
cd $ANDROID_HOME/build-tools/33.0.0
mv d8 dx
cd lib
mv d8.jar dx.jar
- name: Configure Cordova Plugins
run: |
cd ./cordova
npm run android-add
- name: Building
run: |
cd ./cordova
npm run android-build-gfree
- name: Rename apk binary
run: |
cd ./cordova/platforms/android/app/build/outputs/apk/release
ls -lh
mv app-release.apk BastyonGF.apk
- name: Upload artifact
uses: actions/upload-artifact@v3
with:
name: android-gfree
path: ./cordova/platforms/android/app/build/outputs/apk/release/BastyonGF.apk
deploy-app-binaries:
needs: [ build-macos, build-unix, build-windows, build-android, build-android-gf ]
runs-on: dev.pocketnet.app
steps:
- name: Download artifact
uses: actions/download-artifact@v3
- name: Copy artifacts
run: cp ./**/Bastyon* /data/dev/binaries/night/
- name: Copy HEAD information
run: cp ./head/head.txt /data/dev/binaries/night/head.txt
- name: Clean work dir
run: rm -rf ./*