feat: Use new versioning strategy

- Rename BuildHash to SCMVersion
- Expose the actual commit hash as a new `commit_hash.txt`
- Update GetGitHash() to actually return the git hash
This commit is contained in:
Kaz Wolfe 2024-07-14 11:07:36 -07:00
parent 0c1b2a03b2
commit 2b96f2187c
No known key found for this signature in database
GPG key ID: 258813F53A16EBB4
9 changed files with 67 additions and 61 deletions

View file

@ -137,6 +137,7 @@ jobs:
$newVersion = [System.IO.File]::ReadAllText("$(Get-Location)\scratch\TEMP_gitver.txt")
$revision = [System.IO.File]::ReadAllText("$(Get-Location)\scratch\revision.txt")
$commitHash = [System.IO.File]::ReadAllText("$(Get-Location)\scratch\commit_hash.txt")
Remove-Item -Force -Recurse .\scratch
if (Test-Path -Path $branchName) {
@ -147,7 +148,7 @@ jobs:
} else {
Move-Item -Force ".\canary.zip" ".\${branchName}\latest.zip"
$versionData.AssemblyVersion = $newVersion
$versionData | add-member -Force -Name "GitSha" $newVersion -MemberType NoteProperty
$versionData | add-member -Force -Name "GitSha" $commitHash -MemberType NoteProperty
$versionData | add-member -Force -Name "Revision" $revision -MemberType NoteProperty
$versionData | ConvertTo-Json -Compress | Out-File ".\${branchName}\version"
}