Skip to content

Commit 4f699d9

Browse files
committed
Adding MinVer
1 parent 188523c commit 4f699d9

File tree

3 files changed

+20
-4
lines changed

3 files changed

+20
-4
lines changed

.github/workflows/Version.Nuget.Publish.yml

+10-1
Original file line numberDiff line numberDiff line change
@@ -26,8 +26,17 @@ jobs:
2626
8.x
2727
- name: Install dependencies
2828
run: dotnet restore
29+
30+
- name: Determine version using MinVer
31+
run: |
32+
dotnet tool install --global minver-cli
33+
export PATH="$PATH:/home/runner/.dotnet/tools"
34+
VERSION=$(minver)
35+
echo "##[set-output name=version;]$VERSION"
36+
id: minver
37+
2938
- name: Build
30-
run: dotnet build --configuration Release --no-restore --verbosity normal
39+
run: dotnet build --configuration Release --no-restore --verbosity normal -p:Version=${{ steps.minver.outputs.version }}
3140
# Publish
3241
# Create the NuGet package in the package folder
3342
- name: Pack

WrapThat.Version.sln

+2-2
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,8 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = ".github", ".github", "{6E85
1616
EndProject
1717
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "workflows", "workflows", "{E1D99280-F1B5-4834-8878-B62E196D72B3}"
1818
ProjectSection(SolutionItems) = preProject
19-
Version.CI.yml = Version.CI.yml
20-
Version.Nuget.Publish.yml = Version.Nuget.Publish.yml
19+
.github\workflows\Version.CI.yml = .github\workflows\Version.CI.yml
20+
.github\workflows\Version.Nuget.Publish.yml = .github\workflows\Version.Nuget.Publish.yml
2121
EndProjectSection
2222
EndProject
2323
Global

WrapThat.Version/WrapThat.Version.csproj

+8-1
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,15 @@
1313
<ImplicitUsings>enable</ImplicitUsings>
1414
<Nullable>enable</Nullable>
1515
<PackageId>WrapThat.Version</PackageId>
16-
<Version>1.2.0</Version>
1716
</PropertyGroup>
17+
18+
<PropertyGroup>
19+
<Version>0.0.0</Version>
20+
<!-- Fallback version for local builds without MinVer -->
21+
<MinVerVersionOverride Condition="'$(Version)' == ''">0.0.0</MinVerVersionOverride>
22+
</PropertyGroup>
23+
24+
1825
<ItemGroup>
1926
<FrameworkReference Include="Microsoft.AspNetCore.App" />
2027
</ItemGroup>

0 commit comments

Comments
 (0)