Skip to content

Commit f732592

Browse files
authored
Merge pull request #38 from nefarius/version-stamping
Added missing version stamping
2 parents 31ecde8 + 9cd778f commit f732592

File tree

2 files changed

+28
-0
lines changed

2 files changed

+28
-0
lines changed

.github/workflows/release.yml

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,33 @@ jobs:
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

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -396,3 +396,4 @@ FodyWeavers.xsd
396396

397397
# JetBrains Rider
398398
*.sln.iml
399+
/.release-local

0 commit comments

Comments
 (0)