Skip to content

Commit eb449ae

Browse files
committed
Add logic to also always build when pushing to master to check if everything is correct there
1 parent 8995ad3 commit eb449ae

File tree

1 file changed

+11
-4
lines changed

1 file changed

+11
-4
lines changed

.github/workflows/release.yml

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,8 @@ on:
55
push:
66
tags:
77
- '*'
8+
branches:
9+
- master
810

911
jobs:
1012
variables:
@@ -28,7 +30,12 @@ jobs:
2830
2931
- name: Set tag
3032
id: set_tag
31-
run: echo "VERSION=${GITHUB_REF/refs\/tags\//}" >> $GITHUB_OUTPUT
33+
run: |
34+
if [[ $GITHUB_REF == refs/tags/* ]]; then
35+
echo "VERSION=${GITHUB_REF/refs\/tags\//}" >> $GITHUB_OUTPUT
36+
else
37+
echo "VERSION=${{ steps.set_unity_version.outputs.VERSION }}-webgl2-master" >> $GITHUB_OUTPUT
38+
fi
3239
3340
- name: Set target name
3441
id: set_build_name
@@ -62,8 +69,8 @@ jobs:
6269
6370
buildProject:
6471
name: Create Unity WebGL Build 🏗
65-
# only build with additional parameters, the tag alone should only create a release draft
66-
if: ${{ needs.variables.outputs.TAG != needs.variables.outputs.UNITY_VERSION }}
72+
# Build if it's a master push or if the tag is not just the unity version
73+
if: ${{ github.ref == 'refs/heads/master' || needs.variables.outputs.TAG != needs.variables.outputs.UNITY_VERSION }}
6774
needs: [ variables ]
6875
runs-on: ubuntu-latest
6976
strategy:
@@ -112,7 +119,7 @@ jobs:
112119
createRelease:
113120
name: Create Github release 🐙
114121
# only run for the pure tag without build parameters
115-
if: ${{ needs.variables.outputs.TAG == needs.variables.outputs.UNITY_VERSION }}
122+
if: ${{ github.ref_type == 'tag' && needs.variables.outputs.TAG == needs.variables.outputs.UNITY_VERSION }}
116123
needs: [ variables ]
117124
runs-on: ubuntu-latest
118125
steps:

0 commit comments

Comments
 (0)