11name : Build and Release
22
33on :
4- workflow_run :
5- workflows : ["Tests"]
6- types :
7- - completed
4+ push :
85 branches : ["main", "develop", "feature/*"]
96
107jobs :
118 build-windows :
12- if : github.event.workflow_run.conclusion == 'success' && (github.event.workflow_run.head_branch == 'main ' || github.event.workflow_run.head_branch == 'develop ' || startsWith(github.event.workflow_run.head_branch , 'feature/'))
9+ if : github.event_name == 'push' || (github.ref_name == 'develop ' || github.ref_name == 'main ' || startsWith(github.ref_name , 'feature/'))
1310 runs-on : windows-latest
1411
1512 outputs :
4239 run : |
4340 $version = (Get-Content package.json | ConvertFrom-Json).version
4441 $shortHash = git rev-parse --short HEAD
45- $branch = "${{ github.event.workflow_run.head_branch }}"
42+ $branch = "${{ github.ref_name }}"
4643
4744 if ($branch -eq "develop") {
4845 $finalVersion = "v$version-dev-$shortHash"
7067 dist/DevNullifier-win-unpacked.zip
7168
7269 build-linux :
73- if : github.event.workflow_run.conclusion == 'success' && (github.event.workflow_run.head_branch == 'main ' || github.event.workflow_run.head_branch == 'develop ' || startsWith(github.event.workflow_run.head_branch , 'feature/'))
70+ if : github.event_name == 'push' || (github.ref_name == 'develop ' || github.ref_name == 'main ' || startsWith(github.ref_name , 'feature/'))
7471 runs-on : ubuntu-latest
7572
7673 steps :
@@ -112,7 +109,7 @@ jobs:
112109 dist/DevNullifier-linux-unpacked.zip
113110
114111 build-macos :
115- if : github.event.workflow_run.conclusion == 'success' && (github.event.workflow_run.head_branch == 'main ' || github.event.workflow_run.head_branch == 'develop ' || startsWith(github.event.workflow_run.head_branch , 'feature/'))
112+ if : github.event_name == 'push' || (github.ref_name == 'develop ' || github.ref_name == 'main ' || startsWith(github.ref_name , 'feature/'))
116113 runs-on : macos-latest
117114
118115 steps :
@@ -151,7 +148,7 @@ jobs:
151148 dist/DevNullifier-mac-unpacked.zip
152149
153150 create-release :
154- if : github.event.workflow_run.conclusion == 'success' && (github.event.workflow_run.head_branch == 'main ' || github.event.workflow_run.head_branch == 'develop ')
151+ if : github.event_name == 'push' || (github.ref_name == 'develop ' || github.ref_name == 'main ')
155152 runs-on : ubuntu-latest
156153 needs : [build-windows, build-linux, build-macos]
157154
@@ -187,7 +184,7 @@ jobs:
187184 GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
188185 with :
189186 tag_name : ${{ needs.build-windows.outputs.version }}
190- release_name : ${{ github.event.workflow_run.head_branch == 'develop' && 'DevNullifier [Pre-release]' || 'DevNullifier' }} ${{ needs.build-windows.outputs.version }}
187+ release_name : ${{ github.ref_name == 'develop' && 'DevNullifier [Pre-release]' || 'DevNullifier' }} ${{ needs.build-windows.outputs.version }}
191188 draft : false
192189 prerelease : ${{ needs.build-windows.outputs.prerelease == 'true' }}
193190
@@ -204,7 +201,7 @@ jobs:
204201 with :
205202 upload_url : ${{ steps.create_release.outputs.upload_url }}
206203 asset_path : ${{ steps.find-windows-installer.outputs.installer_path }}
207- asset_name : ${{ github.event.workflow_run.head_branch == 'develop' && 'DevNullifier-Setup-dev.exe' || 'DevNullifier-Setup.exe' }}
204+ asset_name : ${{ github.ref_name == 'develop' && 'DevNullifier-Setup-dev.exe' || 'DevNullifier-Setup.exe' }}
208205 asset_content_type : application/octet-stream
209206
210207 - name : Upload Windows ZIP Archive
@@ -214,7 +211,7 @@ jobs:
214211 with :
215212 upload_url : ${{ steps.create_release.outputs.upload_url }}
216213 asset_path : artifacts/windows/DevNullifier-win-unpacked.zip
217- asset_name : ${{ github.event.workflow_run.head_branch == 'develop' && 'DevNullifier-win-unpacked-dev.zip' || 'DevNullifier-win-unpacked.zip' }}
214+ asset_name : ${{ github.ref_name == 'develop' && 'DevNullifier-win-unpacked-dev.zip' || 'DevNullifier-win-unpacked.zip' }}
218215 asset_content_type : application/zip
219216
220217 - name : Find Linux files
@@ -238,7 +235,7 @@ jobs:
238235 with :
239236 upload_url : ${{ steps.create_release.outputs.upload_url }}
240237 asset_path : ${{ steps.find-linux-files.outputs.appimage_path }}
241- asset_name : ${{ github.event.workflow_run.head_branch == 'develop' && 'DevNullifier-linux-x64-dev.AppImage' || 'DevNullifier-linux-x64.AppImage' }}
238+ asset_name : ${{ github.ref_name == 'develop' && 'DevNullifier-linux-x64-dev.AppImage' || 'DevNullifier-linux-x64.AppImage' }}
242239 asset_content_type : application/octet-stream
243240
244241 - name : Upload Linux DEB
@@ -248,7 +245,7 @@ jobs:
248245 with :
249246 upload_url : ${{ steps.create_release.outputs.upload_url }}
250247 asset_path : ${{ steps.find-linux-files.outputs.deb_path }}
251- asset_name : ${{ github.event.workflow_run.head_branch == 'develop' && 'DevNullifier-linux-x64-dev.deb' || 'DevNullifier-linux-x64.deb' }}
248+ asset_name : ${{ github.ref_name == 'develop' && 'DevNullifier-linux-x64-dev.deb' || 'DevNullifier-linux-x64.deb' }}
252249 asset_content_type : application/octet-stream
253250
254251 - name : Upload Linux ZIP Archive
@@ -258,7 +255,7 @@ jobs:
258255 with :
259256 upload_url : ${{ steps.create_release.outputs.upload_url }}
260257 asset_path : artifacts/linux/DevNullifier-linux-unpacked.zip
261- asset_name : ${{ github.event.workflow_run.head_branch == 'develop' && 'DevNullifier-linux-unpacked-dev.zip' || 'DevNullifier-linux-unpacked.zip' }}
258+ asset_name : ${{ github.ref_name == 'develop' && 'DevNullifier-linux-unpacked-dev.zip' || 'DevNullifier-linux-unpacked.zip' }}
262259 asset_content_type : application/zip
263260
264261 - name : Upload macOS DMG
@@ -268,7 +265,7 @@ jobs:
268265 with :
269266 upload_url : ${{ steps.create_release.outputs.upload_url }}
270267 asset_path : ${{ steps.find-macos-files.outputs.dmg_path }}
271- asset_name : ${{ github.event.workflow_run.head_branch == 'develop' && 'DevNullifier-mac-x64-dev.dmg' || 'DevNullifier-mac-x64.dmg' }}
268+ asset_name : ${{ github.ref_name == 'develop' && 'DevNullifier-mac-x64-dev.dmg' || 'DevNullifier-mac-x64.dmg' }}
272269 asset_content_type : application/octet-stream
273270
274271 - name : Upload macOS ZIP Archive
@@ -278,5 +275,5 @@ jobs:
278275 with :
279276 upload_url : ${{ steps.create_release.outputs.upload_url }}
280277 asset_path : artifacts/macos/DevNullifier-mac-unpacked.zip
281- asset_name : ${{ github.event.workflow_run.head_branch == 'develop' && 'DevNullifier-mac-unpacked-dev.zip' || 'DevNullifier-mac-unpacked.zip' }}
278+ asset_name : ${{ github.ref_name == 'develop' && 'DevNullifier-mac-unpacked-dev.zip' || 'DevNullifier-mac-unpacked.zip' }}
282279 asset_content_type : application/zip
0 commit comments