Skip to content

Commit 6641782

Browse files
committed
fix: ensure workflow does not create multiple draft releases
1 parent 1339ed5 commit 6641782

1 file changed

Lines changed: 17 additions & 7 deletions

File tree

.github/workflows/build.yml

Lines changed: 17 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
name: Build & Release
22

33
env:
4-
GH_TOKEN: ${{ SECRETS.GITHUB_TOKEN }}
4+
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
55

66
on:
77
push:
@@ -13,8 +13,10 @@ defaults:
1313
shell: bash
1414

1515
jobs:
16-
linux_x64:
16+
linux_x64: # <-- Primo job: crea la release
1717
runs-on: ubuntu-latest
18+
env:
19+
ELECTRON_PUBLISH_MODE: always
1820

1921
steps:
2022
- name: Check out Git repository
@@ -30,10 +32,12 @@ jobs:
3032

3133
- name: Release
3234
if: contains(github.ref, 'master')
33-
run: npm run electron:dist:linux:x64 -- --publish always
35+
run: npm run electron:dist:linux:x64 -- --publish $ELECTRON_PUBLISH_MODE
3436

3537
linux_arm64:
3638
runs-on: ubuntu-latest
39+
env:
40+
ELECTRON_PUBLISH_MODE: onTag
3741

3842
steps:
3943
- name: Check out Git repository
@@ -49,10 +53,12 @@ jobs:
4953

5054
- name: Release
5155
if: contains(github.ref, 'master')
52-
run: npm run electron:dist:linux:arm64 -- --publish always
56+
run: npm run electron:dist:linux:arm64 -- --publish $ELECTRON_PUBLISH_MODE
5357

5458
linux_arm:
5559
runs-on: ubuntu-latest
60+
env:
61+
ELECTRON_PUBLISH_MODE: onTag
5662

5763
steps:
5864
- name: Check out Git repository
@@ -68,10 +74,12 @@ jobs:
6874

6975
- name: Release
7076
if: contains(github.ref, 'master')
71-
run: npm run electron:dist:linux:arm -- --publish always
77+
run: npm run electron:dist:linux:arm -- --publish $ELECTRON_PUBLISH_MODE
7278

7379
dmg:
7480
runs-on: macos-latest
81+
env:
82+
ELECTRON_PUBLISH_MODE: onTag
7583

7684
steps:
7785
- name: Check out Git repository
@@ -87,10 +95,12 @@ jobs:
8795

8896
- name: Release
8997
if: contains(github.ref, 'master')
90-
run: npm run electron:dist:mac:x64 -- --publish always
98+
run: npm run electron:dist:mac:x64 -- --publish $ELECTRON_PUBLISH_MODE
9199

92100
exe:
93101
runs-on: windows-latest
102+
env:
103+
ELECTRON_PUBLISH_MODE: onTag
94104

95105
steps:
96106
- name: Check out Git repository
@@ -106,4 +116,4 @@ jobs:
106116

107117
- name: Release
108118
if: contains(github.ref, 'master')
109-
run: npm run electron:dist:win -- --publish always
119+
run: npm run electron:dist:win -- --publish $ELECTRON_PUBLISH_MODE

0 commit comments

Comments
 (0)