Skip to content

Commit f3e1991

Browse files
committed
Migrate to DeployBox for release stage
1 parent b6e107d commit f3e1991

5 files changed

+39
-27
lines changed

.github/workflows/ci-test.yml

+1
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,7 @@ jobs:
3838
run: ./tools/installPSResources.ps1
3939

4040
- name: Download daily install script
41+
if: ${{ github.event_name == 'schedule' || github.event_name == 'merge_group' }}
4142
uses: actions/checkout@v4
4243
with:
4344
repository: PowerShell/PowerShell

.gitignore

+1-4
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,4 @@
11
bin/
22
obj/
3-
module/PowerShellEditorServices/NOTICE.txt
4-
module/PowerShellEditorServices/Commands/en-US/
5-
module/PSReadLine/
6-
module/PSScriptAnalyzer/
3+
module/
74
TestResults/

.pipelines/PowerShellEditorServices-Official.yml

+23-19
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,9 @@ extends:
5151
EnableCDPxPAT: false
5252
WindowsHostVersion:
5353
Version: 2022
54-
Network: Netlock
54+
Network: KS3
55+
release:
56+
category: NonAzure
5557
stages:
5658
- stage: build
5759
jobs:
@@ -60,7 +62,7 @@ extends:
6062
pool:
6163
type: windows
6264
variables:
63-
ob_outputDirectory: $(Build.SourcesDirectory)/module
65+
ob_outputDirectory: $(Build.SourcesDirectory)/out
6466
steps:
6567
- pwsh: |
6668
[xml]$xml = Get-Content PowerShellEditorServices.Common.props
@@ -88,9 +90,10 @@ extends:
8890
version: 6.x
8991
- pwsh: |
9092
Register-PSRepository -Name CFS -SourceLocation "https://pkgs.dev.azure.com/powershell/PowerShell/_packaging/powershell/nuget/v2" -InstallationPolicy Trusted
91-
Install-Module -Repository CFS -Name InvokeBuild -RequiredVersion 5.11.3
92-
Install-Module -Repository CFS -Name platyPS -RequiredVersion 0.14.2
93-
Invoke-Build TestFull -Configuration $(BuildConfiguration) -PSRepository CFS
93+
Install-Module -Repository CFS -Name Microsoft.PowerShell.PSResourceGet
94+
./tools/installPSResources.ps1 -PSRepository CFS
95+
displayName: Install PSResources
96+
- pwsh: Invoke-Build TestFull -Configuration $(BuildConfiguration) -PSRepository CFS
9497
displayName: Build and test
9598
- task: PublishTestResults@2
9699
displayName: Publish test results
@@ -131,36 +134,37 @@ extends:
131134
**/OmniSharp.Extensions*.dll;
132135
**/Serilog*.dll;
133136
**/System.Reactive.dll;
137+
- task: ArchiveFiles@2
138+
displayName: Zip signed artifacts
139+
inputs:
140+
rootFolderOrFile: $(Build.SourcesDirectory)/module
141+
includeRootFolder: false
142+
archiveType: zip
143+
archiveFile: out/PowerShellEditorServices.zip
134144
- stage: release
135145
dependsOn: build
136146
condition: eq(variables['Build.Reason'], 'Manual')
137147
variables:
148+
ob_release_environment: Production
138149
version: $[ stageDependencies.build.main.outputs['package.version'] ]
139150
prerelease: $[ stageDependencies.build.main.outputs['package.prerelease'] ]
140-
drop: $(Pipeline.Workspace)/drop_build_main
141151
jobs:
142152
- job: github
143153
displayName: Publish draft to GitHub
144154
pool:
145-
type: windows
146-
variables:
147-
ob_outputDirectory: $(Build.SourcesDirectory)/out
148-
steps:
149-
- download: current
150-
displayName: Download artifacts
151-
- task: ArchiveFiles@2
152-
displayName: Zip signed artifacts
155+
type: release
156+
templateContext:
153157
inputs:
154-
rootFolderOrFile: $(drop)
155-
includeRootFolder: false
156-
archiveType: zip
157-
archiveFile: out/PowerShellEditorServices.zip
158+
- input: pipelineArtifact
159+
artifactName: drop_build_main
160+
steps:
158161
- task: GitHubRelease@1
159162
displayName: Create GitHub release
160163
inputs:
161164
gitHubConnection: GitHub
162165
repositoryName: PowerShell/PowerShellEditorServices
163-
assets: out/PowerShellEditorServices.zip
166+
target: main
167+
assets: $(Pipeline.Workspace)/PowerShellEditorServices.zip
164168
tagSource: userSpecifiedTag
165169
tag: v$(version)
166170
isDraft: true

PowerShellEditorServices.build.ps1

+4-2
Original file line numberDiff line numberDiff line change
@@ -147,8 +147,10 @@ Task AssembleModule -After Build {
147147
New-Item -Force -Path $dir -ItemType Directory | Out-Null
148148
}
149149

150-
# Copy third party notices to module folder
151-
Copy-Item -Force -Path "NOTICE.txt" -Destination $psesOutputPath
150+
# Copy documents to module root
151+
foreach ($document in @("LICENSE", "NOTICE.txt", "README.md", "SECURITY.md")) {
152+
Copy-Item -Force -Path $document -Destination "./module"
153+
}
152154

153155
# Assemble PSES module
154156
$includedDlls = [System.Collections.Generic.HashSet[string]]::new()

tools/installPSResources.ps1

+10-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,13 @@
11
# Copyright (c) Microsoft Corporation.
22
# Licensed under the MIT License.
3+
param(
4+
[ValidateSet("PSGallery", "CFS")]
5+
[string]$PSRepository = "PSGallery"
6+
)
37

4-
Install-PSResource -TrustRepository -Name InvokeBuild -Scope CurrentUser
5-
Install-PSResource -TrustRepository -Name platyPS -Scope CurrentUser
8+
if ($PSRepository -eq "CFS" -and -not (Get-PSResourceRepository -Name CFS -ErrorAction SilentlyContinue)) {
9+
Register-PSResourceRepository -Name CFS -Uri "https://pkgs.dev.azure.com/powershell/PowerShell/_packaging/powershell/nuget/v3/index.json"
10+
}
11+
12+
Install-PSResource -Repository $PSRepository -TrustRepository -Name InvokeBuild
13+
Install-PSResource -Repository $PSRepository -TrustRepository -Name platyPS

0 commit comments

Comments
 (0)