diff --git a/.github/workflows/docfx.xml b/.github/workflows/docfx.yml similarity index 100% rename from .github/workflows/docfx.xml rename to .github/workflows/docfx.yml diff --git a/nuget/Publish.bat b/nuget/Publish.bat deleted file mode 100644 index 0e9035d..0000000 --- a/nuget/Publish.bat +++ /dev/null @@ -1,6 +0,0 @@ -dotnet nuget push FaceRecognitionDotNet.MKL.%1.nupkg -k %2 -s https://api.nuget.org/v3/index.json -dotnet nuget push FaceRecognitionDotNet.CUDA102.%1.nupkg -k %2 -s https://api.nuget.org/v3/index.json -dotnet nuget push FaceRecognitionDotNet.CUDA101.%1.nupkg -k %2 -s https://api.nuget.org/v3/index.json -dotnet nuget push FaceRecognitionDotNet.CUDA100.%1.nupkg -k %2 -s https://api.nuget.org/v3/index.json -dotnet nuget push FaceRecognitionDotNet.CUDA92.%1.nupkg -k %2 -s https://api.nuget.org/v3/index.json -dotnet nuget push FaceRecognitionDotNet.%1.nupkg -k %2 -s https://api.nuget.org/v3/index.json \ No newline at end of file diff --git a/nuget/Publish.ps1 b/nuget/Publish.ps1 new file mode 100644 index 0000000..ed8700e --- /dev/null +++ b/nuget/Publish.ps1 @@ -0,0 +1,46 @@ +#*************************************** +#Arguments +#%1: Version of Release (1.2.3.0) +#*************************************** +Param([Parameter( + Mandatory=$True, + Position = 1 + )][string] + $Version +) + +$PublishTargets = ( "FaceRecognitionDotNet", + "FaceRecognitionDotNet.CUDA92", + "FaceRecognitionDotNet.CUDA100", + "FaceRecognitionDotNet.CUDA101", + "FaceRecognitionDotNet.CUDA102", + "FaceRecognitionDotNet.CUDA110", + "FaceRecognitionDotNet.CUDA111", + "FaceRecognitionDotNet.CUDA112", + "FaceRecognitionDotNet.MKL" + ) + +$Token = $env:FaceRecognitionDotNetNugetToken +if ([string]::IsNullOrWhitespace($Token)) +{ + Write-Host "nuget token is missing" -ForegroundColor Red + exit +} + +# Precheck whether all package is present +foreach ($Target in $PublishTargets) +{ + $Package = Join-Path $PSScriptRoot "${Target}.${Version}.nupkg" + if (!(Test-Path ${Package})) + { + Write-Host "${Package} is missing" -ForegroundColor Red + exit + } +} + +foreach ($Target in $PublishTargets) +{ + $Package = Join-Path $PSScriptRoot "${Target}.${Version}.nupkg" + Write-Host "Publish ${Package}" -ForegroundColor Green + dotnet nuget push ${Package} -k $Token -s https://api.nuget.org/v3/index.json +} \ No newline at end of file