Skip to content

Commit

Permalink
Adding MinVer
Browse files Browse the repository at this point in the history
  • Loading branch information
OsirisTerje committed Jan 13, 2025
1 parent 188523c commit 4f699d9
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 4 deletions.
11 changes: 10 additions & 1 deletion .github/workflows/Version.Nuget.Publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,17 @@ jobs:
8.x
- name: Install dependencies
run: dotnet restore

- name: Determine version using MinVer
run: |
dotnet tool install --global minver-cli
export PATH="$PATH:/home/runner/.dotnet/tools"
VERSION=$(minver)
echo "##[set-output name=version;]$VERSION"
id: minver

- name: Build
run: dotnet build --configuration Release --no-restore --verbosity normal
run: dotnet build --configuration Release --no-restore --verbosity normal -p:Version=${{ steps.minver.outputs.version }}
# Publish
# Create the NuGet package in the package folder
- name: Pack
Expand Down
4 changes: 2 additions & 2 deletions WrapThat.Version.sln
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = ".github", ".github", "{6E85
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "workflows", "workflows", "{E1D99280-F1B5-4834-8878-B62E196D72B3}"
ProjectSection(SolutionItems) = preProject
Version.CI.yml = Version.CI.yml
Version.Nuget.Publish.yml = Version.Nuget.Publish.yml
.github\workflows\Version.CI.yml = .github\workflows\Version.CI.yml
.github\workflows\Version.Nuget.Publish.yml = .github\workflows\Version.Nuget.Publish.yml
EndProjectSection
EndProject
Global
Expand Down
9 changes: 8 additions & 1 deletion WrapThat.Version/WrapThat.Version.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,15 @@
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
<PackageId>WrapThat.Version</PackageId>
<Version>1.2.0</Version>
</PropertyGroup>

<PropertyGroup>
<Version>0.0.0</Version>
<!-- Fallback version for local builds without MinVer -->
<MinVerVersionOverride Condition="'$(Version)' == ''">0.0.0</MinVerVersionOverride>
</PropertyGroup>


<ItemGroup>
<FrameworkReference Include="Microsoft.AspNetCore.App" />
</ItemGroup>
Expand Down

0 comments on commit 4f699d9

Please sign in to comment.