diff --git a/azure-pipelines.yml b/azure-pipelines.yml index f6b8ab2c2..c25545a56 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -1,13 +1,6 @@ trigger: - branches: - include: - - master - - 'maint.*' - paths: - exclude: - - doc/ - - '*.md' - - .vscode/ +- master +- maint/* variables: TreatWarningsAsErrors: true diff --git a/azure-pipelines/Convert-PDB.ps1 b/azure-pipelines/Convert-PDB.ps1 deleted file mode 100644 index 6efd380ee..000000000 --- a/azure-pipelines/Convert-PDB.ps1 +++ /dev/null @@ -1,37 +0,0 @@ -<# -.SYNOPSIS - Converts between Windows PDB and Portable PDB formats. -.PARAMETER DllPath - The path to the DLL whose PDB is to be converted. -.PARAMETER PdbPath - The path to the PDB to convert. May be omitted if the DLL was compiled on this machine and the PDB is still at its original path. -.PARAMETER OutputPath - The path of the output PDB to write. -#> -#Function Convert-PortableToWindowsPDB() { - Param( - [Parameter(Mandatory=$true,Position=0)] - [string]$DllPath, - [Parameter()] - [string]$PdbPath, - [Parameter(Mandatory=$true,Position=1)] - [string]$OutputPath - ) - - $version = '1.1.0-beta2-19516-01' - $baseDir = "$PSScriptRoot\..\obj\tools" - $pdb2pdbpath = "$baseDir\pdb2pdb.$version\tools\Pdb2Pdb.exe" - if (-not (Test-Path $pdb2pdbpath)) { - if (-not (Test-Path $baseDir)) { New-Item -Type Directory -Path $baseDir | Out-Null } - $baseDir = (Resolve-Path $baseDir).Path # Normalize it - & (& $PSScriptRoot\Get-NuGetTool.ps1) install pdb2pdb -version $version -PackageSaveMode nuspec -OutputDirectory $baseDir -Source https://dotnet.myget.org/F/symreader-converter/api/v3/index.json | Out-Null - } - - $args = $DllPath,'/out',$OutputPath,'/nowarn','0021' - if ($PdbPath) { - $args += '/pdb',$PdbPath - } - - Write-Verbose "$pdb2pdbpath $args" - & $pdb2pdbpath $args -#} diff --git a/azure-pipelines/Get-NuGetTool.ps1 b/azure-pipelines/Get-NuGetTool.ps1 deleted file mode 100644 index 4431adb91..000000000 --- a/azure-pipelines/Get-NuGetTool.ps1 +++ /dev/null @@ -1,22 +0,0 @@ -<# -.SYNOPSIS - Downloads the NuGet.exe tool and returns the path to it. -.PARAMETER NuGetVersion - The version of the NuGet tool to acquire. -#> -Param( - [Parameter()] - [string]$NuGetVersion='5.2.0' -) - -$toolsPath = & "$PSScriptRoot\Get-TempToolsPath.ps1" -$binaryToolsPath = Join-Path $toolsPath $NuGetVersion -if (!(Test-Path $binaryToolsPath)) { $null = mkdir $binaryToolsPath } -$nugetPath = Join-Path $binaryToolsPath nuget.exe - -if (!(Test-Path $nugetPath)) { - Write-Host "Downloading nuget.exe $NuGetVersion..." -ForegroundColor Yellow - (New-Object System.Net.WebClient).DownloadFile("https://dist.nuget.org/win-x86-commandline/v$NuGetVersion/NuGet.exe", $nugetPath) -} - -return (Resolve-Path $nugetPath).Path diff --git a/azure-pipelines/Get-TempToolsPath.ps1 b/azure-pipelines/Get-TempToolsPath.ps1 deleted file mode 100644 index bb3da8e33..000000000 --- a/azure-pipelines/Get-TempToolsPath.ps1 +++ /dev/null @@ -1,13 +0,0 @@ -if ($env:AGENT_TEMPDIRECTORY) { - $path = "$env:AGENT_TEMPDIRECTORY\$env:BUILD_BUILDID" -} elseif ($env:localappdata) { - $path = "$env:localappdata\gitrepos\tools" -} else { - $path = "$PSScriptRoot\..\obj\tools" -} - -if (!(Test-Path $path)) { - New-Item -ItemType Directory -Path $Path | Out-Null -} - -(Resolve-Path $path).Path diff --git a/azure-pipelines/Get-nbgv.ps1 b/azure-pipelines/Get-nbgv.ps1 deleted file mode 100644 index a5be2cf7c..000000000 --- a/azure-pipelines/Get-nbgv.ps1 +++ /dev/null @@ -1,24 +0,0 @@ -<# -.SYNOPSIS - Gets the path to the nbgv CLI tool, installing it if necessary. -#> -Param( -) - -$existingTool = Get-Command "nbgv" -ErrorAction SilentlyContinue -if ($existingTool) { - return $existingTool.Path -} - -$toolInstallDir = & "$PSScriptRoot/Get-TempToolsPath.ps1" - -$toolPath = "$toolInstallDir/nbgv" -if (!(Test-Path $toolInstallDir)) { New-Item -Path $toolInstallDir -ItemType Directory | Out-Null } - -if (!(Get-Command $toolPath -ErrorAction SilentlyContinue)) { - Write-Host "Installing nbgv to $toolInstallDir" - dotnet tool install --tool-path "$toolInstallDir" nbgv --configfile "$PSScriptRoot/justnugetorg.nuget.config" | Out-Null -} - -# Normalize the path on the way out. -return (Get-Command $toolPath).Path diff --git a/azure-pipelines/build.yml b/azure-pipelines/build.yml index e5e6f479d..1462628c8 100644 --- a/azure-pipelines/build.yml +++ b/azure-pipelines/build.yml @@ -5,21 +5,13 @@ jobs: - job: Windows pool: ${{ parameters.windowsPool }} steps: - - checkout: self - clean: true - template: install-dependencies.yml - - - powershell: '& (./azure-pipelines/Get-nbgv.ps1) cloud' - displayName: Set build number - - template: dotnet.yml - job: Linux pool: vmImage: Ubuntu 18.04 steps: - - checkout: self - clean: true - template: install-dependencies.yml - template: dotnet.yml @@ -27,8 +19,6 @@ jobs: pool: vmImage: macOS 10.13 steps: - - checkout: self - clean: true - template: install-dependencies.yml - template: dotnet.yml @@ -41,8 +31,6 @@ jobs: vmImage: Ubuntu 18.04 condition: succeededOrFailed() steps: - - checkout: self - clean: true - template: install-dependencies.yml parameters: initArgs: -NoRestore @@ -53,8 +41,6 @@ jobs: pool: vmImage: Ubuntu 18.04 steps: - - checkout: self - clean: true - template: install-dependencies.yml - task: DotNetCoreCLI@2 displayName: dotnet test -f netcoreapp2.1 diff --git a/azure-pipelines/dotnet.yml b/azure-pipelines/dotnet.yml index 35aa8c979..8c9f5f909 100644 --- a/azure-pipelines/dotnet.yml +++ b/azure-pipelines/dotnet.yml @@ -29,13 +29,6 @@ steps: arguments: --no-build -c $(BuildConfiguration) -f netcoreapp2.1 --filter "TestCategory!=FailsInCloudTest" -v n /p:CollectCoverage=true testRunTitle: netcoreapp2.1-$(Agent.JobName) -- task: PowerShell@2 - inputs: - filePath: azure-pipelines/variables/_pipelines.ps1 - failOnStderr: true - displayName: Update pipeline variables based on build outputs - condition: succeededOrFailed() - - task: PowerShell@2 inputs: filePath: azure-pipelines/artifacts/_pipelines.ps1 @@ -43,15 +36,6 @@ steps: displayName: Publish artifacts condition: succeededOrFailed() -- task: PublishSymbols@2 - inputs: - SymbolsFolder: $(Build.ArtifactStagingDirectory)/symbols-Windows - SearchPattern: '**/*.pdb' - IndexSources: false - SymbolServerType: TeamServices - displayName: Publish symbols to symbol server - condition: and(succeeded(), ne(variables['Build.Reason'], 'PullRequest'), eq(variables['Agent.OS'], 'Windows_NT')) - - bash: bash <(curl -s https://codecov.io/bash) displayName: Publish code coverage results to codecov.io timeoutInMinutes: 3 diff --git a/azure-pipelines/install-dependencies.yml b/azure-pipelines/install-dependencies.yml index 9257db852..5b008c6e8 100644 --- a/azure-pipelines/install-dependencies.yml +++ b/azure-pipelines/install-dependencies.yml @@ -7,9 +7,3 @@ steps: .\init.ps1 -AccessToken '$(System.AccessToken)' ${{ parameters['initArgs'] }} -UpgradePrerequisites dotnet --info displayName: Install prerequisites - -- task: PowerShell@2 - inputs: - filePath: azure-pipelines/variables/_pipelines.ps1 - failOnStderr: true - displayName: Set pipeline variables based on source diff --git a/azure-pipelines/justnugetorg.nuget.config b/azure-pipelines/justnugetorg.nuget.config deleted file mode 100644 index 765346e53..000000000 --- a/azure-pipelines/justnugetorg.nuget.config +++ /dev/null @@ -1,7 +0,0 @@ - - - - - - - diff --git a/azure-pipelines/publish-codecoverage.yml b/azure-pipelines/publish-codecoverage.yml index 6d367de96..59dba9d40 100644 --- a/azure-pipelines/publish-codecoverage.yml +++ b/azure-pipelines/publish-codecoverage.yml @@ -12,7 +12,7 @@ steps: displayName: Download macOS code coverage results continueOnError: true - powershell: | - dotnet tool install --tool-path obj dotnet-reportgenerator-globaltool --version 4.2.2 --configfile azure-pipelines/justnugetorg.nuget.config + dotnet tool install --tool-path obj dotnet-reportgenerator-globaltool --version 4.2.2 Copy-Item -Recurse $(Pipeline.Workspace)/coverageResults-Windows/obj/* $(System.DefaultWorkingDirectory)/obj Write-Host "Substituting {reporoot} with $(System.DefaultWorkingDirectory)" $reports = Get-ChildItem -Recurse "$(Pipeline.Workspace)/coverage.cobertura.xml" diff --git a/azure-pipelines/variables/_all.ps1 b/azure-pipelines/variables/_all.ps1 deleted file mode 100644 index ed0997922..000000000 --- a/azure-pipelines/variables/_all.ps1 +++ /dev/null @@ -1,11 +0,0 @@ -# This script returns a hashtable of build variables that should be set -# at the start of a build or release definition's execution. - -$vars = @{} - -Get-ChildItem "$PSScriptRoot\*.ps1" -Exclude "_*" |% { - Write-Host "Computing $($_.BaseName) variable" - $vars[$_.BaseName] = & $_ -} - -$vars diff --git a/azure-pipelines/variables/_pipelines.ps1 b/azure-pipelines/variables/_pipelines.ps1 deleted file mode 100644 index 28230b817..000000000 --- a/azure-pipelines/variables/_pipelines.ps1 +++ /dev/null @@ -1,19 +0,0 @@ -# This script translates the variables returned by the _all.ps1 script -# into commands that instruct Azure Pipelines to actually set those variables for other pipeline tasks to consume. - -# The build or release definition may have set these variables to override -# what the build would do. So only set them if they have not already been set. - -(& "$PSScriptRoot\_all.ps1").GetEnumerator() |% { - if (Test-Path -Path "env:$($_.Key)") { - Write-Host "Skipping setting $($_.Key) because variable is already set." -ForegroundColor Cyan - } else { - Write-Host "$($_.Key)=$($_.Value)" -ForegroundColor Yellow - if ($env:TF_BUILD) { - Write-Host "##vso[task.setvariable variable=$($_.Key);]$($_.Value)" - } elseif ($env:GITHUB_ACTIONS) { - Write-Host "::set-env name=$($_.Key)::$($_.Value)" - } - Set-Item -Path "env:$($_.Key)" -Value $_.Value - } -} diff --git a/init.ps1 b/init.ps1 index 33140ac5e..907d85a5c 100644 --- a/init.ps1 +++ b/init.ps1 @@ -38,7 +38,6 @@ Param ( ) if (!$NoPrerequisites) { - & "$PSScriptRoot\tools\Install-NuGetCredProvider.ps1" -AccessToken $AccessToken -Force:$UpgradePrerequisites & "$PSScriptRoot\tools\Install-DotNetSdk.ps1" -InstallLocality $InstallLocality } diff --git a/tools/Install-NuGetCredProvider.ps1 b/tools/Install-NuGetCredProvider.ps1 deleted file mode 100644 index 0a8d77f62..000000000 --- a/tools/Install-NuGetCredProvider.ps1 +++ /dev/null @@ -1,66 +0,0 @@ -<# -.SYNOPSIS - Downloads and installs the Microsoft Artifacts Credential Provider - from https://github.com/microsoft/artifacts-credprovider - to assist in authenticating to Azure Artifact feeds in interactive development - or unattended build agents. -.PARAMETER Force - Forces install of the CredProvider plugin even if one already exists. This is useful to upgrade an older version. -.PARAMETER AccessToken - An optional access token for authenticating to Azure Artifacts authenticated feeds. -#> -[CmdletBinding()] -Param ( - [Parameter()] - [switch]$Force, - [Parameter()] - [string]$AccessToken -) - -$toolsPath = & "$PSScriptRoot\..\azure-pipelines\Get-TempToolsPath.ps1" - -if ($IsMacOS -or $IsLinux) { - $installerScript = "installcredprovider.sh" - $sourceUrl = "https://raw.githubusercontent.com/microsoft/artifacts-credprovider/master/helpers/installcredprovider.sh" -} else { - $installerScript = "installcredprovider.ps1" - $sourceUrl = "https://raw.githubusercontent.com/microsoft/artifacts-credprovider/master/helpers/installcredprovider.ps1" -} - -$installerScript = Join-Path $toolsPath $installerScript - -if (!(Test-Path $installerScript)) { - Invoke-WebRequest $sourceUrl -OutFile $installerScript -} - -$installerScript = (Resolve-Path $installerScript).Path - -if ($IsMacOS -or $IsLinux) { - chmod u+x $installerScript -} - -& $installerScript -Force:$Force - -if ($AccessToken) { - $endpoints = @() - - $nugetConfig = [xml](Get-Content -Path "$PSScriptRoot\..\nuget.config") - - $nugetConfig.configuration.packageSources.add |? { ($_.value -match '^https://pkgs\.dev\.azure\.com/') -or ($_.value -match '^https://[\w\-]+\.pkgs\.visualstudio\.com/') } |% { - $endpoint = New-Object -TypeName PSObject - Add-Member -InputObject $endpoint -MemberType NoteProperty -Name endpoint -Value $_.value - Add-Member -InputObject $endpoint -MemberType NoteProperty -Name username -Value ado - Add-Member -InputObject $endpoint -MemberType NoteProperty -Name password -Value $AccessToken - $endpoints += $endpoint - } - - $auth = New-Object -TypeName PSObject - Add-Member -InputObject $auth -MemberType NoteProperty -Name endpointCredentials -Value $endpoints - - $authJson = ConvertTo-Json -InputObject $auth - $envVars = @{ - 'VSS_NUGET_EXTERNAL_FEED_ENDPOINTS'=$authJson; - } - - & "$PSScriptRoot\..\azure-pipelines\Set-EnvVars.ps1" -Variables $envVars | Out-Null -}