Skip to content

Move to yml legacy #2192

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
43 changes: 43 additions & 0 deletions .vsts-ci/azure-pipelines-release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
name: PR-$(System.PullRequest.PullRequestNumber)-$(Date:yyyyMMdd)$(Rev:.rr)

variables:
# Don't download unneeded packages
- name: DOTNET_SKIP_FIRST_TIME_EXPERIENCE
value: 'true'
# 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: 'ReleaseBuild'
displayName: 'Build release'
pool:
name: 'Package ES CodeHub Lab E'
demands: DotNetFramework
steps:
- template: templates/release-general.yml
121 changes: 121 additions & 0 deletions .vsts-ci/templates/release-general.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,121 @@
steps:
- 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')

- pwsh: |
Get-ChildItem -Path env:
displayName: Capture environment
condition: succeededOrFailed()

- task: PkgESSetupBuild@10
displayName: 'Package ES - Setup Build'
inputs:
productName: vscode-powershell

- task: PowerShell@2
displayName: 'Set environment variables for VSTS (Phase 1)'
inputs:
targetType: filePath
filePath: ./tools/releaseBuild/setVstsVariables.ps1

- task: PowerShell@2
displayName: 'Find PowerShellEditorServices build'
env:
SYSTEM_ACCESSTOKEN: $(System.AccessToken)
inputs:
targetType: filePath
filePath: ./tools/releaseBuild/findPsesBuild.ps1

- task: DownloadBuildArtifacts@0
displayName: 'Download Build Artifacts from PowerShell Editor Services'
inputs:
buildType: specific
project: '8e2735c1-3674-408a-bcab-87f089ea29d5'
pipeline: 1056
buildVersionToDownload: specific
buildId: '$(PSES_BUILDID)'
downloadType: single
artifactName: 'PowerShellEditorServices'
downloadPath: '$(Build.SourcesDirectory)'

- pwsh: |
Install-Module InvokeBuild -Force
Invoke-Build Release

- task: PublishTestResults@2
inputs:
testRunner: JUnit
testResultsFiles: '**/test-results.xml'
condition: succeededOrFailed()

- task: PkgESCodeSign@10
displayName: 'CodeSign tools/releaseBuild/signing.xml'
env:
SYSTEM_ACCESSTOKEN: $(System.AccessToken)
inputs:
signConfigXml: tools/releaseBuild/signing.xml
inPathRoot: '$(Build.ArtifactStagingDirectory)'
outPathRoot: '$(Build.ArtifactStagingDirectory)\Signed'

- task: ms.vss-governance-buildtask.governance-build-task-component-detection.ComponentGovernanceComponentDetection@0
displayName: 'Component Detection'

- task: AntiMalware@3
inputs:
InputType: 'Basic'
ScanType: 'CustomScan'
FileDirPath: '$(Build.ArtifactStagingDirectory)'
EnableServices: false
SupportLogOnError: false
TreatSignatureUpdateFailureAs: 'Warning'
SignatureFreshness: 'UpToDate'
TreatStaleSignatureAs: 'Error'

- task: PoliCheck@1
condition: succeededOrFailed()
inputs:
targetType: F
optionsFC: 0
optionsXS: 0
optionsPE: '1|2|3|4'
optionsHMENABLE: 0
optionsFTPATH: '$(Build.SourcesDirectory)\tools\terms\FileTypeSet.xml'
# toolVersion: 5.8.2.1

- task: CredScan@2
condition: succeededOrFailed()

# Publish results as artifacts
- task: PublishSecurityAnalysisLogs@3
condition: succeededOrFailed()
inputs:
ArtifactName: 'CodeAnalysisLogs'
ArtifactType: 'Container'

# Publish to TSA server
- task: TSAUpload@1
condition: succeededOrFailed()
continueOnError: true
inputs:
tsaVersion: 'TsaV2'
codebase: 'Existing'
tsaEnvironment: 'PROD'
codeBaseName: 'PowerShell_PowerShellEditorServices_20190917'
uploadAPIScan: false
uploadBinSkim: false
uploadCredScan: true
uploadFortifySCA: false
uploadFxCop: false
uploadModernCop: false
uploadPoliCheck: true
uploadPREfast: false
uploadRoslyn: false
uploadTSLint: false
uploadAsync: true

- task: PowerShell@1
displayName: 'Upload artifacts'
inputs:
scriptType: inlineScript
inlineScript: 'Write-Host "##vso[artifact.upload containerfolder=vscode-powershell;artifactname=vscode-powershell]$(System.ArtifactsDirectory)\Signed"'
34 changes: 0 additions & 34 deletions tools/releaseBuild/Image/DockerFile

This file was deleted.

13 changes: 0 additions & 13 deletions tools/releaseBuild/Image/build.ps1

This file was deleted.

114 changes: 0 additions & 114 deletions tools/releaseBuild/Image/dockerInstall.psm1

This file was deleted.

15 changes: 0 additions & 15 deletions tools/releaseBuild/build.json

This file was deleted.

24 changes: 18 additions & 6 deletions tools/releaseBuild/findPsesBuild.ps1
Original file line number Diff line number Diff line change
@@ -1,9 +1,21 @@
$branch = [uri]::EscapeDataString($env:PSES_BRANCH)
$buildsUrl = $env:VSTS_PSES_URL_TEMPLATE -f $branch
$headers = @{Authorization = "Bearer $env:SYSTEM_ACCESSTOKEN"}
$builds = Invoke-RestMethod -ContentType application/json -Uri $buildsUrl -Headers $headers
Write-Host "Got PSES_BRANCH: ${env:PSES_BRANCH}"

$buildsUrl = $env:VSTS_PSES_URL_TEMPLATE -f $branch, "succeeded"
$succeededBuilds = Invoke-RestMethod -ContentType application/json -Uri $buildsUrl -Headers $headers
Write-Host "Requested URL: $buildsUrl"
Write-Host "Got response:`n$(ConvertTo-Json $succeededBuilds)"

$buildsUrl = $env:VSTS_PSES_URL_TEMPLATE -f $branch, "partiallySucceeded"
$partiallySucceededBuilds = Invoke-RestMethod -ContentType application/json -Uri $buildsUrl -Headers $headers
Write-Host "Requested URL: $buildsUrl"
Write-Host "Got response:`n$(ConvertTo-Json $builds)"
Write-Host "setting PSES_BUILDID to $($builds.value[0].Id)"
Write-Host "##vso[task.setvariable variable=PSES_BUILDID]$($builds.value[0].Id)"
Write-Host "Got response:`n$(ConvertTo-Json $partiallySucceededBuilds)"

$builds = @(
$succeededBuilds.value
$partiallySucceededBuilds.value
) | Sort-Object finishTime -Descending

Write-Host "Got PSES_BRANCH: ${env:PSES_BRANCH}"
Write-Host "setting PSES_BUILDID to $($builds[0].Id)"
Write-Host "##vso[task.setvariable variable=PSES_BUILDID]$($builds[0].Id)"
2 changes: 1 addition & 1 deletion tools/releaseBuild/signing.xml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="utf-8" ?>
<SignConfigXML>
<job platform="" configuration="" dest="__OUTPATHROOT__\signed" jobname="vscode powershell" approvers="vigarg;gstolt">
<file src="__INPATHROOT__\release\out\PowerShell-insiders.vsix" signType="Vsix"
<file src="__INPATHROOT__\PowerShell-insiders.vsix" signType="100040160"
dest="__OUTPATHROOT__\PowerShell-insiders.vsix" />
</job>
</SignConfigXML>
Loading