Get version from tag

This commit is contained in:
2022-12-19 19:15:44 +01:00
parent c1c11e9b4f
commit 218a290e10
4 changed files with 38 additions and 3 deletions

View File

@@ -1 +1,15 @@
gci env:\
gci env:\
if((Get-Content env:\GITHUB_REF_TYPE) -ne "tag")
{
Return
}
$version = (Get-Content env:\GITHUB_REF).Replace("refs/tags/v", "")
$git_sha = (Get-Content env:\GITHUB_SHA).Substring(0, 8)
Write-Host $version
Write-Host $git_sha
(Get-Content src\Alma\Alma.csproj).Replace("0.0.0", $version).Replace("development", $git_sha) | Set-Content src\Alma\Alma.csproj
Write-Host (Get-Content src\Alma\Alma.csproj)