Skip to content

Commit 63befd6

Browse files
Add deploy box publish
1 parent d39afce commit 63befd6

File tree

3 files changed

+53
-3
lines changed

3 files changed

+53
-3
lines changed

.pipelines/release.yml

Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -111,3 +111,52 @@ extends:
111111
displayName: Build NuGet
112112
jobs:
113113
- template: .pipelines/templates/build-nuget.yml@self
114+
115+
- stage: Release_NuGet
116+
displayName: Release NuGet
117+
dependsOn: [Build_Nuget]
118+
jobs:
119+
- job: NuGetPublish
120+
displayName: Publish to NuGet
121+
condition: succeeded()
122+
pool:
123+
type: release
124+
os: windows
125+
templateContext:
126+
inputs:
127+
- input: pipelineArtifact
128+
artifactName: drop_Build_Nuget_Build_Nuget
129+
variables:
130+
- template: ./variable/release-shared.yml@self
131+
parameters:
132+
VERSION: $[ stageDependencies.Build_Nuget.Build_Nuget.outputs['PackageVersion'] ]
133+
134+
steps:
135+
- task: PowerShell@2
136+
inputs:
137+
targetType: inline
138+
script: |
139+
Write-Verbose -Verbose "Version: $(Version)"
140+
Get-ChildItem Env: | Out-String -width 9999 -Stream | write-Verbose -Verbose
141+
displayName: 'Capture Environment Variables'
142+
143+
- task: PowerShell@2
144+
inputs:
145+
targetType: inline
146+
script: |
147+
$null = New-Item -ItemType Directory -Path "$(Pipeline.Workspace)/release"
148+
Copy-Item "$(Pipeline.Workspace)/drop_Build_Nuget_Build_Nuget/*.nupkg" -Destination "$(Pipeline.Workspace)/release" -Force -Verbose
149+
Write-Verbose -Verbose "The .nupkgs below will be pushed:"
150+
Get-ChildItem "$(Pipeline.Workspace)/release" -recurse
151+
displayName: Download and capture nupkgs
152+
condition: and(eq('${{ parameters.OfficialBuild }}', 'true'), succeeded())
153+
154+
# - task: NuGetCommand@2
155+
# displayName: 'NuGet push'
156+
# condition: and(eq('${{ parameters.OfficialBuild }}', 'true'), succeeded())
157+
# inputs:
158+
# command: push
159+
# packagesToPush: '$(Pipeline.Workspace)/release/*.nupkg'
160+
# nuGetFeedType: external
161+
# publishFeedCredentials: PowerShellNuGetOrgPush
162+

.pipelines/templates/build-nuget.yml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ jobs:
6868
}
6969
7070
Import-Module $(Build.SourcesDirectory)/build.psm1 -Force
71-
$PackageRoot = New-Item -ItemType Directory -Path $(ob_outputDirectory)\NugetPackage
71+
$PackageRoot = New-Item -ItemType Directory -Path $(ob_outputDirectory)\NugetPackageSrc
7272
Start-BuildPowerShellNativePackage -PackageRoot $PackageRoot -Version $(PackageVersion) -WindowsX64ZipPath $WindowsX64ZipPath -WindowsX86ZipPath $WindowsX86ZipPath -WindowsARM64ZipPath $WindowsARM64ZipPath -LinuxZipPath $LinuxZipPath -LinuxARMZipPath $LinuxARMZipPath -LinuxARM64ZipPath $LinuxARM64ZipPath -LinuxAlpineZipPath $LinuxAlpineZipPath -macOSZipPath $macOSZipPath
7373
7474
Write-Verbose -Verbose "Enumerating $symbolsRoot"
@@ -96,8 +96,9 @@ jobs:
9696
9797
Get-ChildItem -Path "$(SymbolsPath)" -Recurse | ForEach-Object {
9898
$file = $_
99-
Write-Host "##vso[artifact.upload artifactname=NuGetPackages;]$($file.FullName)"
99+
Write-Verbose -Message "Found symbol file: $($file.FullName)" -Verbose
100100
}
101+
displayName: 'Capture Packages'
101102
102103
- task: PublishSymbols@2
103104
inputs:

.pipelines/templates/setVersion.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ steps:
2525
"99.99.99"
2626
}
2727
28-
$vstsCommandString = "vso[task.setvariable variable=PackageVersion]$packageVersion"
28+
$vstsCommandString = "vso[task.setvariable variable=PackageVersion;isOutput=true]$packageVersion"
2929
Write-Verbose -Message "setting $Variable to $packageVersion" -Verbose
3030
Write-Host -Object "##$vstsCommandString"
3131

0 commit comments

Comments
 (0)