Skip to content

Commit

Permalink
Timestamp NuGet packages (#1576)
Browse files Browse the repository at this point in the history
* Timestamp NuGet packages

Several people have been bitten while testing the UpgradeAssistant with
local builds of the Mappings nuget package because every build produces
the same versioned package and if they forget to delete the cached version
in the NuGet cache directory, then their changes will appear to not take
affect because UA is using an old version of their changes.

Also modified the Nerdbank.GitVersioning version.json file to use a base of
"1.0" instead of "1.0.0".

* Use 'preview' instead of 'CI' in the package versioning scheme
  • Loading branch information
jstedfast authored Jun 25, 2024
1 parent 14aba66 commit 1169ead
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 1 deletion.
17 changes: 17 additions & 0 deletions Directory.Build.targets
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
<?xml version="1.0" encoding="utf-8"?>
<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<GenerateNuspecDependsOn>$(GenerateNuspecDependsOn);TimestampNugetPackage</GenerateNuspecDependsOn>

<!-- Enable package timestamping by default -->
<TimestampPackage Condition=" '$(TimestampPackage)' == ''">true</TimestampPackage>
</PropertyGroup>

<Target Name="TimestampNugetPackage">
<PropertyGroup>
<CurrentDate>$([System.DateTime]::Now.ToString(yyyyMMdd-HHmm))</CurrentDate>
<PackageVersion Condition="'$(TimestampPackage)' == 'true'">$(PackageVersion)-preview.$(CurrentDate)</PackageVersion>
<NuspecProperties>version=$(PackageVersion)</NuspecProperties>
</PropertyGroup>
</Target>
</Project>
2 changes: 1 addition & 1 deletion version.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"$schema": "https://raw.githubusercontent.com/dotnet/Nerdbank.GitVersioning/main/src/NerdBank.GitVersioning/version.schema.json",
"version": "1.0.0",
"version": "1.0",
"publicReleaseRefSpec": [
"^refs/heads/main$",
"^refs/heads/v\\d+(?:\\.\\d+)?$"
Expand Down

0 comments on commit 1169ead

Please sign in to comment.