@@ -28,7 +28,7 @@ Write-Output '::group::Environment variables'
28
28
Get-ChildItem - Path Env: | Select-Object Name, Value | Sort-Object Name | Format-Table - AutoSize
29
29
Write-Output ' ::endgroup::'
30
30
31
- Write-Output " ::group::Set configuration"
31
+ Write-Output ' ::group::Set configuration'
32
32
if (-not (Test-Path - Path $env: ConfigurationFile - PathType Leaf)) {
33
33
Write-Output " Configuration file not found at [$env: ConfigurationFile ]"
34
34
} else {
@@ -214,40 +214,38 @@ if ($createPrerelease -or $createRelease) {
214
214
Write-Error " Failed to create the release [$newVersion ]."
215
215
exit $LASTEXITCODE
216
216
}
217
- return
218
- }
219
-
220
- gh release create $newVersion -- title $newVersion -- generate- notes
221
- if ($LASTEXITCODE -ne 0 ) {
222
- Write-Error " Failed to create the release [$newVersion ]."
223
- exit $LASTEXITCODE
224
- }
225
-
226
- if ($createMajorTag ) {
227
- $majorTag = (' {0}{1}' -f $versionPrefix , $major )
228
- git tag -f $majorTag ' main'
217
+ } else {
218
+ gh release create $newVersion -- title $newVersion -- generate- notes
229
219
if ($LASTEXITCODE -ne 0 ) {
230
- Write-Error " Failed to create major tag [$majorTag ]."
220
+ Write-Error " Failed to create the release [$newVersion ]."
231
221
exit $LASTEXITCODE
232
222
}
233
- }
234
223
235
- if ($createMinorTag ) {
236
- $minorTag = (' {0}{1}.{2}' -f $versionPrefix , $major , $minor )
237
- git tag -f $minorTag ' main'
224
+ if ($createMajorTag ) {
225
+ $majorTag = (' {0}{1}' -f $versionPrefix , $major )
226
+ git tag -f $majorTag ' main'
227
+ if ($LASTEXITCODE -ne 0 ) {
228
+ Write-Error " Failed to create major tag [$majorTag ]."
229
+ exit $LASTEXITCODE
230
+ }
231
+ }
232
+
233
+ if ($createMinorTag ) {
234
+ $minorTag = (' {0}{1}.{2}' -f $versionPrefix , $major , $minor )
235
+ git tag -f $minorTag ' main'
236
+ if ($LASTEXITCODE -ne 0 ) {
237
+ Write-Error " Failed to create minor tag [$minorTag ]."
238
+ exit $LASTEXITCODE
239
+ }
240
+ }
241
+
242
+ git push origin -- tags -- force
238
243
if ($LASTEXITCODE -ne 0 ) {
239
- Write-Error " Failed to create minor tag [ $minorTag ]. "
244
+ Write-Error ' Failed to push tags. '
240
245
exit $LASTEXITCODE
241
246
}
247
+ Write-Output ' ::endgroup::'
242
248
}
243
-
244
- git push origin -- tags -- force
245
- if ($LASTEXITCODE -ne 0 ) {
246
- Write-Error ' Failed to push tags.'
247
- exit $LASTEXITCODE
248
- }
249
- Write-Output ' ::endgroup::'
250
-
251
249
} else {
252
250
Write-Output ' Skipping release creation.'
253
251
}
0 commit comments