-
-
Notifications
You must be signed in to change notification settings - Fork 5.1k
78 lines (76 loc) · 2.95 KB
/
electron-builder-win.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
name: Electron Builder CI (WIN)
on:
push:
tags:
- 'v*'
jobs:
build:
runs-on: windows-latest
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
GH_REF: ${{ github.ref }}
steps:
- name: Checkout reposistory
uses: actions/checkout@v4
with:
submodules: true
- name: Checkout drawio-dev
uses: actions/checkout@v4
with:
repository: jgraph/drawio-dev
token: ${{ secrets.GH_TOKEN }}
ref: release
path: drawio-dev
submodules: false
- name: Get drawio Tag & Submodules
run: |
cd drawio-dev
# Get the current build tag from draw.io
$tmp=$Env:GH_REF -replace '/v','/diagramly-' -replace '[.]','_'
$ref=$tmp+':'+$tmp
git fetch origin $ref --no-tags
$tmp=$tmp -replace 'refs/',''
git checkout $tmp -b tmp-deploy
Copy-Item -Path "src\main\webapp\js\*.min.js" -Destination "..\drawio\src\main\webapp\js\"
cd ..
Remove-Item 'drawio-dev' -Recurse -Force
cd drawio
Remove-Item 'etc','src\main\java','src\main\webapp\mxgraph\src','src\main\webapp\connect','src\main\webapp\shapes','src\main\webapp\stencils','src\main\webapp\service-worker*','src\main\webapp\workbox-*' -Recurse -Force
cd src\main\webapp\js
Copy-Item "diagramly\DesktopLibrary.js","diagramly\ElectronApp.js" -Destination "."
Remove-Item 'atlas-viewer.min.js','atlas.min.js','cryptojs','deflate','diagramly','dropbox','embed*','freehand','grapheditor','integrate.min.js','jquery','jscolor','onedrive','orgchart','reader.min.js','rough','sanitizer','shapes.min.js','simplepeer','spin','viewer-static.min.js','viewer.min.js' -Recurse -Force
md diagramly
Move-Item "DesktopLibrary.js","ElectronApp.js" -Destination "diagramly"
- name: Installing Node
uses: actions/setup-node@v4
with:
node-version: 20
- name: Prepare for Windows Build
shell: powershell #The default shell for Windows
run: |
npm install -g yarn
yarn install
- name: Build for Windows (x32)
env:
CSC_LINK: ${{ secrets.WIN_CSC_LINK }}
CSC_KEY_PASSWORD: ${{ secrets.WIN_CSC_KEY_PASSWORD }}
shell: powershell #The default shell for Windows
run: |
#Disable auto-update and build 32bit first such that latest.yml is for 64bit only (64bit will overwrite 32bit one)
yarn run sync disableUpdate
yarn run release-win32
- name: Build for Windows (x64)
env:
CSC_LINK: ${{ secrets.WIN_CSC_LINK }}
CSC_KEY_PASSWORD: ${{ secrets.WIN_CSC_KEY_PASSWORD }}
shell: powershell #The default shell for Windows
run: |
#Enable auto-update again
yarn run sync
yarn run release-win
- name: Build for Windows (APPX)
shell: powershell #The default shell for Windows
run: |
#Disable auto-update for appx also
yarn run sync disableUpdate
yarn run release-appx