@@ -44,16 +44,23 @@ jobs:
4444 steps :
4545 - name : Log input parameter
4646 run : |
47+ BRANCH_NAME=${GITHUB_REF#refs/heads/}
48+
49+ echo "Branch: $BRANCH_NAME"
4750 echo "Unity version: $UNITY_VERSION"
4851 echo "Create tags: $CREATE_TAGS"
49- echo "URP branch: $URP_BRANCH"
5052 echo "Only create tags: $TAGS_ONLY"
5153 echo "Merge master into branch: $MERGE_MASTER"
5254 echo "Custom cli arguments: $CUSTOM_PARAMETERS"
55+ if [[ "$BRANCH_NAME" == *"urp"* ]]
56+ then
57+ echo "urp: true"
58+ else
59+ echo "urp: false"
60+ fi
5361 env :
5462 UNITY_VERSION : ${{ inputs.unityVersion }}
5563 CREATE_TAGS : ${{ inputs.createTags }}
56- URP_BRANCH : ${{ inputs.urp }}
5764 TAGS_ONLY : ${{ inputs.tagsOnly }}
5865 MERGE_MASTER : ${{ inputs.mergeMaster }}
5966 CUSTOM_PARAMETERS : ${{ inputs.customParameters }}
@@ -107,15 +114,15 @@ jobs:
107114 - name : Set upgrade name
108115 id : upgrade_name
109116 run : |
110- if [[ "$URP_BRANCH" == "true" ]]
117+ BRANCH_NAME=${GITHUB_REF#refs/heads/}
118+ if [[ "$BRANCH_NAME" == *"urp"* ]]
111119 then
112120 echo "NAME=$UNITY_VERSION-urp" >> $GITHUB_OUTPUT
113121 else
114122 echo "NAME=$UNITY_VERSION" >> $GITHUB_OUTPUT
115123 fi
116124 env :
117125 UNITY_VERSION : ${{ inputs.unityVersion }}
118- URP_BRANCH : ${{ inputs.urp }}
119126
120127 - name : Log variables
121128 run : |
@@ -164,22 +171,34 @@ jobs:
164171 - name : Add tags
165172 if : ${{ inputs.createTags || inputs.tagsOnly }}
166173 run : |
167- if [[ "$URP_BRANCH" == "true" ]]
174+ # Extract the first four characters of UNITY_VERSION
175+ UNITY_YEAR=${UNITY_VERSION:0:4}
176+ BRANCH_NAME=${GITHUB_REF#refs/heads/}
177+
178+ if [[ "$BRANCH_NAME" == *"urp"* ]]
168179 then
169- git tag -a -f $UNITY_VERSION-urp-webgl1 -m "[Automated workflow] Created by upgrade-unity"
180+ if [[ "$UNITY_YEAR" < "2023" ]]
181+ then
182+ git tag -a -f $UNITY_VERSION-urp-webgl1 -m "[Automated workflow] Created by upgrade-unity"
183+ fi
170184 git tag -a -f $UNITY_VERSION-urp-webgl2 -m "[Automated workflow] Created by upgrade-unity"
171185 git tag -a -f $UNITY_VERSION-urp-webgl2-debug -m "[Automated workflow] Created by upgrade-unity"
172186 else
173- git tag -a -f $UNITY_VERSION-minsize-webgl1 -m "[Automated workflow] Created by upgrade-unity"
174- git tag -a -f $UNITY_VERSION-webgl1 -m "[Automated workflow] Created by upgrade-unity"
175- git tag -a -f $UNITY_VERSION-webgl2 -m "[Automated workflow] Created by upgrade-unity"
187+ if [[ "$UNITY_YEAR" < "2023" ]]
188+ then
189+ git tag -a -f $UNITY_VERSION-minsize-webgl1 -m "[Automated workflow] Created by upgrade-unity"
190+ git tag -a -f $UNITY_VERSION-webgl1 -m "[Automated workflow] Created by upgrade-unity"
191+ else
192+ git tag -a -f $UNITY_VERSION-minsize-webgl2 -m "[Automated workflow] Created by upgrade-unity"
193+ fi
176194 # Push tags in between - pushing more than 3 tags won't trigger tag workflows
177195 git push origin -f --tags
196+
197+ git tag -a -f $UNITY_VERSION-webgl2 -m "[Automated workflow] Created by upgrade-unity"
178198 git tag -a -f $UNITY_VERSION-webgl2-debug -m "[Automated workflow] Created by upgrade-unity"
179199 fi
180200
181201 git push origin -f --tags
182202 env :
183203 UNITY_VERSION : ${{ inputs.unityVersion }}
184- URP_BRANCH : ${{ inputs.urp }}
185204
0 commit comments