We have a few handy scripts you can use to release a new NuGet package version of any project in this repository.
The main script is the Publish-VNext script. It will take care of automatically determining the new version number, creating and pushing the git tag (which will start a NuGet build), updating the references in the other projects in the repository.
The main script to use is Publish-VNext.ps1
. It's a PowerShell script that you can run from the root of the repository. It will take care of everything for you given the right input.
Path
: The path to the project you are releasing e.g..\src\Libraries\Lombiq.HelpfulLibraries\
.Type
: The type of the release. Can bemajor
,minor
, orpatch
(or can be omitted if doing a pre-release).PreRelease
: The flag to indicate if this is a pre-release.Issue
: The issue number that this release is related to, is only used if it is a pre-release.UpdateReferences
: The flag to indicate if the references should be updated to this new version in the other projects in the repository.NonInteractive
: The flag to indicate if the script should skip asking for confirmation before pushing changes to git.
.\Publish-VNext.ps1 -Path \path\to\project\ -Type "major" -UpdateReferences
-
Open a PowerShell terminal.
-
Navigate to the root of the repository.
-
Run the script with the necessary parameters. For example to release a new major version of the
Lombiq.HelpfulLibraries
project and update the references in other projects, run the following command.\Publish-VNext.ps1 -Path .\src\Libraries\Lombiq.HelpfulLibraries\ -Type "major" -UpdateReferences
-
Review the changes made by the script while waiting for the NuGet build to finish.
-
Push the changes.
-
Do the same steps for any other projects that you want to release.
-
Open a PowerShell terminal.
-
Navigate to the root of the repository.
-
Run the script with the necessary parameters. For example to release a new major version of the
Lombiq.HelpfulLibraries
project and update the references in other projects, run the following command.\Publish-VNext.ps1 -Path .\src\Libraries\Lombiq.HelpfulLibraries\ -PreRelease -Issue "OC-123"
This script will scan the entire solution for references to the project you want to update and update them to the new version.
The Publish-VNext script will update the references in the other projects in the repository if you provide the UpdateReferences
flag. It will call this script for you.
Should you want to update the references manually you can use the Update-References.ps1
script. It's a script that you can run from the root of the repository. It will take care of updating the references in the other projects for you.
ProjectToFind
: The project to find.NewVersion
: The new version to update to.
.\Update-References.ps1 -ProjectToFind "Lombiq.HelpfulLibraries" -NewVersion "v1.2.3"