Skip to content

Commit 75bc4fb

Browse files
Merge pull request #1530 from PowerShell/andschwa/ado
Update release and CI pipelines
2 parents 34bdaf5 + fc903fe commit 75bc4fb

8 files changed

+68
-73
lines changed

.github/CODEOWNERS

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# https://help.github.com/articles/about-codeowners/
22

33
# Global reviewers
4-
* @tylerl0706 @rjmholt
4+
* @andschwa @rjmholt
55

66
# Area: Analysis & Formatting
77
src/PowerShellEditorServices/Analysis/ @rjmholt

.vsts-ci/azure-pipelines-ci.yml

+24-33
Original file line numberDiff line numberDiff line change
@@ -9,58 +9,49 @@ variables:
99
value: 'true'
1010

1111
trigger:
12-
batch: true
1312
branches:
1413
include:
1514
- master
16-
- legacy/1.x
17-
paths:
18-
exclude:
19-
- /.dependabot/*
20-
- /.poshchan/*
21-
- /.github/**/*
22-
- /.vscode/**/*
23-
- /.vsts-ci/misc-analysis.yml
24-
- /tools/**/*
25-
- .editorconfig
26-
- .gitattributes
27-
- .gitignore
28-
- /docs/**/*
29-
- /CHANGELOG.md
30-
- /CONTRIBUTING.md
31-
- /README.md
32-
- /LICENSE
33-
- /CODE_OF_CONDUCT.md
3415

35-
# TODO: Setup matrix of image support.
16+
pr:
17+
- master
18+
3619
jobs:
37-
- job: 'PS51_Win10'
38-
displayName: PowerShell 5.1 | Windows 10
20+
- job: PS51_Win2016
21+
displayName: PowerShell 5.1 - Windows Server 2016
22+
pool:
23+
vmImage: vs2017-win2016
24+
steps:
25+
- template: templates/ci-general.yml
26+
parameters:
27+
pwsh: false
28+
29+
- job: PS51_Win2019
30+
displayName: PowerShell 5.1 - Windows Server 2019
3931
pool:
40-
# TODO: Update this image.
41-
vmImage: 'vs2017-win2016'
32+
vmImage: windows-2019
4233
steps:
4334
- template: templates/ci-general.yml
4435
parameters:
4536
pwsh: false
4637

47-
- job: 'PS7_Win10'
48-
displayName: PowerShell 7 | Windows 10
38+
- job: PS7_Win2019
39+
displayName: PowerShell 7 - Windows Server 2019
4940
pool:
50-
vmImage: 'windows-2019'
41+
vmImage: windows-2019
5142
steps:
5243
- template: templates/ci-general.yml
5344

54-
- job: 'PS7_macOS'
55-
displayName: PowerShell 7 | macOS
45+
- job: PS7_macOS
46+
displayName: PowerShell 7 - macOS 10.15
5647
pool:
57-
vmImage: 'macOS-10.15'
48+
vmImage: macOS-10.15
5849
steps:
5950
- template: templates/ci-general.yml
6051

61-
- job: 'PS7_Ubuntu'
62-
displayName: PowerShell 7 | Ubuntu
52+
- job: PS7_Ubuntu
53+
displayName: PowerShell 7 - Ubuntu 20.04
6354
pool:
64-
vmImage: 'ubuntu-20.04'
55+
vmImage: ubuntu-20.04
6556
steps:
6657
- template: templates/ci-general.yml

.vsts-ci/azure-pipelines-release.yml

+3-6
Original file line numberDiff line numberDiff line change
@@ -11,10 +11,7 @@ variables:
1111
trigger:
1212
branches:
1313
include:
14-
- release/*
15-
tags:
16-
include:
17-
- v*
14+
- release
1815

1916
resources:
2017
repositories:
@@ -32,7 +29,7 @@ stages:
3229
jobs:
3330
- job: Build
3431
pool:
35-
vmImage: vs2017-win2016
32+
vmImage: windows-2019
3633
steps:
3734
- template: templates/ci-general.yml
3835

@@ -54,7 +51,7 @@ stages:
5451
- deployment: Publish
5552
environment: PowerShellEditorServices
5653
pool:
57-
name: 1ES
54+
vmImage: ubuntu-latest
5855
variables:
5956
- group: Publish
6057
strategy:

.vsts-ci/misc-analysis.yml

+4-10
Original file line numberDiff line numberDiff line change
@@ -1,31 +1,25 @@
11
name: PR-$(System.PullRequest.PullRequestNumber)-$(Date:yyyyMMdd)$(Rev:.rr)
2+
23
trigger:
3-
# Batch merge builds together while a merge build is running
4-
batch: true
54
branches:
65
include:
76
- master
87

98
pr:
10-
branches:
11-
include:
12-
- master
13-
- legacy/1.x
9+
- master
1410

1511
resources:
1612
repositories:
1713
- repository: ComplianceRepo
1814
type: github
19-
endpoint: ComplianceGHRepo
15+
endpoint: GitHub
2016
name: PowerShell/compliance
2117

2218
jobs:
23-
- job: Compliance_Job
19+
- job: Compliance
2420
pool:
2521
vmImage: windows-latest
2622
steps:
2723
- checkout: self
28-
clean: true
2924
- checkout: ComplianceRepo
30-
clean: true
3125
- template: ci-compliance.yml@ComplianceRepo

.vsts-ci/templates/ci-general.yml

+13-3
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ parameters:
44
default: true
55

66
steps:
7-
- pwsh: '$PSVersionTable'
7+
- pwsh: $PSVersionTable
88
displayName: PowerShell version
99

1010
- task: PowerShell@2
@@ -13,10 +13,20 @@ steps:
1313
filePath: tools/azurePipelinesBuild.ps1
1414
pwsh: ${{ parameters.pwsh }}
1515

16-
- publish: module
16+
# NOTE: We zip the artifacts because they're ~20 MB compressed, but ~300 MB raw,
17+
# and we have limited pipeline artifact storage space.
18+
- task: ArchiveFiles@2
19+
displayName: Zip pipeline artifacts
20+
inputs:
21+
rootFolderOrFile: module
22+
includeRootFolder: false
23+
archiveType: zip
24+
archiveFile: PowerShellEditorServices-Build.zip
25+
verbose: true
26+
27+
- publish: PowerShellEditorServices-Build.zip
1728
artifact: PowerShellEditorServices-Build-$(System.JobId)
1829
displayName: Publish unsigned pipeline artifacts
19-
condition: succeededOrFailed()
2030

2131
- task: PublishTestResults@2
2232
displayName: Publish test results
+4-7
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,12 @@
11
steps:
22
- checkout: self
33
- checkout: vscode-powershell
4+
45
- download: current
56
artifact: PowerShellEditorServices
67
displayName: Download signed pipeline artifacts
8+
79
- pwsh: |
8-
Set-PSRepository -Name PSGallery -InstallationPolicy Trusted | Out-Null
9-
Install-Module -Name PowerShellForGitHub -Scope CurrentUser -Force -Confirm:$false
10-
Import-Module '$(Build.SourcesDirectory)/vscode-powershell/tools/ReleaseTools.psm1'
11-
Set-GitHubConfiguration -SuppressTelemetryReminder
12-
$password = ConvertTo-SecureString -String '$(GitHubToken)' -AsPlainText -Force
13-
Set-GitHubAuthentication -Credential (New-Object System.Management.Automation.PSCredential ("token", $password))
14-
New-DraftRelease -RepositoryName PowerShellEditorServices -Assets '$(Pipeline.Workspace)/PowerShellEditorServices/PowerShellEditorServices.zip'
10+
$(Build.SourcesDirectory)/vscode-powershell/tools/setupReleaseTools.ps1 -Token $(GitHubToken)
11+
New-DraftRelease -RepositoryName PowerShellEditorServices -Assets $(Pipeline.Workspace)/PowerShellEditorServices/PowerShellEditorServices.zip
1512
displayName: Drafting a GitHub Release

.vsts-ci/templates/release-general.yml

+14-8
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,21 @@
11
steps:
2-
32
- download: current
43
displayName: Download unsigned pipeline artifacts
54

5+
- task: ExtractFiles@1
6+
displayName: Extract unsigned artifacts
7+
inputs:
8+
archiveFilePatterns: $(Pipeline.Workspace)/PowerShellEditorServices-Build-*/PowerShellEditorServices-Build.zip
9+
destinationFolder: $(Pipeline.Workspace)/Unsigned
10+
cleanDestinationFolder: true
11+
612
- checkout: ComplianceRepo
713

814
# NOTE: The signing templates explicitly copy everything along as they run, so
915
# the last output path has every signed (and intentionally unsigned) file.
1016
- template: EsrpSign.yml@ComplianceRepo
1117
parameters:
12-
buildOutputPath: $(Pipeline.Workspace)/PowerShellEditorServices-Build-*
18+
buildOutputPath: $(Pipeline.Workspace)/Unsigned
1319
signOutputPath: $(Pipeline.Workspace)/FirstPartySigned
1420
alwaysCopy: true
1521
certificateId: CP-230012 # Authenticode certificate
@@ -43,7 +49,7 @@ steps:
4349
**/UnixConsoleEcho.dll
4450
4551
- task: ArchiveFiles@2
46-
displayName: Zip finished assets
52+
displayName: Zip signed artifacts
4753
inputs:
4854
rootFolderOrFile: $(Pipeline.Workspace)/ThirdPartySigned
4955
includeRootFolder: false
@@ -52,10 +58,6 @@ steps:
5258
replaceExistingArchive: true
5359
verbose: true
5460

55-
- publish: PowerShellEditorServices.zip
56-
artifact: PowerShellEditorServices
57-
displayName: Publish signed pipeline artifacts
58-
5961
- checkout: self
6062

6163
- template: assembly-module-compliance.yml@ComplianceRepo
@@ -74,5 +76,9 @@ steps:
7476
optionsFTPath: $(Build.SourcesDirectory)/PowerShellEditorServices/tools/terms/FileTypeSet.xml
7577
# tsa-upload
7678
codeBaseName: PowerShell_PowerShellEditorServices_20210201
77-
# selections
79+
# We don't use any Windows APIs directly, so we don't need API scan
7880
APIScan: false
81+
82+
- publish: PowerShellEditorServices.zip
83+
artifact: PowerShellEditorServices
84+
displayName: Publish signed pipeline artifacts

tools/azurePipelinesBuild.ps1

+5-5
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,9 @@ $ErrorActionPreference = 'Stop'
66
Set-PSRepository -Name PSGallery -InstallationPolicy Trusted | Out-Null
77
if ($IsWindows -or $PSVersionTable.PSVersion.Major -lt 6) {
88
# We rely on PowerShellGet's -AllowPrerelease which is in PowerShellGet 1.6 so we need to update PowerShellGet.
9-
Get-Module PowerShellGet,PackageManagement | Remove-Module -Force -Verbose
10-
powershell -Command { Install-Module -Name PowerShellGet -MinimumVersion 1.6 -Force -Confirm:$false -Verbose }
11-
powershell -Command { Install-Module -Name PackageManagement -MinimumVersion 1.1.7.0 -Force -Confirm:$false -Verbose }
9+
Get-Module PowerShellGet,PackageManagement | Remove-Module -Force
10+
powershell -Command { Install-Module -Name PowerShellGet -MinimumVersion 1.6 -Force }
11+
powershell -Command { Install-Module -Name PackageManagement -MinimumVersion 1.1.7.0 -Force }
1212
Import-Module -Name PowerShellGet -MinimumVersion 1.6 -Force
1313
Import-Module -Name PackageManagement -MinimumVersion 1.1.7.0 -Force
1414
}
@@ -17,7 +17,7 @@ if ($IsWindows -or $PSVersionTable.PSVersion.Major -lt 6) {
1717
Update-Help -Force -ErrorAction SilentlyContinue
1818

1919
# Needed for build and docs gen.
20-
Install-Module InvokeBuild -MaximumVersion 5.1.0 -Scope CurrentUser
21-
Install-Module PlatyPS -RequiredVersion 0.9.0 -Scope CurrentUser
20+
Install-Module -Name InvokeBuild -MaximumVersion 5.1.0 -Scope CurrentUser -Force
21+
Install-Module -Name PlatyPS -RequiredVersion 0.9.0 -Scope CurrentUser -Force
2222

2323
Invoke-Build -Configuration Release

0 commit comments

Comments
 (0)