forked from AutoMapper/AutoMapper.Extensions.OData
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathPack_Push.ps1
More file actions
17 lines (13 loc) · 694 Bytes
/
Pack_Push.ps1
File metadata and controls
17 lines (13 loc) · 694 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
$scriptName = $MyInvocation.MyCommand.Name
Write-Host "Owner ${Env:REPO_OWNER}"
Write-Host "Repository ${Env:REPO}"
$PROJECT_PATH = ".\$($Env:PROJECT_NAME)\$($Env:PROJECT_NAME).csproj"
$NUGET_PACKAGE_PATH = ".\artifacts\$($Env:PROJECT_NAME).*.nupkg"
Write-Host "Project Path ${PROJECT_PATH}"
Write-Host "Package Path ${NUGET_PACKAGE_PATH}"
if ([string]::IsNullOrEmpty($Env:DEPLOY_PACKAGE_API_KEY)) {
Write-Host "${scriptName}: Only creates packages on AutoMapper repositories."
} else {
dotnet pack $PROJECT_PATH -c Release -o .\artifacts --no-build
dotnet nuget push $NUGET_PACKAGE_PATH --skip-duplicate --source $Env:DEPLOY_PACKAGE_URL --api-key $Env:DEPLOY_PACKAGE_API_KEY
}