brandedoutcast / publish-nuget

📦 GitHub action to automate publishing NuGet packages when project version changes
https://github.com/marketplace/actions/publish-nuget
MIT License
197 stars 101 forks source link

[FEATURE] Picking up version from file name #42

Open AnmolSinha1201 opened 4 years ago

AnmolSinha1201 commented 4 years ago

For autoversioning, I am using a set up like

  <PropertyGroup>
    <Year>$([System.DateTime]::UtcNow.ToString("yy"))</Year>
    <Month>$([System.DateTime]::UtcNow.ToString("MM"))</Month>
    <Date>$([System.DateTime]::UtcNow.ToString("dd"))</Date>
    <Time>$([System.DateTime]::UtcNow.ToString("HHmm"))</Time>
    <Version>$(Year).$(Month).$(Date).$(Time)</Version>
  </PropertyGroup>

Therefore, the file created while packing has a file name Surrogate.20.8.4.2129.nupkg. As you can see, Version specified in .csproj does not follow SemVer, but instead, the value is evaluated on runtime. Can you pick up the value from published filename instead?

brandedoutcast commented 4 years ago

Yup that's a perfectly valid case 👍 & I always wanted to do that as it reduces the effort in guessing a version