Following tests from a few months ago regarding publishing your shiny VL nugets with Github Actions, we now have a dedicated action ready to be used!
For more informations on nugets, please refer to this section of the Gray Book.
Github actions are small scripts with a specific purpose, allowing you to automate tasks on your repos. They are actually the building blocks of what's called a workflow : you chain several actions one after the other in your own small script, and decide under which condition the workflow is triggered (a new commit on master, a new tag, etc).
There are already tons of actions allowing you to do all sorts of things from creating issues to running unit tests, and even make phone calls with a predefined text!
This action allows you to easily do the following tasks :
In other words, you just have to push your code/patches and nuspec to github, and the script takes care of bringing it to nuget.org for you.
You can find the list of input parameters the action expects here.
To get started with workflows, head over to the Github documentation.
The action can adapt to many different scenarios. Let's cover three cases so you get an idea of how the action works, and how to adapt it to your needs.
So your plugin solely consists of one (or many) VL documents and some help patches, plus your nuspec file that describes how your package will be structured.
Here, we are just using the nuspec and nuget-key inputs of the action.
Your csproj file can also describe how your nuget will be packed. In that case, simply omit the nuspec input. Note that if you provide a nuspec file anyway, it will take priority over your csproj.
By default, the action will push your package to nuget.org. You can simply use the nuget-feed input to push to a different feed.
The icon must be downloaded to an existing folder in your repo. We suggest you simply download it to its root :
Here, we ask the Github Action to download the icon from our URL and place it at the root of the repo.
Then, in the file section, your nuspec file must reference it from where the action will download it (src attribute) and place it wherever you like (target attribute), making sure target matches where the metadata section expects it.
You can setup an icon for your project inside Visual Studio. The tricky part here is that you'll have to specify a path to a file that does not exist yet, since the Action will take care of downloading it later on. This can feel weird since Visual Studio's UI gives your a Browse button for you to pick a file. Simply fill the path manually to match the icon-src property of your workflow file.
For instance, your workflow file would look like this:
and your VS package settings :
Thanks for reading, hope you'll enjoy using this one! If you are stuck or want more precision, don't hesitate to shout in the comments or in the forums.
anonymous user login