diff --git a/.vsts-ci/azure-pipelines-ci.yml b/.vsts-ci/azure-pipelines-ci.yml index e12ee8277..020cf2a29 100644 --- a/.vsts-ci/azure-pipelines-ci.yml +++ b/.vsts-ci/azure-pipelines-ci.yml @@ -1,44 +1,64 @@ -trigger: -- master -- legacy/1.x +name: PR-$(System.PullRequest.PullRequestNumber)-$(Date:yyyyMMdd)$(Rev:.rr) + variables: - # Don't download unneeded packages + # Don't download unneeded packages - name: DOTNET_SKIP_FIRST_TIME_EXPERIENCE value: 'true' - # Don't send telemetry + # Improve performance by not sending telemetry - name: DOTNET_CLI_TELEMETRY_OPTOUT value: 'true' + +trigger: + batch: true + branches: + include: + - master + - legacy/1.x + paths: + exclude: + - /.dependabot/* + - /.poshchan/* + - /.github/**/* + - /.vscode/**/* + - /.vsts-ci/misc-analysis.yml + - /tools/**/* + - .editorconfig + - .gitattributes + - .gitignore + - /docs/**/* + - /CHANGELOG.md + - /CONTRIBUTING.md + - /README.md + - /LICENSE + - /CODE_OF_CONDUCT.md + jobs: -- job: Windows_powershell +- job: 'PS51_Win10' + displayName: PowerShell 5.1 | Windows 10 pool: - vmImage: 'VS2017-Win2016' + vmImage: 'vs2017-win2016' steps: - - powershell: scripts/azurePipelinesBuild.ps1 - - task: PublishTestResults@2 - inputs: - testRunner: VSTest - testResultsFiles: '**/*.trx' - condition: succeededOrFailed() - - task: PublishBuildArtifacts@1 - inputs: - ArtifactName: PowerShellEditorServices - PathtoPublish: '$(Build.ArtifactStagingDirectory)' - + - template: templates/ci-general.yml + parameters: + pwsh: false -- job: Windows_pwsh +- job: 'PS6_Win10' + displayName: PowerShell 6 | Windows 10 pool: - vmImage: 'VS2017-Win2016' + vmImage: 'vs2017-win2016' steps: - template: templates/ci-general.yml -- job: macOS +- job: 'PS6_macOS' + displayName: PowerShell 6 | macOS pool: vmImage: 'macOS-10.13' steps: - template: templates/ci-general.yml -- job: Linux +- job: 'PS6_Ubuntu' + displayName: PowerShell 6 | Ubuntu pool: - vmImage: 'Ubuntu-16.04' + vmImage: 'ubuntu-16.04' steps: - template: templates/ci-general.yml diff --git a/.vsts-ci/templates/ci-general.yml b/.vsts-ci/templates/ci-general.yml index 328370aa3..2bce528c0 100644 --- a/.vsts-ci/templates/ci-general.yml +++ b/.vsts-ci/templates/ci-general.yml @@ -1,5 +1,14 @@ +parameters: + pwsh: true + steps: - - pwsh: scripts/azurePipelinesBuild.ps1 + - pwsh: Write-Host "##vso[build.updatebuildnumber]$env:BUILD_SOURCEBRANCHNAME-$env:BUILD_SOURCEVERSION-$((get-date).ToString("yyyyMMddhhmmss"))" + displayName: Set Build Name for Non-PR + condition: ne(variables['Build.Reason'], 'PullRequest') + - task: PowerShell@2 + inputs: + filePath: scripts/azurePipelinesBuild.ps1 + pwsh: ${{ parameters.pwsh }} - task: PublishTestResults@2 inputs: testRunner: VSTest diff --git a/PowerShellEditorServices.build.ps1 b/PowerShellEditorServices.build.ps1 index 9991125b5..d09c14323 100644 --- a/PowerShellEditorServices.build.ps1 +++ b/PowerShellEditorServices.build.ps1 @@ -268,7 +268,7 @@ task GetProductVersion -Before PackageNuGet, PackageModule, UploadArtifacts { # SYSTEM_PHASENAME is the Job name. # Job names can only include `_` but that's not a valid character for versions. $jobname = $env:SYSTEM_PHASENAME -replace '_', '' - $script:BuildNumber = "$jobname-$env:BUILD_BUILDNUMBER" + $script:BuildNumber = "$jobname-$env:BUILD_BUILDID" } if ($script:VersionSuffix -ne $null) {