-
-
Notifications
You must be signed in to change notification settings - Fork 48
181 lines (179 loc) · 5.65 KB
/
build.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
name: Build
on:
push:
tags:
- "*"
pull_request:
workflow_dispatch:
jobs:
build-electron:
strategy:
fail-fast: false
matrix:
os: [ubuntu-20.04, macos-13, windows-2019]
architecture: [x64, ia32, arm64]
electron:
[
33.3.0
33.2.0,
33.1.0,
33.0.0,
32.0.0,
32.1.0,
32.2.0,
31.0.0,
31.1.0,
31.2.0,
31.3.0,
31.4.0,
31.5.0,
31.6.0,
31.7.0,
30.0.0,
30.1.0,
30.2.0,
30.3.0,
30.4.0,
30.5.0,
29.0.0,
29.1.0,
29.2.0,
29.3.0,
29.4.0,
]
include:
- electron_mocha_version: ^13
python_version: "3.10"
- architecture: arm64
architecture_node: x64
target_architecture: arm64
extra_compile_flags: -arch arm64
- architecture: ia32
architecture_node: x86
target_architecture: ia32
- architecture: x64
architecture_node: x64
target_architecture: x64
- electron: 33.3.0
node: 20.18.1
- electron: 33.2.0
node: 20.18.0
- electron: 33.1.0
node: 20.18.0
- electron: 33.0.0
node: 20.18.0
- electron: 32.2.0
node: 20.18.0
- electron: 32.1.0
node: 20.17.0
- electron: 32.0.0
node: 20.16.0
- electron: 31.7.0
node: 20.18.0
- electron: 31.6.0
node: 20.17.0
- electron: 31.5.0
node: 20.16.0
- electron: 31.4.0
node: 20.16.0
- electron: 31.3.0
node: 20.16.0
- electron: 31.2.0
node: 20.16.0
- electron: 31.1.0
node: 20.16.0
- electron: 31.0.0
node: 20.16.0
- electron: 30.5.0
node: 20.15.1
- electron: 30.4.0
node: 20.15.1
- electron: 30.3.0
node: 20.15.1
- electron: 30.2.0
node: 20.15.1
- electron: 30.1.0
node: 20.15.1
- electron: 30.0.0
node: 20.15.1
- electron: 29.4.0
node: 20.9.0
- electron: 29.3.0
node: 20.9.0
- electron: 29.2.0
node: 20.9.0
- electron: 29.1.0
node: 20.9.0
- electron: 29.0.0
node: 20.9.0
exclude:
- os: macos-13
architecture: ia32
- os: ubuntu-20.04
architecture: arm64
- os: windows-2019
architecture: arm64
- os: ubuntu-20.04
architecture: ia32
runs-on: ${{ matrix.os }}
steps:
- name: Set up GCC
uses: egor-tensin/setup-gcc@v1
with:
version: 11
platform: ${{matrix.architecture}}
if: ${{ matrix.os == 'ubuntu-20.04' }}
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python_version }}
- uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node }}
architecture: ${{ matrix.architecture_node }}
- run: node --version
- run: npm --version
- name: Get npm cache directory
id: npm-cache-dir
shell: bash
run: echo "dir=$(npm config get cache)" >> ${GITHUB_OUTPUT}
- uses: actions/cache@v4
with:
path: ${{ steps.npm-cache-dir.outputs.dir }}
key: ${{ runner.os }}-electron-${{ matrix.target_architecture }}-${{ matrix.architecture }}-${{ matrix.electron }}-${{ hashFiles('**/package-lock.json') }}
- run: npm install --build-from-source
env:
npm_config_arch: ${{ matrix.architecture }}
npm_config_msbuild_path: 'C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\MSBuild\Current\Bin\MSBuild.exe'
npm_config_target_arch: ${{ matrix.target_architecture }}
npm_config_target: ${{ matrix.electron }}
npm_config_disturl: https://artifacts.electronjs.org/headers/dist
npm_config_runtime: electron
npm_config_python: python${{ matrix.python_version }}
CFLAGS: ${{ matrix.extra_compile_flags }}
CPPFLAGS: ${{ matrix.extra_compile_flags }}
- uses: Wandalen/wretry.action@v3
with:
command: npm install -g electron@${{ matrix.electron }} electron-mocha@${{ matrix.electron_mocha_version }}
attempt_limit: 3
attempt_delay: 10000
- name: Run test
uses: coactions/setup-xvfb@90473c3ebc69533a1a6e0505c36511b69c8c3135
with:
run: npm run test:electron
if: ${{ matrix.target_architecture != 'arm64' }}
- run: ./node_modules/.bin/node-pre-gyp package testpackage
env:
npm_config_runtime: electron
npm_config_target: ${{ matrix.electron }}
if: ${{ matrix.target_architecture != 'arm64' }}
- run: ./node_modules/.bin/node-pre-gyp package --target_arch=${{ matrix.target_architecture }}
if: ${{ matrix.target_architecture == 'arm64' }}
env:
npm_config_runtime: electron
npm_config_target: ${{ matrix.electron }}
- uses: actions/upload-artifact@v4
with:
path: build/stage/julianhille/MuhammaraJS/releases/download/**/*.gz
name: bindings-electron-${{ matrix.os }}-${{ matrix.target_architecture }}-${{matrix.electron}}
if-no-files-found: error