forked from dragonfruitnetwork/dragon6-api
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathNuget.ps1
22 lines (15 loc) · 793 Bytes
/
Nuget.ps1
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
param ([string] $ApiKey, [string]$Suffix = "")
#versioning info
$VERSION = "$(Get-Date -UFormat "%Y.%m%d").$($env:GITHUB_RUN_NUMBER)$($Suffix)"
$WORKINGDIR = Get-Location
#Build files
Write-Output "Building DragonFruit.Six.API Version $VERSION"
dotnet restore
dotnet build -c Release /p:PackageVersion=$VERSION
#pack into nuget files with the suffix if we have one
Write-Output "Publishing DragonFruit.Six.API Version $VERSION"
dotnet pack ".\DragonFruit.Six.API\DragonFruit.Six.API.csproj" -o $WORKINGDIR -c Release -p:PackageVersion=$VERSION
#recursively push all nuget files created
Get-ChildItem -Path $WORKINGDIR -Filter *.nupkg -Recurse -File -Name | ForEach-Object {
dotnet nuget push $_ --api-key $ApiKey --source https://api.nuget.org/v3/index.json --force-english-output
}