Skip to content

Commit

Permalink
Added publishing steps.
Browse files Browse the repository at this point in the history
  • Loading branch information
lextm committed Dec 27, 2022
1 parent fa80cb2 commit ba9b1ed
Show file tree
Hide file tree
Showing 4 changed files with 25 additions and 2 deletions.
2 changes: 0 additions & 2 deletions build.cmd

This file was deleted.

3 changes: 3 additions & 0 deletions dist.pack.bat
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
powershell -ExecutionPolicy Bypass -file build.ps1
powershell -ExecutionPolicy Bypass -file post.build.ps1
powershell -ExecutionPolicy Bypass -file sign.ps1
2 changes: 2 additions & 0 deletions dist.publish2nugetdotorg.bat
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
nuget update /self
for %%f in (.\nupkg\*.nupkg) do nuget push %%f -Source https://www.nuget.org/api/v2/package
20 changes: 20 additions & 0 deletions sign.ps1
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
Remove-Item -Path .\*.nupkg
$nuget = ".\nuget.exe"

if (!(Test-Path $nuget))
{
Invoke-WebRequest https://dist.nuget.org/win-x86-commandline/latest/nuget.exe -OutFile nuget.exe
}

& $nuget update /self | Write-Debug

Write-Host "Sign NuGet packages."
& $nuget sign .\nupkg\*.nupkg -CertificateSubjectName "Yang Li" -Timestamper http://timestamp.digicert.com | Write-Debug
& $nuget verify -All .\nupkg\*.nupkg | Write-Debug
if ($LASTEXITCODE -ne 0)
{
Write-Host "NuGet package is not signed. Exit."
exit $LASTEXITCODE
}

Write-Host "Verification finished."

0 comments on commit ba9b1ed

Please sign in to comment.