UnlimitedHugs / RimworldHugsLib

A lightweight shared library for Rimworld modding.
Other
245 stars 59 forks source link

Publish a NuGet package #29

Closed orf closed 6 years ago

orf commented 7 years ago

Is it possible to publish a NuGet package of HugsLib?

https://docs.microsoft.com/en-us/nuget/create-packages/creating-a-package

UnlimitedHugs commented 7 years ago

Seems like a considerable time investment to set it up and keep it up to date. An easier option might be to just clone the HugsLib repo and do the occasional git pull when there's an update. You could even set up a cron/task scheduler script to do it for you.

orf commented 7 years ago

It's pretty simple really: https://docs.microsoft.com/en-us/nuget/quickstart/create-and-publish-a-package

Just add a .nuspec and run nuget pack HugsLib.csproj && nuget push ... every time you do a release. It's quicker and simpler than uploading to Github.

There are lots of ways of vendoring resources but none are as simple or as built-in as NuGet. It's the blessed way of publishing and sharing libraries like this, works with every .net platform everywhere.

Literally just add this file below and follow the tutorial from this point: https://docs.microsoft.com/en-us/nuget/quickstart/create-and-publish-a-package#create-the-package

<?xml version="1.0"?>
<package>
    <metadata>
    <id>HugsLib.RimWorldHugsLib</id>
    <version>$version$</version>
    <title>$title$</title>
    <projectUrl>https://github.com/UnlimitedHugs/RimworldHugsLib/</projectUrl>
    <authors>UnlimitedHugs</authors>
    <owners>UnlimitedHugs</owners>
    <requireLicenseAcceptance>false</requireLicenseAcceptance>
    <description>A lightweight shared library for Rimworld modding. </description>
    <releaseNotes>Initial NuGet release</releaseNotes>
    <copyright>Copyright 2017</copyright>
    <tags>rimworld</tags>
    </metadata>
</package>
UnlimitedHugs commented 7 years ago

Right- that .nuspec need to be kept up to date. It's a small amount of busywork, but it adds up. I could roll it into my build script, but again- time investment. You didn't specify why git was not appropriate in your use case, though. I do appreciate the additional information.

orf commented 7 years ago

Well, it doesn't really have to be kept up to date. The only thing that changes is the version, and that's pulled from the project file automatically. Forget the changelog, if that's an issue.

Git is the lowest common denominator. It works, I guess, but consuming through nuget is a lot more convenient.

You've got quite an extensive build script, I see now. I can make a merge request that adds all this functionality if you don't want to.

On 7 Jun 2017 00:11, "UnlimitedHugs" notifications@github.com wrote:

Right- that .nuspec need to be kept up to date. It's a small amount of busywork, but it adds up. I could roll it into my build script, but again- time investment. You didn't specify why git was not appropriate in your use case, though. I do appreciate the additional information.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/UnlimitedHugs/RimworldHugsLib/issues/29#issuecomment-306643398, or mute the thread https://github.com/notifications/unsubscribe-auth/AA-shyXMuUmaCgblK_oF00kj_S5ixidLks5sBdy-gaJpZM4Nx8yl .

UnlimitedHugs commented 7 years ago

Tell you what. I'll be rewriting that build script in the near future anyway. If I can carve out some spare time, I'll investigate adding a NuGet module. I'm sure I can find some NPM package to do the leg work on the updates.

orf commented 7 years ago

Ok, thank you for considering it. As I see it, it's similar to npm - if you where publishing a JS package you could of course distribute it by git or github releases, but npm is the way to go.

Let me know if you want any help as well :+1:

UnlimitedHugs commented 6 years ago

I'm pleased to report that the NuGet packages are now up, and should be automatically kept up-to-date with future updates. HugsLib: UnlimitedHugs.Rimworld.HugsLib Companion assembly: UnlimitedHugs.Rimworld.HugsLibChecker