Skip to content

Commit f8b3934

Browse files
committed
chore: make drafting release a single step before all jobs start
1 parent 3aef09e commit f8b3934

File tree

1 file changed

+31
-0
lines changed

1 file changed

+31
-0
lines changed

.github/workflows/build-binaries.yml

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,8 +27,36 @@ env:
2727
SHOULD_PUBLISH_ALPHA: ${{ github.event_name == 'push' && startsWith(github.ref, 'refs/heads/release') && contains(github.ref, '-alpha.') }}
2828

2929
jobs:
30+
create_draft_release:
31+
runs-on: ubuntu-latest
32+
env:
33+
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
34+
steps:
35+
- name: Get version tag from package.json
36+
id: get_version
37+
# only run this on "push" to "master" or alpha releases
38+
if: ${{ env.SHOULD_PUBLISH == 'true' || env.SHOULD_PUBLISH_ALPHA == 'true' }}
39+
run: |
40+
version=$(node -p "require('./package.json').version")
41+
echo "VERSION_TAG=$version" >> "$GITHUB_OUTPUT"
42+
- name: Upload changes to draft release
43+
# only run this on "push" to "master" or alpha releases
44+
if: ${{ env.SHOULD_PUBLISH == 'true' || env.SHOULD_PUBLISH_ALPHA == 'true' }}
45+
uses: ncipollo/release-action@v1
46+
with:
47+
tag: v${{ steps.get_version.outputs.VERSION_TAG }}
48+
name: 'Session ${{ steps.get_version.outputs.VERSION_TAG }}'
49+
draft: true
50+
bodyFile: ${{ env.SHOULD_PUBLISH_ALPHA == 'true' && 'build/release-notes-alpha.md' || 'build/release-notes.md' }}
51+
allowUpdates: true
52+
omitNameDuringUpdate: true
53+
omitBodyDuringUpdate: true
54+
replacesArtifacts: true
55+
updateOnlyUnreleased: true
56+
3057
build_linux:
3158
runs-on: ubuntu-22.04
59+
needs: [create_draft_release]
3260
strategy:
3361
fail-fast: false
3462
matrix:
@@ -156,6 +184,7 @@ jobs:
156184

157185
build_windows:
158186
runs-on: windows-2022
187+
needs: [create_draft_release]
159188
env:
160189
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
161190
steps:
@@ -193,6 +222,7 @@ jobs:
193222
# 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
194223
# NOTE x64 builds made on an arm64 host will not bundle the native modules correctly https://github.com/electron-userland/electron-builder/issues/8646
195224
build_mac_arm64:
225+
needs: [create_draft_release]
196226
runs-on: macos-14
197227
env:
198228
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
@@ -224,6 +254,7 @@ jobs:
224254

225255
build_mac_x64:
226256
runs-on: macos-13
257+
needs: [create_draft_release]
227258
env:
228259
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
229260
MAC_CERTIFICATE: ${{ secrets.MAC_CERTIFICATE }}

0 commit comments

Comments
 (0)