Last active
December 12, 2020 20:22
-
-
Save PadreSVK/33775e7dc16058b2d99cadef64a1d572 to your computer and use it in GitHub Desktop.
Simple nuget autoincrement of nuget prerelease version based on branch policy
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<Project Sdk="Microsoft.NET.Sdk"> | |
<PropertyGroup> | |
<TargetFramework>netstandard2.0</TargetFramework> | |
<Version>1.0.1</Version> | |
<MainVersionSchemeBranch>master</MainVersionSchemeBranch> | |
<RepositoryUrl>https://github.com/PadreSVK/plzen-2020-web-development.git</RepositoryUrl> | |
</PropertyGroup> | |
<ItemGroup> | |
<PackageReference Include="GitInfo" Version="2.1.2"> | |
<PrivateAssets>all</PrivateAssets> | |
<IncludeAssets>runtime; build; native; contentfiles; analyzers</IncludeAssets> | |
</PackageReference> | |
</ItemGroup> | |
<!-- https://github.com/kzu/GitInfo/blob/main/src/GitInfo/build/GitInfo.targets#L544 --> | |
<Target Name="DecorateVersionsWithGitSha" AfterTargets="GitVersion"> | |
<PropertyGroup> | |
<!--https://docs.microsoft.com/en-us/dotnet/core/tools/csproj--> | |
<RepositoryCommit>$(GitSha)</RepositoryCommit> | |
<RepositoryBranch>$(GitBranch)</RepositoryBranch> | |
<InformationalVersion>$(Version)-sha$(GitSha)</InformationalVersion> | |
</PropertyGroup> | |
<!-- for pre release versions of nugets () --> | |
<PropertyGroup Condition="'$(GitBranch)' != '$(MainVersionSchemeBranch)'"> | |
<Version>$(Version)-pre$(GitCommit)</Version> | |
<PackageVersion>$(Version)</PackageVersion> | |
</PropertyGroup> | |
</Target> | |
</Project> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment