-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathpublish.ps1
More file actions
26 lines (19 loc) · 838 Bytes
/
publish.ps1
File metadata and controls
26 lines (19 loc) · 838 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
# Local publish to Azure Devops Artifacts/NuGet Repository
# Not part of Azure DevOps CI/CD Pipeline/Artifacts
[cmdletbinding()]
Param (
$Path = $PSScriptRoot,
$NuGetApiKey = $ENV:NuGetApiKey,
$Repository = "AzurePSModuleRepo"
)
Import-Module Buildhelpers
$BuildEnvironment = Get-BuildEnvironment -Path $Path
$version = Get-Metadata -Path $BuildEnvironment.PSModuleManifest
"$version"
$buildPath = Join-Path $BuildEnvironment.ProjectPath "/build"
"$buildpath"
$nuspec = $BuildEnvironment.PSModuleManifest -replace ("psd1", "nuspec")
nuget pack $nuspec -Version $version -OutputDirectory $buildPath
"Publishing [$Destination]:${version} to [$PSRepository]"
$nupkg = (Get-ChildItem -Path $build -Filter ${BuildEnvironment.ProjectName}*nupkg).Fullname
nuget push $nupkg -Source $Repository -Apikey $NuGetApiKey