Skip to content

Commit d9d3267

Browse files
committed
auto-replace template referenced version in CI publish
1 parent 8087fef commit d9d3267

1 file changed

Lines changed: 5 additions & 0 deletions

File tree

ci/scripts/Publish-NuGetPackages.ps1

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -115,6 +115,11 @@ function Build-TemplatePackages {
115115
$file = [System.Text.RegularExpressions.Regex]::Replace($file, "\<version\>([^<]+)\</version\>", "<version>" + $version + "</version>")
116116
[System.IO.File]::WriteAllText($path, $file, [System.Text.Encoding]::UTF8)
117117

118+
$templateProjectPath = Join-Path (Split-Path $path) "content/EmptyWeb/DotvvmApplication1.csproj"
119+
$templateProject = [System.IO.File]::ReadAllText($templateProjectPath, [System.Text.Encoding]::UTF8)
120+
$templateProject = [System.Text.RegularExpressions.Regex]::Replace($templateProject, '(?<=<PackageReference Include="DotVVM\.AspNetCore" Version=")[^"]+', $version)
121+
[System.IO.File]::WriteAllText($templateProjectPath, $templateProject, [System.Text.Encoding]::UTF8)
122+
118123
nuget pack $path -outputdirectory "$root/artifacts/packages" | Out-Host
119124
}
120125
finally {

0 commit comments

Comments
 (0)