27
27
SHOULD_PUBLISH_ALPHA : ${{ github.event_name == 'push' && startsWith(github.ref, 'refs/heads/release') && contains(github.ref, '-alpha.') }}
28
28
29
29
jobs :
30
+ create_draft_release :
31
+ runs-on : ubuntu-latest
32
+ env :
33
+ GH_TOKEN : ${{ secrets.GITHUB_TOKEN }}
34
+ outputs :
35
+ version_tag : ${{ steps.get_version.outputs.VERSION_TAG }}
36
+ steps :
37
+ - name : Checkout git repo
38
+ # only run this on "push" to "master" or alpha releases
39
+ uses : actions/checkout@v4
40
+ # We only need a few files in this run, no point cloning everything
41
+ with :
42
+ sparse-checkout : |
43
+ package.json
44
+ build/release-notes.md
45
+ build/release-notes-alpha.md
46
+ sparse-checkout-cone-mode : false
47
+
48
+ - name : Get version tag from package.json
49
+ id : get_version
50
+ run : |
51
+ version=$(node -p "require('./package.json').version")
52
+ echo "VERSION_TAG=$version" >> "$GITHUB_OUTPUT"
53
+
54
+ - name : Create draft release
55
+ # only run this on "push" to "master" or alpha releases
56
+ if : ${{ env.SHOULD_PUBLISH == 'true' || env.SHOULD_PUBLISH_ALPHA == 'true' }}
57
+ uses : ncipollo/release-action@v1
58
+ with :
59
+ tag : v${{ steps.get_version.outputs.VERSION_TAG }}
60
+ name : ' Session ${{ steps.get_version.outputs.VERSION_TAG }}'
61
+ draft : true
62
+ bodyFile : ${{ env.SHOULD_PUBLISH_ALPHA == 'true' && 'build/release-notes-alpha.md' || 'build/release-notes.md' }}
63
+ allowUpdates : true
64
+
30
65
build_linux :
31
66
runs-on : ubuntu-22.04
67
+ needs : [create_draft_release]
32
68
strategy :
33
69
fail-fast : false
34
70
matrix :
@@ -111,18 +147,8 @@ jobs:
111
147
sparse-checkout : |
112
148
package.json
113
149
build/setup-release-combine.sh
114
- build/release-notes.md
115
- build/release-notes-alpha.md
116
150
sparse-checkout-cone-mode : false
117
151
118
- - name : Get version tag from package.json
119
- id : get_version
120
- # only run this on "push" to "master" or alpha releases
121
- if : ${{ env.SHOULD_PUBLISH == 'true' || env.SHOULD_PUBLISH_ALPHA == 'true' }}
122
- run : |
123
- version=$(node -p "require('./package.json').version")
124
- echo "VERSION_TAG=$version" >> "$GITHUB_OUTPUT"
125
-
126
152
- name : Download release metadata
127
153
# only run this on "push" to "master" or alpha releases
128
154
if : ${{ env.SHOULD_PUBLISH == 'true' || env.SHOULD_PUBLISH_ALPHA == 'true' }}
@@ -143,10 +169,7 @@ jobs:
143
169
if : ${{ env.SHOULD_PUBLISH == 'true' || env.SHOULD_PUBLISH_ALPHA == 'true' }}
144
170
uses : ncipollo/release-action@v1
145
171
with :
146
- tag : v${{ steps.get_version.outputs.VERSION_TAG }}
147
- name : ' Session ${{ steps.get_version.outputs.VERSION_TAG }}'
148
- draft : true
149
- bodyFile : ${{ env.SHOULD_PUBLISH_ALPHA == 'true' && 'build/release-notes-alpha.md' || 'build/release-notes.md' }}
172
+ tag : v${{ needs.create_draft_release.outputs.version_tag }}
150
173
artifacts : ' dist/latest-linux.yml'
151
174
allowUpdates : true
152
175
omitNameDuringUpdate : true
@@ -156,6 +179,7 @@ jobs:
156
179
157
180
build_windows :
158
181
runs-on : windows-2022
182
+ needs : [create_draft_release]
159
183
env :
160
184
GH_TOKEN : ${{ secrets.GITHUB_TOKEN }}
161
185
steps :
@@ -193,6 +217,7 @@ jobs:
193
217
# 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
194
218
# NOTE x64 builds made on an arm64 host will not bundle the native modules correctly https://github.com/electron-userland/electron-builder/issues/8646
195
219
build_mac_arm64 :
220
+ needs : [create_draft_release]
196
221
runs-on : macos-14
197
222
env :
198
223
GH_TOKEN : ${{ secrets.GITHUB_TOKEN }}
@@ -224,6 +249,7 @@ jobs:
224
249
225
250
build_mac_x64 :
226
251
runs-on : macos-13
252
+ needs : [create_draft_release]
227
253
env :
228
254
GH_TOKEN : ${{ secrets.GITHUB_TOKEN }}
229
255
MAC_CERTIFICATE : ${{ secrets.MAC_CERTIFICATE }}
@@ -255,24 +281,19 @@ jobs:
255
281
post_build_mac :
256
282
needs : [build_mac_arm64, build_mac_x64]
257
283
runs-on : ubuntu-22.04
284
+ env :
285
+ GH_TOKEN : ${{ secrets.GITHUB_TOKEN }}
258
286
steps :
259
287
- name : Checkout git repo
260
288
# only run this on "push" to "master" or alpha releases
261
289
if : ${{ env.SHOULD_PUBLISH == 'true' || env.SHOULD_PUBLISH_ALPHA == 'true' }}
262
290
uses : actions/checkout@v4
263
- # We only need the package.json file in this run (to extract the version being built)
291
+ # We only need a few files in this run, no point cloning everything
264
292
with :
265
293
sparse-checkout : |
266
294
package.json
267
295
build/setup-release-combine.sh
268
-
269
- - name : Get version tag from package.json
270
- id : get_version
271
- # only run this on "push" to "master" or alpha releases
272
- if : ${{ env.SHOULD_PUBLISH == 'true' || env.SHOULD_PUBLISH_ALPHA == 'true' }}
273
- run : |
274
- version=$(node -p "require('./package.json').version")
275
- echo "VERSION_TAG=$version" >> "$GITHUB_OUTPUT"
296
+ sparse-checkout-cone-mode : false
276
297
277
298
- name : Download release metadata
278
299
# only run this on "push" to "master" or alpha releases
@@ -294,13 +315,10 @@ jobs:
294
315
if : ${{ env.SHOULD_PUBLISH == 'true' || env.SHOULD_PUBLISH_ALPHA == 'true' }}
295
316
uses : ncipollo/release-action@v1
296
317
with :
297
- tag : v${{ steps.get_version.outputs.VERSION_TAG }}
298
- name : ' Session ${{ steps.get_version.outputs.VERSION_TAG }}'
299
- draft : true
300
- bodyFile : ${{ env.SHOULD_PUBLISH_ALPHA == 'true' && 'build/release-notes-alpha.md' || 'build/release-notes.md' }}
318
+ tag : v${{ needs.create_draft_release.outputs.version_tag }}
301
319
artifacts : ' dist/latest-mac.yml'
302
320
allowUpdates : true
303
- omitBodyDuringUpdate : true
304
321
omitNameDuringUpdate : true
322
+ omitBodyDuringUpdate : true
305
323
replacesArtifacts : true
306
324
updateOnlyUnreleased : true
0 commit comments