@@ -5,11 +5,8 @@ on: [push, pull_request, create]
5
5
jobs :
6
6
build-linux :
7
7
runs-on : ubuntu-latest
8
- strategy :
9
- matrix :
10
- node-version : [14.x]
11
8
steps :
12
- - uses : actions/checkout@v1
9
+ - uses : actions/checkout@v2
13
10
- name : Cache node modules
14
11
uses : actions/cache@v2
15
12
env :
18
15
# npm cache files are stored in `~/.npm` on Linux/macOS
19
16
path : ~/.npm
20
17
key : ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('**/package-lock.json') }}
21
- restore-keys : |
22
- ${{ runner.os }}-build-${{ env.cache-name }}-
23
- ${{ runner.os }}-build-
24
- ${{ runner.os }}-
25
18
- name : Cache Electron binaries
26
19
uses : actions/cache@v2
27
20
env :
@@ -31,24 +24,22 @@ jobs:
31
24
# https://github.com/electron/get#how-it-works
32
25
path : ~/.cache/electron
33
26
key : ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('**/package-lock.json') }}
34
- restore-keys : |
35
- ${{ runner.os }}-build-${{ env.cache-name }}-
36
- ${{ runner.os }}-build-
37
- ${{ runner.os }}-
38
- - name : Install system dependencies
27
+ - name : Install system dependencies for x64->x32 cross-build
39
28
run : |
40
29
sudo apt update
41
30
sudo apt install libc6-dev-i386 gcc-multilib g++-multilib
42
- - name : Use Node.js ${{ matrix.node-version }}
31
+ - name : Setup Node.js
43
32
uses : actions/setup-node@v1
44
33
with :
45
- node-version : ${{ matrix.node-version }}
46
- - name : set up env
47
- run : |
48
- npm install
49
- - name : npm build
50
- run : |
51
- npm run build-linux
34
+ node-version : 14
35
+ - name : Setup npm
36
+ run : sudo npm i -g npm@7
37
+ - name : Install build deps
38
+ run : npm install
39
+ - name : Run prebuild script
40
+ run : npm run prebuild-linux
41
+ - name : Build for x64 / ia32
42
+ run : ./node_modules/.bin/electron-builder build -l --x64 --ia32
52
43
env :
53
44
GH_TOKEN : ${{ secrets.GITHUB_TOKEN }}
54
45
- uses : actions/upload-artifact@v2
@@ -57,11 +48,86 @@ jobs:
57
48
path : dist/*.AppImage
58
49
if-no-files-found : error
59
50
51
+ build-linux-arm32 :
52
+ runs-on : ubuntu-latest
53
+ steps :
54
+ - uses : actions/checkout@v2
55
+ - name : Setup QEMU
56
+ uses : docker/setup-qemu-action@v1
57
+ with :
58
+ platforms : arm
59
+ - name : Cache node modules
60
+ uses : actions/cache@v2
61
+ env :
62
+ cache-name : cache-node-modules
63
+ with :
64
+ # npm cache files are stored in `~/.npm` on Linux/macOS
65
+ path : ~/.npm
66
+ key : ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('**/package-lock.json') }}
67
+ - name : Cache Electron binaries
68
+ uses : actions/cache@v2
69
+ env :
70
+ cache-name : cache-electron-bins
71
+ with :
72
+ # cache location is described here:
73
+ # https://github.com/electron/get#how-it-works
74
+ path : ~/.cache/electron
75
+ key : ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('**/package-lock.json') }}
76
+ - name : Run prebuild outside of QEMU emulator
77
+ run : sudo npm i -g npm@7 && npm install && rsync -a --info=progress2 src/ prebuild-src --exclude node_modules && node prebuild-minify.js && rm -rf node_modules
78
+ - name : Build for arm32v7 (aka armv7l)
79
+ uses : docker://arm32v7/node:14-buster
80
+ with :
81
+ args : bash -c "npm i -g npm@7 && npm install && ./node_modules/.bin/electron-builder build -l --armv7l"
82
+ env :
83
+ GH_TOKEN : ${{ secrets.GITHUB_TOKEN }}
84
+ - uses : actions/upload-artifact@v2
85
+ with :
86
+ name : Linux-arm32-AppImage
87
+ path : dist/*.AppImage
88
+ if-no-files-found : error
89
+
90
+ build-linux-arm64 :
91
+ runs-on : ubuntu-latest
92
+ steps :
93
+ - uses : actions/checkout@v2
94
+ - name : Setup QEMU
95
+ uses : docker/setup-qemu-action@v1
96
+ with :
97
+ platforms : arm64
98
+ - name : Cache node modules
99
+ uses : actions/cache@v2
100
+ env :
101
+ cache-name : cache-node-modules
102
+ with :
103
+ # npm cache files are stored in `~/.npm` on Linux/macOS
104
+ path : ~/.npm
105
+ key : ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('**/package-lock.json') }}
106
+ - name : Cache Electron binaries
107
+ uses : actions/cache@v2
108
+ env :
109
+ cache-name : cache-electron-bins
110
+ with :
111
+ # cache location is described here:
112
+ # https://github.com/electron/get#how-it-works
113
+ path : ~/.cache/electron
114
+ key : ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('**/package-lock.json') }}
115
+ - name : Run prebuild outside of QEMU emulator
116
+ run : sudo npm i -g npm@7 && npm install && rsync -a --info=progress2 src/ prebuild-src --exclude node_modules && node prebuild-minify.js && rm -rf node_modules
117
+ - name : Build for arm64 (aka arm64v8)
118
+ uses : docker://arm64v8/node:14-buster
119
+ with :
120
+ args : bash -c "npm i -g npm@7 && npm install && ./node_modules/.bin/electron-builder build -l --arm64"
121
+ env :
122
+ GH_TOKEN : ${{ secrets.GITHUB_TOKEN }}
123
+ - uses : actions/upload-artifact@v2
124
+ with :
125
+ name : Linux-arm64-AppImage
126
+ path : dist/*.AppImage
127
+ if-no-files-found : error
128
+
60
129
build-windows :
61
130
runs-on : windows-latest
62
- strategy :
63
- matrix :
64
- node-version : [14.x]
65
131
steps :
66
132
- uses : actions/checkout@v1
67
133
- name : Get npm cache directory
72
138
with :
73
139
path : ${{ steps.npm-cache.outputs.dir }}
74
140
key : ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }}
75
- restore-keys : |
76
- ${{ runner.os }}-node-
77
141
- name : Cache Electron binaries
78
142
uses : actions/cache@v2
79
143
env :
@@ -83,20 +147,16 @@ jobs:
83
147
# https://github.com/electron/get#how-it-works
84
148
path : ~/AppData/Local/electron/Cache
85
149
key : ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('**/package-lock.json') }}
86
- restore-keys : |
87
- ${{ runner.os }}-build-${{ env.cache-name }}-
88
- ${{ runner.os }}-build-
89
- ${{ runner.os }}-
90
- - name : Use Node.js ${{ matrix.node-version }}
150
+ - name : Setup Node.js
91
151
uses : actions/setup-node@v1
92
152
with :
93
- node-version : ${{ matrix.node-version }}
153
+ node-version : 14
154
+ - name : Setup npm
155
+ run : npm i -g npm@7
94
156
- name : npm install
95
- run : |
96
- npm install
157
+ run : npm install
97
158
- name : npm build
98
- run : |
99
- npm run build-windows
159
+ run : npm run build-windows
100
160
env :
101
161
GH_TOKEN : ${{ secrets.GITHUB_TOKEN }}
102
162
- uses : actions/upload-artifact@v2
@@ -107,9 +167,6 @@ jobs:
107
167
108
168
build-darwin :
109
169
runs-on : macos-latest
110
- strategy :
111
- matrix :
112
- node-version : [14.x]
113
170
steps :
114
171
- uses : actions/checkout@v1
115
172
- name : Cache node modules
@@ -120,10 +177,6 @@ jobs:
120
177
# npm cache files are stored in `~/.npm` on Linux/macOS
121
178
path : ~/.npm
122
179
key : ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('**/package-lock.json') }}
123
- restore-keys : |
124
- ${{ runner.os }}-build-${{ env.cache-name }}-
125
- ${{ runner.os }}-build-
126
- ${{ runner.os }}-
127
180
- name : Cache Electron binaries
128
181
uses : actions/cache@v2
129
182
env :
@@ -133,20 +186,16 @@ jobs:
133
186
# https://github.com/electron/get#how-it-works
134
187
path : ~/Library/Caches/electron
135
188
key : ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('**/package-lock.json') }}
136
- restore-keys : |
137
- ${{ runner.os }}-build-${{ env.cache-name }}-
138
- ${{ runner.os }}-build-
139
- ${{ runner.os }}-
140
- - name : Use Node.js ${{ matrix.node-version }}
189
+ - name : Setup Node.js
141
190
uses : actions/setup-node@v1
142
191
with :
143
- node-version : ${{ matrix.node-version }}
144
- - name : set up env
145
- run : |
146
- npm install
192
+ node-version : 14
193
+ - name : Setup npm
194
+ run : sudo npm i -g npm@7
195
+ - name : npm install
196
+ run : npm install
147
197
- name : npm build
148
- run : |
149
- npm run build-darwin
198
+ run : npm run build-darwin
150
199
env :
151
200
GH_TOKEN : ${{ secrets.GITHUB_TOKEN }}
152
201
- uses : actions/upload-artifact@v2
0 commit comments