@@ -173,6 +173,7 @@ stages:
173173
174174 $classicScannerZipPath = Get-Item "$artifactsFolder\\sonarscanner-msbuild-net46.zip"
175175 $dotnetScannerZipPath = Get-Item "$artifactsFolder\\sonarscanner-msbuild-netcoreapp2.0.zip"
176+ $dotnetScannerZipPath3 = Get-Item "$artifactsFolder\\sonarscanner-msbuild-netcoreapp3.0.zip"
176177 $dotnetScannerGlobalToolPath = Get-Item "$artifactsFolder\\dotnet-sonarscanner.$leakPeriodVersion.nupkg"
177178
178179 Write-Host "Generating the chocolatey packages"
@@ -188,6 +189,12 @@ stages:
188189 -Replace '-Checksum "not-set"', "-Checksum $dotnetZipHash" `
189190 | Set-Content $netcoreps1
190191
192+ $dotnetZipHash3 = (Get-FileHash $dotnetScannerZipPath3 -Algorithm SHA256).hash
193+ $netcoreps13 = "nuspec\chocolatey\chocolateyInstall-netcoreapp3.0.ps1"
194+ (Get-Content $netcoreps13) `
195+ -Replace '-Checksum "not-set"', "-Checksum $dotnetZipHash3" `
196+ | Set-Content $netcoreps13
197+
191198 choco pack nuspec\chocolatey\sonarscanner-msbuild-net46.nuspec `
192199 --outputdirectory $artifactsFolder `
193200 --version $version
@@ -196,14 +203,19 @@ stages:
196203 --outputdirectory $artifactsFolder `
197204 --version $version
198205
206+ choco pack nuspec\chocolatey\sonarscanner-msbuild-netcoreapp3.0.nuspec `
207+ --outputdirectory $artifactsFolder `
208+ --version $version
209+
199210 Write-Host "Update artifacts locations in pom.xml"
200211 $pomFile = ".\pom.xml"
201212 (Get-Content $pomFile) `
202213 -Replace 'classicScannerZipPath', "$classicScannerZipPath" `
203214 -Replace 'dotnetScannerZipPath', "$dotnetScannerZipPath" `
204215 -Replace 'dotnetScannerGlobalToolPath', "$dotnetScannerGlobalToolPath" `
205216 -Replace 'classicScannerChocoPath', "$artifactsFolder\\sonarscanner-msbuild-net46.$version.nupkg" `
206- -Replace 'dotnetScannerChocoPath', "$artifactsFolder\\sonarscanner-msbuild-netcoreapp2.0.$version.nupkg" `
217+ -Replace 'dotnetcore2ScannerChocoPath', "$artifactsFolder\\sonarscanner-msbuild-netcoreapp2.0.$version.nupkg" `
218+ -Replace 'dotnetcore3ScannerChocoPath', "$artifactsFolder\\sonarscanner-msbuild-netcoreapp3.0.$version.nupkg" `
207219 | Set-Content $pomFile
208220 - task : Maven@3
209221 displayName : Promote new version in pom
@@ -236,6 +248,15 @@ stages:
236248 javaHomeOption : ' JDKVersion'
237249 jdkVersionOption : ' 1.11'
238250 mavenOptions : $(MAVEN_OPTS)
251+ - task : PowerShell@2
252+ displayName : " Rename artifacts for GitHub Release"
253+ inputs :
254+ targetType : ' inline'
255+ script : |
256+ $artifactsFolder = "$env:BUILD_SOURCESDIRECTORY\\DeploymentArtifacts\\BuildAgentPayload\\Release"
257+ Rename-Item -Path "$artifactsFolder\\sonarscanner-msbuild-net46.zip" -NewName sonarscanner-msbuild-$(SONAR_PROJECT_VERSION).$(Build.BuildId)-net46.zip
258+ Rename-Item -Path "$artifactsFolder\\sonarscanner-msbuild-netcoreapp2.0.zip" -NewName sonarscanner-msbuild-$(SONAR_PROJECT_VERSION).$(Build.BuildId)-netcoreapp2.0.zip
259+ Rename-Item -Path "$artifactsFolder\\sonarscanner-msbuild-netcoreapp3.0.zip" -NewName sonarscanner-msbuild-$(SONAR_PROJECT_VERSION).$(Build.BuildId)-netcoreapp3.0.zip
239260 - task : PublishPipelineArtifact@1
240261 displayName : ' Publish packages as artifacts'
241262 inputs :
0 commit comments