Skip to content

Commit 2ee97d1

Browse files
Wrong github action file and improve publish script (#165)
* fix: wrong extension of docfx github action * Use PowerShell instead of Windows Batch
1 parent 6367383 commit 2ee97d1

File tree

3 files changed

+46
-6
lines changed

3 files changed

+46
-6
lines changed

nuget/Publish.bat

Lines changed: 0 additions & 6 deletions
This file was deleted.

nuget/Publish.ps1

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
#***************************************
2+
#Arguments
3+
#%1: Version of Release (1.2.3.0)
4+
#***************************************
5+
Param([Parameter(
6+
Mandatory=$True,
7+
Position = 1
8+
)][string]
9+
$Version
10+
)
11+
12+
$PublishTargets = ( "FaceRecognitionDotNet",
13+
"FaceRecognitionDotNet.CUDA92",
14+
"FaceRecognitionDotNet.CUDA100",
15+
"FaceRecognitionDotNet.CUDA101",
16+
"FaceRecognitionDotNet.CUDA102",
17+
"FaceRecognitionDotNet.CUDA110",
18+
"FaceRecognitionDotNet.CUDA111",
19+
"FaceRecognitionDotNet.CUDA112",
20+
"FaceRecognitionDotNet.MKL"
21+
)
22+
23+
$Token = $env:FaceRecognitionDotNetNugetToken
24+
if ([string]::IsNullOrWhitespace($Token))
25+
{
26+
Write-Host "nuget token is missing" -ForegroundColor Red
27+
exit
28+
}
29+
30+
# Precheck whether all package is present
31+
foreach ($Target in $PublishTargets)
32+
{
33+
$Package = Join-Path $PSScriptRoot "${Target}.${Version}.nupkg"
34+
if (!(Test-Path ${Package}))
35+
{
36+
Write-Host "${Package} is missing" -ForegroundColor Red
37+
exit
38+
}
39+
}
40+
41+
foreach ($Target in $PublishTargets)
42+
{
43+
$Package = Join-Path $PSScriptRoot "${Target}.${Version}.nupkg"
44+
Write-Host "Publish ${Package}" -ForegroundColor Green
45+
dotnet nuget push ${Package} -k $Token -s https://api.nuget.org/v3/index.json
46+
}

0 commit comments

Comments
 (0)