@@ -48,35 +48,25 @@ stages:
4848 - pwsh : |
4949 $modulePath = Join-Path -Path $env:AGENT_TEMPDIRECTORY -ChildPath 'TempModules'
5050 Write-Verbose -Verbose "Install PowerShellGet V3 to temp module path"
51- Save-Module -Name PowerShellGet -Path $modulePath -MinimumVersion 3.0.0-beta10 -AllowPrerelease -Force
52- Write-Verbose -Verbose "Install PlatyPS to temp module path"
53- Save-Module -Name "platyPS" -Path $modulePath -Force
54- Write-Verbose -Verbose "Install PSScriptAnalyzer to temp module path"
55- Save-Module -Name "PSScriptAnalyzer" -Path $modulePath -RequiredVersion 1.18.0 -Force
56- Write-Verbose -Verbose "Install Pester 4.X to temp module path"
57- Save-Module -Name "Pester" -MaximumVersion 4.99 -Path $modulePath -Force
58- Write-Verbose -Verbose "Install PSPackageProject to temp module path"
59- Save-Module -Name PSPackageProject -Path $modulePath -Force
60- displayName: Install PSPackageProject and dependencies
51+ Save-Module -Name PowerShellGet -Path $modulePath -MinimumVersion 3.0.18-beta18 -AllowPrerelease -Force
52+ displayName: Install PowerShellGetV3
6153
6254 - pwsh : |
6355 $modulePath = Join-Path -Path $env:AGENT_TEMPDIRECTORY -ChildPath 'TempModules'
6456 $env:PSModulePath = $modulePath + [System.IO.Path]::PathSeparator + $env:PSModulePath
65- $modPath = Join-Path -Path $modulePath -ChildPath PSPackageProject
66- Write-Verbose -Verbose "Importing PSPackageProject from: $modPath"
67- Import-Module -Name $modPath -Force
57+ Write-Verbose -Verbose "Importing build utilities (buildtools.psd1)"
58+ Import-Module -Name $(Build.SourcesDirectory)/buildtools.psd1 -Force
6859 #
6960 $(Build.SourcesDirectory)/build.ps1 -Build -Clean -BuildConfiguration Release
70- displayName: Build and publish artifact
61+ displayName: Build module
7162
7263 - pwsh : |
7364 $modulePath = Join-Path -Path $env:AGENT_TEMPDIRECTORY -ChildPath 'TempModules'
7465 $env:PSModulePath = $modulePath + [System.IO.Path]::PathSeparator + $env:PSModulePath
75- $modPath = Join-Path -Path $modulePath -ChildPath PSPackageProject
76- Write-Verbose -Verbose "Importing PSPackageProject from: $modPath"
77- Import-Module -Name $modPath -Force
66+ Write-Verbose -Verbose "Importing build utilities (buildtools.psd1)"
67+ Import-Module -Name $(Build.SourcesDirectory)/buildtools.psd1 -Force
7868 #
79- $config = Get-PSPackageProjectConfiguration
69+ $config = Get-BuildConfiguration
8070 $signSrcPath = "$($config.BuildOutputPath)\$($config.ModuleName)"
8171 $signOutPath = "$($config.SignedOutputPath)\$($config.ModuleName)"
8272 if (! (Test-Path -Path $signOutPath)) {
@@ -92,7 +82,7 @@ stages:
9282 $vstsCommandString = "vso[task.setvariable variable=signOutPath]${signOutPath}"
9383 Write-Host "sending " + $vstsCommandString
9484 Write-Host "##$vstsCommandString"
95- displayName: Set signing path variables for possible module code signing
85+ displayName: Set signing path variables for module code signing
9686
9787 - pwsh : |
9888 Get-ChildItem -Path env:
@@ -122,9 +112,8 @@ stages:
122112 - pwsh : |
123113 $modulePath = Join-Path -Path $env:AGENT_TEMPDIRECTORY -ChildPath 'TempModules'
124114 $env:PSModulePath = $modulePath + [System.IO.Path]::PathSeparator + $env:PSModulePath
125- $modPath = Join-Path -Path $modulePath -ChildPath PSPackageProject
126- Write-Verbose -Verbose "Importing PSPackageProject from: $modPath"
127- Import-Module -Name $modPath -Force
115+ Write-Verbose -Verbose "Importing build utilities (buildtools.psd1)"
116+ Import-Module -Name $(Build.SourcesDirectory)/buildtools.psd1 -Force
128117 #
129118 if ($env:SkipSigning -eq 'True')
130119 {
@@ -134,16 +123,16 @@ stages:
134123 {
135124 $(Build.SourcesDirectory)/build.ps1 -Publish -Signed
136125 }
137- displayName: Create module artifact
126+ displayName: Publish module nuget package and upload package artifact
127+ condition: succeeded()
138128
139129 - pwsh : |
140130# $modulePath = Join-Path -Path $env:AGENT_TEMPDIRECTORY -ChildPath 'TempModules'
141131# $env:PSModulePath = $modulePath + [System.IO.Path]::PathSeparator + $env:PSModulePath
142- # $modPath = Join-Path -Path $modulePath -ChildPath PSPackageProject
143- # Write-Verbose -Verbose "Importing PSPackageProject from: $modPath"
144- # Import-Module -Name $modPath -Force
132+ # Write-Verbose -Verbose "Importing build utilities (buildtools.psd1)"
133+ # Import-Module -Name $(Build.SourcesDirectory)/buildtools.psd1 -Force
145134# #
146- # $config = Get-PSPackageProjectConfiguration
135+ # $config = Get-BuildConfiguration
147136# $signSrcPath = Resolve-Path -Path "$($config.BuildOutputPath)"
148137# $signOutPath = "$($config.SignedOutputPath)\RefAssemblyNuGet"
149138# if (! (Test-Path -Path $signOutPath)) {
@@ -176,11 +165,10 @@ stages:
176165 - pwsh : |
177166 $modulePath = Join-Path -Path $env:AGENT_TEMPDIRECTORY -ChildPath 'TempModules'
178167 $env:PSModulePath = $modulePath + [System.IO.Path]::PathSeparator + $env:PSModulePath
179- $modPath = Join-Path -Path $modulePath -ChildPath PSPackageProject
180- Write-Verbose -Verbose "Importing PSPackageProject from: $modPath"
181- Import-Module -Name $modPath -Force
168+ Write-Verbose -Verbose "Importing build utilities (buildtools.psd1)"
169+ Import-Module -Name $(Build.SourcesDirectory)/buildtools.psd1 -Force
182170 #
183- $config = Get-PSPackageProjectConfiguration
171+ $config = Get-BuildConfiguration
184172 if ($env:SkipSigning -eq 'True')
185173 {
186174 $srcModulePath = Resolve-Path -Path "$($config.BuildOutputPath)/$($config.ModuleName)"
0 commit comments