@@ -42,23 +42,23 @@ jobs:
42
42
disableNugetPack : true
43
43
44
44
- pwsh : |
45
+ function Send-VstsCommand ($vstsCommandString) {
46
+ Write-Host ("sending: " + $vstsCommandString)
47
+ Write-Host "##$vstsCommandString"
48
+ }
45
49
$(Build.SourcesDirectory)\build.ps1 -Bootstrap
46
50
$(Build.SourcesDirectory)\build.ps1 -Configuration Release -Framework net461
47
51
# Get module version
48
52
$psd1Data = Import-PowerShellDataFile -Path $(Build.SourcesDirectory)\bin\Release\PSReadLine\PSReadLine.psd1
49
53
$moduleVersion = $psd1Data.ModuleVersion
50
54
$prerelease = $psd1Data.PrivateData.PSData.Prerelease
51
55
if ($prerelease) { $moduleVersion = "$moduleVersion-$prerelease" }
52
- $vstsCommandString = "vso[task.setvariable variable=ModuleVersion]$moduleVersion"
53
- Write-Host "sending " + $vstsCommandString
54
- Write-Host "##$vstsCommandString"
56
+ Send-VstsCommand "vso[task.setvariable variable=ModuleVersion]$moduleVersion"
55
57
# Set target folder paths
56
- $vstsCommandString = "vso[task.setvariable variable=PSReadLine]$(Build.SourcesDirectory)\bin\Release\PSReadLine"
57
- Write-Host "sending " + $vstsCommandString
58
- Write-Host "##$vstsCommandString"
59
- $vstsCommandString = "vso[task.setvariable variable=Signed]$(Build.SourcesDirectory)\bin\Release\Signed"
60
- Write-Host "sending " + $vstsCommandString
61
- Write-Host "##$vstsCommandString"
58
+ New-Item -Path $(Build.SourcesDirectory)\bin\Release\NuGetPackage -ItemType Directory > $null
59
+ Send-VstsCommand "vso[task.setvariable variable=NuGetPackage]$(Build.SourcesDirectory)\bin\Release\NuGetPackage"
60
+ Send-VstsCommand "vso[task.setvariable variable=PSReadLine]$(Build.SourcesDirectory)\bin\Release\PSReadLine"
61
+ Send-VstsCommand "vso[task.setvariable variable=Signed]$(Build.SourcesDirectory)\bin\Release\Signed"
62
62
displayName: Bootstrap & Build
63
63
64
64
# Sign the module files
@@ -132,9 +132,21 @@ jobs:
132
132
displayName: 'Verify the catalog file'
133
133
134
134
- pwsh : |
135
- Get-ChildItem -Path $(PSReadLine)
135
+ try {
136
+ $RepoName = "PSRLLocal"
137
+ Register-PSRepository -Name $RepoName -SourceLocation $(NuGetPackage) -PublishLocation $(NuGetPackage) -InstallationPolicy Trusted
138
+ Publish-Module -Repository $RepoName -Path $(PSReadLine)
139
+ } finally {
140
+ Unregister-PSRepository -Name $RepoName -ErrorAction SilentlyContinue
141
+ }
142
+ Get-ChildItem -Path $(NuGetPackage)
143
+ displayName: 'Create the NuGet package'
144
+
145
+ - pwsh : |
146
+ Get-ChildItem -Path $(PSReadLine), $(NuGetPackage)
136
147
Write-Host "##vso[artifact.upload containerfolder=PSReadLine;artifactname=PSReadLine]$(PSReadLine)"
137
- displayName: 'Upload module artifacts'
148
+ Write-Host "##vso[artifact.upload containerfolder=NuGetPackage;artifactname=NuGetPackage]$(NuGetPackage)"
149
+ displayName: 'Upload artifacts'
138
150
139
151
- template : templates/compliance.yml
140
152
parameters :
0 commit comments