-
-
Notifications
You must be signed in to change notification settings - Fork 1.8k
450 lines (375 loc) · 14.2 KB
/
build-desktop-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
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
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
# This is a basic workflow to help you get started with Actions
name: Build-Desktop-Release
on:
workflow_dispatch:
inputs:
tag-version:
description: "Release Tag Version"
required: true
git-ref:
description: "Release Git Ref"
required: true
default: "master"
is-draft:
description: 'Draft Release? '
required: true
default: "true"
is-pre-release:
description: 'Pre Release?'
required: true
default: "true"
jobs:
compile-cljs:
runs-on: ubuntu-18.04
steps:
- name: Check out Git repository
uses: actions/checkout@v1
- name: Install Node.js, NPM and Yarn
uses: actions/setup-node@v2
with:
node-version: 16
- name: Setup Java JDK
uses: actions/setup-java@v1.4.3
with:
java-version: 1.8
- name: Cache local Maven repository
uses: actions/cache@v2
with:
path: ~/.m2/repository
key: ${{ runner.os }}-maven
- name: Install clojure
run: |
curl -O https://download.clojure.org/install/linux-install-1.10.1.763.sh
chmod +x linux-install-1.10.1.763.sh
sudo ./linux-install-1.10.1.763.sh
- name: Compile CLJS
run: yarn install && gulp build && yarn cljs:release-electron
- name: Update APP Version
run: |
sed -i 's/"version": "0.0.1"/"version": "${{ github.event.inputs.tag-version }}"/g' ./package.json
working-directory: ./static
- name: Display Package.json
run: cat ./package.json
working-directory: ./static
- name: List Files
run: ls -al
working-directory: ./static
- name: Compress Static Files
run: zip -r static.zip ./static
- name: Cache Static File
uses: actions/upload-artifact@v1
with:
name: static.zip
path: static.zip
build-linux:
runs-on: ubuntu-18.04
needs: [ compile-cljs ]
steps:
- name: Download The Static Asset
uses: actions/download-artifact@v1
with:
name: static.zip
path: ./
- name: Uncompress Static FIles
run: unzip static.zip
- name: Install Node.js, NPM and Yarn
uses: actions/setup-node@v2
with:
node-version: 16
# - name: Cache Node Modules
# uses: actions/cache@v2
# with:
# path: |
# **/node_modules
# key: ${{ runner.os }}-node-modules
- name: Build/Release Electron App
run: yarn install && yarn electron:make
working-directory: ./static
- name: Change Artifact Name For ZIP File
run: mv static/out/make/zip/linux/x64/*-linux-x64-*.zip static/out/make/zip/linux/x64/Logseq-linux.zip
- name: Change Artifact Name For AppImage File
run: mv static/out/make/*-*.AppImage static/out/make/Logseq-linux.AppImage
- name: Cache Artifact With ZIP format
uses: actions/upload-artifact@v1
with:
name: Logseq-linux.zip
path: static/out/make/zip/linux/x64/Logseq-linux.zip
- name: Cache Artifact With AppImage format
uses: actions/upload-artifact@v1
with:
name: Logseq-linux.AppImage
path: static/out/make/Logseq-linux.AppImage
build-windows:
runs-on: windows-latest
needs: [ compile-cljs ]
steps:
- name: Download The Static Asset
uses: actions/download-artifact@v1
with:
name: static.zip
path: ./
- name: Uncompress Static FIles
run: unzip static.zip
- name: Install Node.js, NPM and Yarn
uses: actions/setup-node@v2
with:
node-version: 16
# - name: Cache Node Modules
# uses: actions/cache@v2
# with:
# path: |
# **/node_modules
# key: ${{ runner.os }}-node-modules
- name: Deps Electron app
run: yarn install
working-directory: ./static
- name: Fix Deps Electron app
run: yarn run postinstall
working-directory: ./static/node_modules/dugite/
- name: Build/Release Electron app
run: yarn electron:make
working-directory: ./static
- name: Change Artifact Name
run: Get-ChildItem static\out\make\squirrel.windows\x64\*.exe | Rename-Item -NewName Logseq-win64.exe
- name: List Directory
run: dir
working-directory: static/out/make/squirrel.windows/x64/
- name: Cache Artifact
uses: actions/upload-artifact@v1
with:
name: Logseq-win64.exe
path: static/out/make/squirrel.windows/x64/Logseq-win64.exe
build-macos:
needs: [ compile-cljs ]
runs-on: macos-latest
steps:
- name: Download The Static Asset
uses: actions/download-artifact@v1
with:
name: static.zip
path: ./
- name: Uncompress Static Files
run: unzip ./static.zip
- name: List Static Files
run: ls -al ./static
- name: Install Node.js, NPM and Yarn
uses: actions/setup-node@v2
with:
node-version: 16
- name: Signing By Apple Developer ID
uses: apple-actions/import-codesign-certs@v1
with:
p12-file-base64: ${{ secrets.APPLE_CERTIFICATES_P12 }}
p12-password: ${{ secrets.APPLE_CERTIFICATES_P12_PASSWORD }}
# - name: Cache Node Modules
# uses: actions/cache@v2
# with:
# path: |
# **/node_modules
# key: ${{ runner.os }}-node-modules
- name: Build/Release Electron App
run: yarn install && yarn electron:make
working-directory: ./static
env:
APPLE_ID: ${{ secrets.APPLE_ID_EMAIL }}
APPLE_ID_PASSWORD: ${{ secrets.APPLE_ID_PASSWORD }}
- name: Change DMG Name
run: mv static/out/make/*.dmg static/out/make/logseq-darwin-x64-${{ github.event.inputs.tag-version }}.dmg
- name: Cache Artifact DMG
uses: actions/upload-artifact@v1
with:
name: Logseq-x64.dmg
path: static/out/make/logseq-darwin-x64-${{ github.event.inputs.tag-version }}.dmg
- name: ls files
run: du -a static/out/
- name: Change zip Name
run: mv static/out/make/zip/darwin/x64/*.zip static/out/make/zip/darwin/x64/logseq-darwin-x64-${{ github.event.inputs.tag-version }}.zip
- name: Cache Artifact ZIP
uses: actions/upload-artifact@v1
with:
name: Logseq-x64.zip
path: static/out/make/zip/darwin/x64/logseq-darwin-x64-${{ github.event.inputs.tag-version }}.zip
build-macos-arm64:
needs: [ compile-cljs ]
runs-on: macos-latest
steps:
# this is only needed temporarily
# wait until macos-11 GA https://github.com/actions/virtual-environments/issues/2486
# or m1 hardware https://github.com/actions/virtual-environments/issues/2187
- name: hack osx sdk
run: |
if [ "$(sw_vers -productVersion | cut -d'.' -f1)" = 10 ]; then
pushd /Library/Developer/CommandLineTools/SDKs
sudo rm MacOSX.sdk
sudo ln -s MacOSX11.1.sdk MacOSX.sdk
sudo rm -rf MacOSX10.15.sdk
ls -l
popd
fi
- name: Download The Static Asset
uses: actions/download-artifact@v1
with:
name: static.zip
path: ./
- name: Uncompress Static Files
run: unzip ./static.zip
- name: List Static Files
run: ls -al ./static
- name: Install Node.js, NPM and Yarn
uses: actions/setup-node@v2
with:
node-version: 16
- name: Signing By Apple Developer ID
uses: apple-actions/import-codesign-certs@v1
with:
p12-file-base64: ${{ secrets.APPLE_CERTIFICATES_P12 }}
p12-password: ${{ secrets.APPLE_CERTIFICATES_P12_PASSWORD }}
# - name: Cache Node Modules
# uses: actions/cache@v2
# with:
# path: |
# **/node_modules
# key: ${{ runner.os }}-node-modules
- name: Build/Release Electron App
run: yarn install && yarn electron:make-macos-arm64
working-directory: ./static
env:
APPLE_ID: ${{ secrets.APPLE_ID_EMAIL }}
APPLE_ID_PASSWORD: ${{ secrets.APPLE_ID_PASSWORD }}
- name: Change DMG Name
run: mv static/out/make/*.dmg static/out/make/logseq-darwin-arm64-${{ github.event.inputs.tag-version }}.dmg
- name: Cache Artifact DMG
uses: actions/upload-artifact@v1
with:
name: Logseq-arm64.dmg
path: static/out/make/logseq-darwin-arm64-${{ github.event.inputs.tag-version }}.dmg
- name: ls files
run: du -a static/out/
- name: Change zip Name
run: mv static/out/make/zip/darwin/arm64/*.zip static/out/make/zip/darwin/arm64/logseq-darwin-arm64-${{ github.event.inputs.tag-version }}.zip
- name: Cache Artifact ZIP
uses: actions/upload-artifact@v1
with:
name: Logseq-arm64.zip
path: static/out/make/zip/darwin/arm64/logseq-darwin-arm64-${{ github.event.inputs.tag-version }}.zip
release:
needs: [ build-macos, build-linux, build-windows, build-macos-arm64 ]
runs-on: ubuntu-18.04
steps:
- name: Download The MacOS X64 DMG Artifact
uses: actions/download-artifact@v1
with:
name: Logseq-x64.dmg
path: ./
- name: Download The MacOS X64 ZIP Artifact
uses: actions/download-artifact@v1
with:
name: Logseq-x64.zip
path: ./
- name: Download The MacOS ARM64 DMG Artifact
uses: actions/download-artifact@v1
with:
name: Logseq-arm64.dmg
path: ./
- name: Download The MacOS ARM64 ZIP Artifact
uses: actions/download-artifact@v1
with:
name: Logseq-arm64.zip
path: ./
- name: Download The Linux Artifact In Zip format
uses: actions/download-artifact@v1
with:
name: Logseq-linux.zip
path: ./
- name: Download The Linux Artifact In AppImage format
uses: actions/download-artifact@v1
with:
name: Logseq-linux.AppImage
path: ./
- name: Download The Windows Artifact
uses: actions/download-artifact@v1
with:
name: Logseq-win64.exe
path: ./
- name: List files
run: ls -rl
- name: Create Release Draft
id: create_release
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: ${{ github.event.inputs.tag-version }}
release_name: Desktop APP ${{ github.event.inputs.tag-version }} (Beta Testing)
draft: ${{ github.event.inputs.is-draft }}
prerelease: ${{ github.event.inputs.is-pre-release }}
- name: Upload MacOS X64 ZIP Artifact
id: upload-macos-x64-zip-artifact
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: ./logseq-darwin-x64-${{ github.event.inputs.tag-version }}.zip
asset_name: logseq-darwin-x64-${{ github.event.inputs.tag-version }}.zip
asset_content_type: application/zip
- name: Upload MacOS X64 DMG Artifact
id: upload-macos-x64-dmg-artifact
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: ./logseq-darwin-x64-${{ github.event.inputs.tag-version }}.dmg
asset_name: logseq-darwin-x64-${{ github.event.inputs.tag-version }}.dmg
asset_content_type: application/x-apple-diskimage
- name: Upload MacOS ARM64 ZIP Artifact
id: upload-macos-arm64-zip-artifact
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: ./logseq-darwin-arm64-${{ github.event.inputs.tag-version }}.zip
asset_name: logseq-darwin-arm64-${{ github.event.inputs.tag-version }}.zip
asset_content_type: application/zip
- name: Upload MacOS ARM64 DMG Artifact
id: upload-macos-arm64-dmg-artifact
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: ./logseq-darwin-arm64-${{ github.event.inputs.tag-version }}.dmg
asset_name: logseq-darwin-arm64-${{ github.event.inputs.tag-version }}.dmg
asset_content_type: application/x-apple-diskimage
- name: Upload Linux Artifact With Zip format
id: upload-linux-artifact-with-zip-format
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: ./Logseq-linux.zip
asset_name: logseq-linux-x64-${{ github.event.inputs.tag-version }}.zip
asset_content_type: application/zip
- name: Upload Linux Artifact With AppImage format
id: upload-linux-artifact-with-appimage-format
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: ./Logseq-linux.AppImage
asset_name: logseq-linux-x64-${{ github.event.inputs.tag-version }}.AppImage
asset_content_type: application/octet-stream
- name: Upload Windows Artifact
id: upload-win-artifact
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: ./Logseq-win64.exe
asset_name: logseq-win-x64-${{ github.event.inputs.tag-version }}.exe
asset_content_type: application/octet-stream