@@ -48,35 +48,25 @@ stages:
48
48
- pwsh : |
49
49
$modulePath = Join-Path -Path $env:AGENT_TEMPDIRECTORY -ChildPath 'TempModules'
50
50
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
61
53
62
54
- pwsh : |
63
55
$modulePath = Join-Path -Path $env:AGENT_TEMPDIRECTORY -ChildPath 'TempModules'
64
56
$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
68
59
#
69
60
$(Build.SourcesDirectory)/build.ps1 -Build -Clean -BuildConfiguration Release
70
- displayName: Build and publish artifact
61
+ displayName: Build module
71
62
72
63
- pwsh : |
73
64
$modulePath = Join-Path -Path $env:AGENT_TEMPDIRECTORY -ChildPath 'TempModules'
74
65
$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
78
68
#
79
- $config = Get-PSPackageProjectConfiguration
69
+ $config = Get-BuildConfiguration
80
70
$signSrcPath = "$($config.BuildOutputPath)\$($config.ModuleName)"
81
71
$signOutPath = "$($config.SignedOutputPath)\$($config.ModuleName)"
82
72
if (! (Test-Path -Path $signOutPath)) {
@@ -92,7 +82,7 @@ stages:
92
82
$vstsCommandString = "vso[task.setvariable variable=signOutPath]${signOutPath}"
93
83
Write-Host "sending " + $vstsCommandString
94
84
Write-Host "##$vstsCommandString"
95
- displayName: Set signing path variables for possible module code signing
85
+ displayName: Set signing path variables for module code signing
96
86
97
87
- pwsh : |
98
88
Get-ChildItem -Path env:
@@ -122,9 +112,8 @@ stages:
122
112
- pwsh : |
123
113
$modulePath = Join-Path -Path $env:AGENT_TEMPDIRECTORY -ChildPath 'TempModules'
124
114
$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
128
117
#
129
118
if ($env:SkipSigning -eq 'True')
130
119
{
@@ -134,16 +123,16 @@ stages:
134
123
{
135
124
$(Build.SourcesDirectory)/build.ps1 -Publish -Signed
136
125
}
137
- displayName: Create module artifact
126
+ displayName: Publish module nuget package and upload package artifact
127
+ condition: succeeded()
138
128
139
129
- pwsh : |
140
130
# $modulePath = Join-Path -Path $env:AGENT_TEMPDIRECTORY -ChildPath 'TempModules'
141
131
# $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
145
134
# #
146
- # $config = Get-PSPackageProjectConfiguration
135
+ # $config = Get-BuildConfiguration
147
136
# $signSrcPath = Resolve-Path -Path "$($config.BuildOutputPath)"
148
137
# $signOutPath = "$($config.SignedOutputPath)\RefAssemblyNuGet"
149
138
# if (! (Test-Path -Path $signOutPath)) {
@@ -176,11 +165,10 @@ stages:
176
165
- pwsh : |
177
166
$modulePath = Join-Path -Path $env:AGENT_TEMPDIRECTORY -ChildPath 'TempModules'
178
167
$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
182
170
#
183
- $config = Get-PSPackageProjectConfiguration
171
+ $config = Get-BuildConfiguration
184
172
if ($env:SkipSigning -eq 'True')
185
173
{
186
174
$srcModulePath = Resolve-Path -Path "$($config.BuildOutputPath)/$($config.ModuleName)"
0 commit comments