@@ -87,11 +87,33 @@ jobs:
87
87
strategy :
88
88
fail-fast : false
89
89
matrix :
90
- # this needs to be a valid target of https://www.electron.build/linux#target
91
- pkg_to_build : ['deb', 'rpm', 'freebsd', 'AppImage']
90
+ # `electron_target` needs to be a valid target of https://www.electron.build/linux#target
91
+ include :
92
+ - identifier : deb
93
+ electron_target : deb
94
+ cache_suffix : linux-deb
95
+ is_qa : false
96
+ - identifier : rpm
97
+ electron_target : rpm
98
+ cache_suffix : linux-rpm
99
+ is_qa : false
100
+ - identifier : freebsd
101
+ electron_target : freebsd
102
+ cache_suffix : linux-freebsd
103
+ is_qa : false
104
+ - identifier : AppImage
105
+ electron_target : AppImage
106
+ cache_suffix : linux-AppImage
107
+ is_qa : false
108
+ - identifier : deb-qa
109
+ electron_target : deb
110
+ cache_suffix : linux-deb
111
+ is_qa : true
112
+ name : ' ${{ matrix.identifier }}'
92
113
93
114
env :
94
115
GH_TOKEN : ${{ secrets.GITHUB_TOKEN }}
116
+
95
117
steps :
96
118
- run : git config --global core.autocrlf false
97
119
@@ -100,10 +122,14 @@ jobs:
100
122
with :
101
123
ref : ${{ github.event_name == 'workflow_dispatch' && github.event.inputs.target_branch || github.ref }}
102
124
125
+ - name : Custom build for QA if needed
126
+ if : ${{ matrix.is_qa == true }}
127
+ uses : ./actions/sed_for_qa
128
+
103
129
- name : Setup & Build
104
130
uses : ./actions/setup_and_build
105
131
with :
106
- cache_suffix : ${{ matrix.pkg_to_build }}
132
+ cache_suffix : ${{ matrix.cache_suffix }}
107
133
108
134
- name : Lint Files
109
135
# no need to lint files on all platforms
@@ -116,41 +142,41 @@ jobs:
116
142
- name : Unit Test
117
143
run : yarn test
118
144
119
- - name : Make release build but do not publish ${{ matrix.pkg_to_build }}
145
+ - name : Make release build but do not publish ${{ matrix.identifier }}
120
146
# we do want this part to run only when version_tag is unset (i.e. we are not making a release)
121
147
if : ${{ needs.create_draft_release_if_needed.outputs.version_tag == '' }}
122
148
run : |
123
- sed -i 's/"target": "deb"/"target": "${{ matrix.pkg_to_build }}"/g' package.json && yarn build-release
149
+ sed -i 's/"target": "deb"/"target": "${{ matrix.electron_target }}"/g' package.json && yarn build-release
124
150
125
- - name : Upload artefacts ${{ matrix.pkg_to_build }}
151
+ - name : Upload artefacts ${{ matrix.identifier }}
126
152
# we do want this part to run only when version_tag is unset (i.e. we are not making a release)
127
153
if : ${{ needs.create_draft_release_if_needed.outputs.version_tag == '' }}
128
154
uses : ./actions/upload_prod_artefacts
129
155
with :
130
- upload_prefix : ${{ runner.os }}-${{ runner.arch }}-${{ matrix.pkg_to_build }}
156
+ upload_prefix : ${{ runner.os }}-${{ runner.arch }}-${{ matrix.identifier }}
131
157
132
- - name : Make release build & publish ${{ matrix.pkg_to_build }}
158
+ - name : Make release build & publish ${{ matrix.identifier }}
133
159
if : ${{ needs.create_draft_release_if_needed.outputs.version_tag != '' }}
134
160
run : |
135
- sed -i 's/"target": "deb"/"target": "${{ matrix.pkg_to_build }}"/g' package.json && yarn build-release-publish
161
+ sed -i 's/"target": "deb"/"target": "${{ matrix.electron_target }}"/g' package.json && yarn build-release-publish
136
162
137
163
- name : Backup release metadata
138
164
# only run this on "push" to "master" or alpha releases
139
165
# Note: The jobs are overwriting each other's latest-linux.yml.
140
166
# So, we upload all of them as artifacts, and then merge them (see `post_build_linux`)
141
167
# note: freebsd does not generate a latest-linux.yml file so we exclude it
142
- if : ${{ needs.create_draft_release_if_needed.outputs.version_tag != '' && matrix.pkg_to_build != 'freebsd' }}
168
+ if : ${{ needs.create_draft_release_if_needed.outputs.version_tag != '' && matrix.identifier != 'freebsd' }}
143
169
shell : bash
144
170
run : |
145
- mv dist/latest-linux.yml dist/latest-linux-${{ matrix.pkg_to_build }}-${{ github.sha }}.yml
171
+ mv dist/latest-linux.yml dist/latest-linux-${{ matrix.electron_target }}-${{ github.sha }}.yml
146
172
147
173
- name : Upload release metadata
148
174
# only run this on "push" to "master" or alpha releases
149
- if : ${{ needs.create_draft_release_if_needed.outputs.version_tag != '' && matrix.pkg_to_build != 'freebsd' }}
175
+ if : ${{ needs.create_draft_release_if_needed.outputs.version_tag != '' && matrix.identifier != 'freebsd' }}
150
176
uses : actions/upload-artifact@v4
151
177
with :
152
- name : latest-linux-${{ matrix.pkg_to_build }}-${{ github.sha }}.yml
153
- path : dist/latest-linux-${{ matrix.pkg_to_build }}-${{ github.sha }}.yml
178
+ name : latest-linux-${{ matrix.electron_target }}-${{ github.sha }}.yml
179
+ path : dist/latest-linux-${{ matrix.electron_target }}-${{ github.sha }}.yml
154
180
155
181
post_build_linux :
156
182
needs : [create_draft_release_if_needed, build_linux]
@@ -199,6 +225,7 @@ jobs:
199
225
needs : [create_draft_release_if_needed]
200
226
env :
201
227
GH_TOKEN : ${{ secrets.GITHUB_TOKEN }}
228
+ name : ' windows x64'
202
229
steps :
203
230
- run : git config --global core.autocrlf false
204
231
@@ -234,41 +261,20 @@ jobs:
234
261
235
262
# We want both arm64 and intel mac builds, and according to this https://docs.github.com/en/actions/using-github-hosted-runners/using-github-hosted-runners/about-github-hosted-runners#supported-runners-and-hardware-resources macos-14 and above is always arm64 and macos-13 is the last intel runner
236
263
# NOTE x64 builds made on an arm64 host will not bundle the native modules correctly https://github.com/electron-userland/electron-builder/issues/8646
237
- build_mac_arm64 :
238
- needs : [create_draft_release_if_needed]
239
- runs-on : macos-14
240
- env :
241
- GH_TOKEN : ${{ secrets.GITHUB_TOKEN }}
242
- MAC_CERTIFICATE : ${{ secrets.MAC_CERTIFICATE }}
243
- MAC_CERTIFICATE_PASSWORD : ${{ secrets.MAC_CERTIFICATE_PASSWORD }}
244
- SIGNING_APPLE_ID : ${{ secrets.SIGNING_APPLE_ID }}
245
- SIGNING_APP_PASSWORD : ${{ secrets.SIGNING_APP_PASSWORD }}
246
- SIGNING_TEAM_ID : ${{ secrets.SIGNING_TEAM_ID }}
247
- steps :
248
- - run : git config --global core.autocrlf false
249
-
250
- - name : Checkout git repo
251
- uses : actions/checkout@v4
252
- with :
253
- ref : ${{ github.event_name == 'workflow_dispatch' && github.event.inputs.target_branch || github.ref }}
254
-
255
- - name : Setup & Build
256
- uses : ./actions/setup_and_build
257
- with :
258
- cache_suffix : mac-arm64
259
-
260
- # we want to test on all platforms since some are testing the rendered menus (and are dependent on the platform)
261
- - name : Unit Test
262
- run : yarn test
264
+ build_mac :
265
+ strategy :
266
+ matrix :
267
+ include :
268
+ - architecture : arm64
269
+ cache_suffix : mac-arm64
270
+ runner : macos-14
263
271
264
- - name : Make release build arm64
265
- uses : ./actions/make_release_build
266
- with :
267
- architecture : arm64
268
- should_publish : ${{ needs.create_draft_release_if_needed.outputs.version_tag != ''}}
272
+ - architecture : x64
273
+ cache_suffix : mac-x64
274
+ runner : macos-13
275
+ runs-on : ${{ matrix.runner }}
276
+ name : ' ${{ matrix.architecture }} '
269
277
270
- build_mac_x64 :
271
- runs-on : macos-13
272
278
needs : [create_draft_release_if_needed]
273
279
env :
274
280
GH_TOKEN : ${{ secrets.GITHUB_TOKEN }}
@@ -288,20 +294,20 @@ jobs:
288
294
- name : Setup & Build
289
295
uses : ./actions/setup_and_build
290
296
with :
291
- cache_suffix : mac-x64
297
+ cache_suffix : ${{ matrix.cache_suffix }}
292
298
293
299
# we want to test on all platforms since some are testing the rendered menus (and are dependent on the platform)
294
300
- name : Unit Test
295
301
run : yarn test
296
302
297
- - name : Make release build x64
303
+ - name : Make release build ${{ matrix.architecture }}
298
304
uses : ./actions/make_release_build
299
305
with :
300
- architecture : x64
306
+ architecture : ${{ matrix.architecture }}
301
307
should_publish : ${{ needs.create_draft_release_if_needed.outputs.version_tag != '' }}
302
308
303
309
post_build_mac :
304
- needs : [create_draft_release_if_needed, build_mac_arm64, build_mac_x64 ]
310
+ needs : [create_draft_release_if_needed, build_mac ]
305
311
runs-on : ubuntu-22.04
306
312
if : ${{ needs.create_draft_release_if_needed.outputs.version_tag != '' }}
307
313
env :
0 commit comments