Skip to content

Commit

Permalink
add script and instructions
Browse files Browse the repository at this point in the history
  • Loading branch information
Heathermcx committed Jan 11, 2024
1 parent 54e8ef9 commit 46079e3
Show file tree
Hide file tree
Showing 2 changed files with 45 additions and 0 deletions.
33 changes: 33 additions & 0 deletions PushNuget.ps1
Original file line number Diff line number Diff line change
@@ -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))"
}
12 changes: 12 additions & 0 deletions WTGPublishPackageGuide.md
Original file line number Diff line number Diff line change
@@ -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.


0 comments on commit 46079e3

Please sign in to comment.