Does anyone have any links to blog posts
o
Does anyone have any links to blog posts about how to do proper nuget versioning for packages? Is there a standard way package authors do this? I'm currently just manually updating the
PackageVersion
in my csproj when releasing a new version 🙈
s
I took inspiration from this blog post: https://acraven.medium.com/a-nuget-package-workflow-using-github-actions-7da8c6557863 In short: Have a look at my GitHub workflows - https://github.com/nul800sebastiaan/Cultiv.Hangfire/tree/main/.github/workflows They are triggered with git labels, label
v3.1.2
runs the final release of version 3.1.2 (automatically updating the version number) and label
v2.2.0-rc001
would make a prerelease, version 2.2.0 rc001. I think it requires the
csproj
file to not have a specific version in it, not sure. But you can test locally by running something like
dotnet build --configuration Release /p:Version:1.2.3
and then
dotnet pack --configuration Release /p:Version=1.2.3 --no-build --output .\pack
and see what happens.
o
Cheers Seb! I've never used git tags before, they look perfect! 😄
s
They're nice and I love the flow, don't have to commit a version number in code to git and everything!
m
I started using git releases (based on tags) so I can also document what's in the release
s
Oh yes, I forgot to mention, it really helps with making the release notes very easily! https://github.com/nul800sebastiaan/Cultiv.Hangfire/releases
o
Ahh that's awesome! Githubs public nuget release pipeline seems a lot less daunting than I first thought it would be! 😁
m
Just make sure you keep your keys private 🙂 and renew them when you go to release.... After the first time or 2
o
I'll keep that in mind! 😄
r
I am using Gitversion these days, Then Devops ensures csproj files use that version and all boils down to Package manifest Gitversion respects version tags for official versions as well
Thanks for the trigger to write this blogpost 😀 https://richardsoeteman.net/blog/automatic-versioning-for-umbraco-packages/
s
Thanks @Richard Soeteman ! Do you have an RSS feed?
@UMB.FYI tip
u
Thanks for the tip
r
s
d
+1 for Git Tags - I am using them for UmBootstrap - also Git will automatically create a bullet list of release notes as well! https://docs.github.com/en/repositories/releasing-projects-on-github/automatically-generated-release-notes
o
Ahh that's awesome! I saw that on umb fyi last week and thought "that's perfect timing!", didn't realise it came about because of my post here haha 😂 (I need to sort out my discord notifications, it's is just a sea of white noise atm so I never know when someone replies to me...)
Awesome 😄 I think I'm defo leaning towards using git tags, I like the idea of GitVersion, but I think I want to have manual control over my release versions
d
For UmBootstrap I am creating them manually. It means I can add -rc at the end for example. I am new to versioning as well so perhaps I may be tempted at some point to use auto versioning.
o
Hi all, apologies for bumping this thread, but I'm having trouble packing a .NET Framework project (1 half of a migration package). This works when I run it locally:
dotnet pack src/Method4.UmbracoMigrator.Source/Method4.UmbracoMigrator.Source.csproj -p:Version=1.0.0-alpha1 --configuration Release --output .
But this, swapped out the version for the git tag variable, doesn't work on GitHub actions:
dotnet pack src/Method4.UmbracoMigrator.Source.Core/Method4.UmbracoMigrator.Source.Core.csproj -p:Version=${VERSION} --configuration Release --output .
I get
error MSB4044: The "GetAssemblyVersion" task was not given a value for the required parameter "NuGetVersion".
I changed
Version
to
PackageVersion
, which also works locally, but that still didnt work on the github action.
The reason I'm using
dotnet pack
rather than
nuget pack
, is because it is a SDK style project.
Does anyone have any advice? EDIT: I was just being a dummy, I'd changed the runner from linux to windows, so had to change the way I referenced the environment variable from
${VERSION}
to
$env:VERSION
205 Views