From 46079e337d04c0fdf5ae041aaa15bfc5a15758cf Mon Sep 17 00:00:00 2001 From: Heather Cox Date: Thu, 11 Jan 2024 15:04:17 +1100 Subject: [PATCH] add script and instructions --- PushNuget.ps1 | 33 +++++++++++++++++++++++++++++++++ WTGPublishPackageGuide.md | 12 ++++++++++++ 2 files changed, 45 insertions(+) create mode 100644 PushNuget.ps1 create mode 100644 WTGPublishPackageGuide.md diff --git a/PushNuget.ps1 b/PushNuget.ps1 new file mode 100644 index 00000000..1bf27ebf --- /dev/null +++ b/PushNuget.ps1 @@ -0,0 +1,33 @@ +# To push new package to proget +# 1. in Blazor.Diagrams.csproj and Blazor.Diagrams.Core.csproj increase version number +# 2. build Blazor.Diagrams - a package will be created and it should include strong named dlls: +# Blazor.Diagrams.dll, Blazor.Diagrams.Core.dll, SvgPathProperties.dll +# 3. change the package path in this script to have the package number from the csproj +# 4. run the script (remember to put in the correct api key) + +pushd $PSScriptRoot + +$feedSource = "http://proget.wtg.zone/nuget/WTG-Internal/" +$apiKey = "" +$packagePath = "*.nupkg" + +function Write-Log { + Write-Host "$(get-date -f "yyyy-MM-dd HH:mm:ss.fff")`t$args" +} + +try { + $scriptSw = [System.Diagnostics.Stopwatch]::StartNew() + & nuget.exe push $packagePath -ApiKey $apiKey -Source $feedSource -Verbosity detailed + if (-not $?) + { + Write-Log "FAILED to deploy: $packagePath)" + } + else + { + Write-Log "Deployed $packagePath )" + } +} +finally { + popd + Write-Log "Finished (took: $($scriptSw.Elapsed))" +} \ No newline at end of file diff --git a/WTGPublishPackageGuide.md b/WTGPublishPackageGuide.md new file mode 100644 index 00000000..25a714d8 --- /dev/null +++ b/WTGPublishPackageGuide.md @@ -0,0 +1,12 @@ +# Publishing WTG.Z.Blazor.Diagrams for WTG usage +This doc explains how the package we use at WTG is updated. + +When a PR is merged to master, the GitHub Action 'Create release' should run. It can also be run manually if needed. This action creates a GitHub Release and uploads the package to the release. The version number is also handled by the action. + +## To push package to proget +1. **Find the release**. Most likely the most recent release is the one to use. To find all releases, go to the repo main page then click 'Releases'. +2. **Download the package**. Expand the 'Assets' section of the release and download the *.nupkg file. +3. **Push to proget**. Modify the PushNuget.ps1 script so that it had the correct path to the downloaded *.nupkg file and the API key. Ask another team member if not sure. Once the script has all required information, run the script to push the package. +4. **Update package version in WTG**. In Directory.Packages.Props, update the version of WTG.Z.Blazor.Diagrams to match the package that was just uploaded to proget. + +