Skip to content

Commit 09ce948

Browse files
authored
Fixed release build scripts (#31)
* Publish release now resets the branch if it exists * Fixed generation of version info to not include CI information for a release build as it will be null Co-authored-by: smaillet <[email protected]>
1 parent 40ec585 commit 09ce948

File tree

2 files changed

+7
-3
lines changed

2 files changed

+7
-3
lines changed

New-GeneratedVersionProps.ps1

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -196,8 +196,6 @@ class CSemVer
196196

197197
$this.BuildMetadata = $buildVersionData['BuildMetadata']
198198

199-
$this.CiBuildName = $buildVersionData['CiBuildName'];
200-
$this.CiBuildIndex = $buildVersionData['CiBuildIndex'];
201199

202200
if( (![string]::IsNullOrEmpty( $this.CiBuildName )) -and [string]::IsNullOrEmpty( $this.CiBuildIndex ) )
203201
{
@@ -209,6 +207,12 @@ class CSemVer
209207
throw 'CiBuildName is required if CiBuildIndex is provided';
210208
}
211209

210+
if( ![string]::IsNullOrEmpty( $this.CiBuildIndex ) -and ![string]::IsNullOrEmpty( $this.CiBuildName ) )
211+
{
212+
$this.CiBuildName = $buildVersionData['CiBuildName'];
213+
$this.CiBuildIndex = $buildVersionData['CiBuildIndex'];
214+
}
215+
212216
$this.OrderedVersion = [CSemVer]::GetOrderedVersion($this.Major, $this.Minor, $this.Patch, $this.PreReleaseVersion)
213217
$fileVer64 = $this.OrderedVersion -shl 1
214218
if($this.CiBuildIndex -and $this.CiBuildName)

OneFlow/Publish-Release.ps1

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ Write-Information 'Fetching from official repository'
3636
Invoke-External git fetch $officialRemoteName
3737

3838
Write-Information "Switching to release branch [$officialReleaseBranch]"
39-
Invoke-External git switch '-c' $releasebranch $officialReleaseBranch
39+
Invoke-External git switch '-C' $releasebranch $officialReleaseBranch
4040

4141
Write-Information 'Creating tag of this branch as the release'
4242
Invoke-External git tag $tagname '-m' "Official release: $tagname"

0 commit comments

Comments
 (0)