File tree Expand file tree Collapse file tree 2 files changed +28
-0
lines changed
Expand file tree Collapse file tree 2 files changed +28
-0
lines changed Original file line number Diff line number Diff line change 2424 - name : Checkout
2525 uses : actions/checkout@v4
2626
27+ - name : Install vpatch
28+ shell : pwsh
29+ run : |
30+ dotnet tool install --global Nefarius.Tools.Vpatch
31+ "$env:USERPROFILE\.dotnet\tools" | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8 -Append
32+
33+ - name : Stamp version in resource file
34+ shell : pwsh
35+ run : |
36+ $tagVersion = "${{ github.ref_name }}".TrimStart("v")
37+ $versionParts = $tagVersion.Split(".")
38+ if ($versionParts.Count -eq 3) {
39+ $tagVersion = "$tagVersion.0"
40+ }
41+ elseif ($versionParts.Count -ne 4) {
42+ throw "Unsupported tag version format '$tagVersion'. Expected 3 or 4 numeric segments."
43+ }
44+
45+ $versionParts = $tagVersion.Split(".")
46+ foreach ($part in $versionParts) {
47+ if ($part -notmatch '^\d+$') {
48+ throw "Unsupported tag version '$tagVersion'. Each segment in versionParts must be numeric before calling vpatch."
49+ }
50+ }
51+
52+ vpatch --stamp-version "$tagVersion" --target-file "Injector/Injector.rc" --resource.file-version --resource.product-version
53+
2754 - name : Add MSBuild to PATH
2855 uses : microsoft/setup-msbuild@v2
2956
Original file line number Diff line number Diff line change @@ -396,3 +396,4 @@ FodyWeavers.xsd
396396
397397# JetBrains Rider
398398* .sln.iml
399+ /.release-local
You can’t perform that action at this time.
0 commit comments