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

Pickup version from files like Directory.Build.props #8

Closed drjaydenm closed 4 years ago

drjaydenm commented 4 years ago

Nice work on this action so far, it has been super helpful :)

I am wanting to change over to specifying our package version in a shared Directory.Build.props file so that we only have to update it in one place. The Directory.Build.props file looks like this:

<Project>
  <PropertyGroup>
    <Version>0.1.2</Version>
  </PropertyGroup>
</Project>

After doing this though, the publish script no longer picks up the version in the csproj file and aborts the publish process. Would it be possible to fetch the version from other MSBuild files like Directory.Build.props? Thanks

brandedoutcast commented 4 years ago

🤝 Thanks for the appreciation

I'll setup a priority order to fetch the version

  1. Directory.Build.props
  2. csproj / fsproj

I'm starting to think about accommodating various locations that can host version info, although I might work on it later

drjaydenm commented 4 years ago

That order sounds like it would work great for what I am looking to do at the moment.

In regards to the future as you mentioned, perhaps some way of specifying a file and regex pattern to extract the version from might work well and be pretty flexible?

brandedoutcast commented 4 years ago

🤯 That's precisely what I had in mind