Skip to content

Commit 27b10b0

Browse files
committed
Replace 1ES with OneBranch pipeline
1 parent edafb44 commit 27b10b0

17 files changed

+268
-725
lines changed

.config/tsaoptions.json

+8
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
{
2+
"instanceUrl": "https://msazure.visualstudio.com",
3+
"projectName": "One",
4+
"areaPath": "One\\MGMT\\Compute\\Powershell\\Powershell",
5+
"notificationAliases": [ "[email protected]", "[email protected]" ],
6+
"codebaseName": "PowerShell_PowerShellEditorServices_20240313",
7+
"tools": [ "CredScan", "PoliCheck", "BinSkim" ]
8+
}

.github/release.yml

+16
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
changelog:
2+
exclude:
3+
labels:
4+
- Ignore
5+
authors:
6+
- dependabot[bot]
7+
categories:
8+
- title: Enhancements & Features ✨
9+
labels:
10+
- Issue-Enhancement
11+
- title: Squashed Bugs 🐛
12+
labels:
13+
- Issue-Bug
14+
- title: Other Changes 🙏
15+
labels:
16+
- "*"

.github/workflows/ci-test.yml

+3
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,9 @@ jobs:
3737
6.0.x
3838
7.0.x
3939
8.0.x
40+
source-url: https://pkgs.dev.azure.com/mscodehub/PowerShellCore/_packaging/PowerShellCore_PublicPackages/nuget/v3/index.json
41+
env:
42+
NUGET_AUTH_TOKEN: ${{ secrets.AZURE_NUGET_TOKEN }}
4043

4144
- name: Install PSResources
4245
shell: pwsh

.github/workflows/codeql-analysis.yml

+3
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,9 @@ jobs:
3333
with:
3434
cache: true
3535
cache-dependency-path: '**/packages.lock.json'
36+
source-url: https://pkgs.dev.azure.com/mscodehub/PowerShellCore/_packaging/PowerShellCore_PublicPackages/nuget/v3/index.json
37+
env:
38+
NUGET_AUTH_TOKEN: ${{ secrets.AZURE_NUGET_TOKEN }}
3639

3740
- name: Initialize CodeQL
3841
uses: github/codeql-action/init@v3

.github/workflows/emacs-test.yml

+3
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,9 @@ jobs:
2727
with:
2828
cache: true
2929
cache-dependency-path: '**/packages.lock.json'
30+
source-url: https://pkgs.dev.azure.com/mscodehub/PowerShellCore/_packaging/PowerShellCore_PublicPackages/nuget/v3/index.json
31+
env:
32+
NUGET_AUTH_TOKEN: ${{ secrets.AZURE_NUGET_TOKEN }}
3033

3134
- name: Install PSResources
3235
shell: pwsh

.github/workflows/vim-test.yml

+3
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,9 @@ jobs:
2727
with:
2828
cache: true
2929
cache-dependency-path: '**/packages.lock.json'
30+
source-url: https://pkgs.dev.azure.com/mscodehub/PowerShellCore/_packaging/PowerShellCore_PublicPackages/nuget/v3/index.json
31+
env:
32+
NUGET_AUTH_TOKEN: ${{ secrets.AZURE_NUGET_TOKEN }}
3033

3134
- name: Install PSResources
3235
shell: pwsh
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,182 @@
1+
#################################################################################
2+
# OneBranch Pipelines #
3+
# This pipeline was created by EasyStart from a sample located at: #
4+
# https://aka.ms/obpipelines/easystart/samples #
5+
# Documentation: https://aka.ms/obpipelines #
6+
# Yaml Schema: https://aka.ms/obpipelines/yaml/schema #
7+
# Retail Tasks: https://aka.ms/obpipelines/tasks #
8+
# Support: https://aka.ms/onebranchsup #
9+
#################################################################################
10+
11+
trigger: none
12+
13+
parameters:
14+
- name: debug
15+
displayName: Enable debug output
16+
type: boolean
17+
default: false
18+
19+
variables:
20+
system.debug: ${{ parameters.debug }}
21+
BuildConfiguration: Release
22+
WindowsContainerImage: onebranch.azurecr.io/windows/ltsc2019/vse2022:latest
23+
DOTNET_NOLOGO: true
24+
DOTNET_CLI_TELEMETRY_OPTOUT: true
25+
DOTNET_GENERATE_ASPNET_CERTIFICATE: false
26+
27+
resources:
28+
repositories:
29+
- repository: templates
30+
type: git
31+
name: OneBranch.Pipelines/GovernedTemplates
32+
ref: refs/heads/main
33+
34+
extends:
35+
# https://aka.ms/obpipelines/templates
36+
template: v2/OneBranch.Official.CrossPlat.yml@templates
37+
parameters:
38+
globalSdl: # https://aka.ms/obpipelines/sdl
39+
asyncSdl:
40+
enabled: true
41+
forStages: [build]
42+
stages:
43+
- stage: build
44+
jobs:
45+
- job: main
46+
displayName: Build package
47+
pool:
48+
type: windows
49+
variables:
50+
ob_outputDirectory: $(Build.SourcesDirectory)/module
51+
steps:
52+
- pwsh: |
53+
[xml]$xml = Get-Content PowerShellEditorServices.Common.props
54+
$version = $xml.Project.PropertyGroup.VersionPrefix
55+
Write-Output "##vso[task.setvariable variable=version;isOutput=true]$version"
56+
name: package
57+
displayName: Get version from project properties
58+
- task: onebranch.pipeline.version@1
59+
displayName: Set OneBranch version
60+
inputs:
61+
system: Custom
62+
customVersion: $(package.version)
63+
- task: UseDotNet@2
64+
displayName: Install .NET 8.x SDK
65+
inputs:
66+
packageType: sdk
67+
version: 8.x
68+
- task: UseDotNet@2
69+
displayName: Install .NET 7.x runtime
70+
inputs:
71+
packageType: runtime
72+
version: 7.x
73+
- task: UseDotNet@2
74+
displayName: Install .NET 6.x runtime
75+
inputs:
76+
packageType: runtime
77+
version: 6.x
78+
- task: PowerShell@2
79+
displayName: Install PSResources
80+
inputs:
81+
pwsh: true
82+
filePath: tools/installPSResources.ps1
83+
- task: PowerShell@2
84+
displayName: Build and test
85+
inputs:
86+
targetType: inline
87+
pwsh: true
88+
script: Invoke-Build TestFull -Configuration $(BuildConfiguration)
89+
- task: PublishTestResults@2
90+
displayName: Publish test results
91+
inputs:
92+
testRunner: VSTest
93+
testResultsFiles: '**/*.trx'
94+
failTaskOnFailedTests: true
95+
- task: PowerShell@2
96+
displayName: Assert release configuration
97+
inputs:
98+
targetType: inline
99+
pwsh: true
100+
script: |
101+
$assembly = [Reflection.Assembly]::LoadFile("$(Build.SourcesDirectory)/module/PowerShellEditorServices/bin/Core/Microsoft.PowerShell.EditorServices.Hosting.dll")
102+
if ($assembly.GetCustomAttributes([System.Diagnostics.DebuggableAttribute], $true).IsJITOptimizerDisabled) {
103+
Write-Host "##vso[task.LogIssue type=error;]Was not built in release configuration!"
104+
exit 1
105+
}
106+
- task: onebranch.pipeline.signing@1
107+
displayName: Sign 1st-party files
108+
inputs:
109+
command: sign
110+
signing_environment: external_distribution
111+
search_root: $(Build.SourcesDirectory)/module
112+
files_to_sign: |
113+
**/*.ps1;
114+
**/*.psd1;
115+
**/*.psm1;
116+
**/*.ps1xml;
117+
**/Microsoft.PowerShell.EditorServices*.dll;
118+
!Plaster/*;
119+
- task: onebranch.pipeline.signing@1
120+
displayName: Sign 3rd-party files
121+
inputs:
122+
command: sign
123+
signing_environment: 135020002
124+
search_root: $(Build.SourcesDirectory)/module
125+
files_to_sign: |
126+
**/MediatR.dll;
127+
**/Nerdbank.Streams.dll;
128+
**/Newtonsoft.Json.dll;
129+
**/OmniSharp.Extensions*.dll;
130+
**/Serilog*.dll;
131+
**/System.Reactive.dll;
132+
Plaster/**/*.ps1;
133+
Plaster/**/*.psd1;
134+
Plaster/**/*.psm1;
135+
- stage: release
136+
dependsOn: build
137+
variables:
138+
version: $[ stageDependencies.build.main.outputs['package.version'] ]
139+
drop: $(Pipeline.Workspace)/drop_build_main
140+
jobs:
141+
- job: validation
142+
displayName: Manual validation
143+
pool:
144+
type: agentless
145+
timeoutInMinutes: 1440
146+
steps:
147+
- task: ManualValidation@0
148+
displayName: Wait 24 hours for validation
149+
inputs:
150+
notifyUsers: $(Build.RequestedForEmail)
151+
instructions: Please validate the release
152+
timeoutInMinutes: 1440
153+
- job: github
154+
dependsOn: validation
155+
displayName: Publish draft to GitHub
156+
pool:
157+
type: windows
158+
variables:
159+
ob_outputDirectory: $(Build.SourcesDirectory)/out
160+
steps:
161+
- download: current
162+
displayName: Download artifacts
163+
- task: ArchiveFiles@2
164+
displayName: Zip signed artifacts
165+
inputs:
166+
rootFolderOrFile: $(drop)
167+
includeRootFolder: false
168+
archiveType: zip
169+
archiveFile: out/PowerShellEditorServices.zip
170+
- task: GitHubRelease@1
171+
displayName: Create GitHub release
172+
inputs:
173+
gitHubConnection: GitHub
174+
repositoryName: PowerShell/PowerShellEditorServices
175+
assets: out/PowerShellEditorServices.zip
176+
tagSource: userSpecifiedTag
177+
tag: v$(version)
178+
isDraft: true
179+
addChangeLog: false
180+
releaseNotesSource: inline
181+
releaseNotesInline: |
182+
# TODO: Generate release notes on GitHub!

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

-45
This file was deleted.

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

-68
This file was deleted.

.vsts-ci/misc-analysis.yml

-20
This file was deleted.

0 commit comments

Comments
 (0)