Skip to content

Commit d787187

Browse files
committed
Fix OneBranch pipeline
I mindlessly copied the old pipeline's logic and had it building from the Git repository. However, weirdly the NuGet authentication stopped working, and it was a better fix to test against the same artifact that we're going to release. We also have to release from the `main` branch due to _reasons_, and this was actually fortunate as I noticed I'd made a mistake with the VSIX artifact names (they're not prefixed with `vscode-`).
1 parent ea8d715 commit d787187

File tree

2 files changed

+29
-14
lines changed

2 files changed

+29
-14
lines changed

.pipelines/vscode-powershell-Official.yml

+19-12
Original file line numberDiff line numberDiff line change
@@ -27,16 +27,12 @@ resources:
2727
type: git
2828
name: OneBranch.Pipelines/GovernedTemplates
2929
ref: refs/heads/main
30-
- repository: PowerShellEditorServices
31-
type: git
32-
name: PowerShellEditorServices
33-
ref: release
3430
pipelines:
3531
- pipeline: PowerShellEditorServices-Official
3632
source: PowerShellEditorServices-Official
3733
trigger:
3834
branches:
39-
- release
35+
- main
4036

4137
extends:
4238
# https://aka.ms/obpipelines/templates
@@ -126,16 +122,14 @@ extends:
126122
ob_outputDirectory: $(Build.SourcesDirectory)/out
127123
skipComponentGovernanceDetection: true
128124
steps:
129-
- checkout: self
130-
- checkout: PowerShellEditorServices
131125
- task: UseNode@1
132126
displayName: Use Node 18.x
133127
inputs:
134128
version: 18.x
135129
- task: npmAuthenticate@0
136130
displayName: Authenticate NPM with Azure Artifacts
137131
inputs:
138-
workingFile: vscode-powershell/.npmrc
132+
workingFile: .npmrc
139133
- task: UseDotNet@2
140134
displayName: Use .NET 8.x SDK
141135
inputs:
@@ -145,10 +139,23 @@ extends:
145139
displayName: Install PSResources
146140
inputs:
147141
pwsh: true
148-
filePath: vscode-powershell/tools/installPSResources.ps1
142+
filePath: tools/installPSResources.ps1
143+
- task: DownloadPipelineArtifact@2
144+
displayName: Download PowerShellEditorServices
145+
inputs:
146+
source: specific
147+
project: PowerShellCore
148+
definition: 2905
149+
specificBuildWithTriggering: true
150+
artifact: drop_release_github
151+
itemPattern: PowerShellEditorServices.zip
152+
- task: ExtractFiles@1
153+
displayName: Extract PowerShellEditorServices module
154+
inputs:
155+
archiveFilePatterns: $(Pipeline.Workspace)/PowerShellEditorServices.zip
156+
destinationFolder: $(Build.SourcesDirectory)/modules
149157
- pwsh: Invoke-Build Test -Configuration $(BuildConfiguration)
150158
displayName: Run tests
151-
workingDirectory: vscode-powershell
152159
- stage: release
153160
dependsOn: build
154161
variables:
@@ -171,7 +178,7 @@ extends:
171178
inputs:
172179
gitHubConnection: GitHub
173180
repositoryName: PowerShell/vscode-powershell
174-
assets: $(drop)/vscode-powershell-$(vsixVersion).vsix
181+
assets: $(drop)/powershell-$(vsixVersion).vsix
175182
tagSource: userSpecifiedTag
176183
tag: v$(version)
177184
isDraft: true
@@ -214,7 +221,7 @@ extends:
214221
'--pat'
215222
'$(token)'
216223
'--packagePath'
217-
'$(drop)/vscode-powershell-$(vsixVersion).vsix'
224+
'$(drop)/powershell-$(vsixVersion).vsix'
218225
if ([bool]::Parse('$(prerelease)')) { '--pre-release' }
219226
)
220227
npm run publish -- @publishArgs

docs/development.md

+10-2
Original file line numberDiff line numberDiff line change
@@ -52,20 +52,24 @@ For more information on contributing snippets please read our
5252
These are the current steps for creating a release for both the editor services
5353
and the extension. Azure DevOps access is restricted to Microsoft employees and
5454
is used to sign and validate the produced binaries before publishing on behalf
55-
of Microsoft.
55+
of Microsoft. Assume `origin` is GitHub and `ado` is Azure DevOps.
5656

5757
```powershell
5858
cd ./PowerShellEditorServices
5959
git checkout -B release
6060
./tools/updateVersion.ps1 -Version "4.0.0" -Changes "Major release!"
61+
git push --force-with-lease origin
62+
git push ado HEAD:main
6163
6264
cd ../vscode-powershell
6365
git checkout -B release
6466
./tools/updateVersion.ps1 -Version "2024.4.0" -Changes "Major release!"
67+
git push --force-with-lease origin
68+
git push ado HEAD:main
6569
```
6670

6771
1. Amend changelogs as necessary.
68-
2. Push release branches to ADO and GitHub.
72+
2. Push `release` branches to GitHub and to Azure DevOps `main` branch.
6973
3. Download and test assets!
7074
4. Publish draft releases and merge (don't squash!) branches.
7175
5. Permit pipeline to publish to marketplace.
@@ -74,6 +78,10 @@ If rolling from pre-release to release, do not change the version of PowerShell
7478
Editor Services between a pre-release and the subsequent release! We only
7579
need to release the extension.
7680

81+
The Azure DevOps pipelines have to build off `main` branch for _reasons_,
82+
but we still want to use PRs. Hence pushing `release` to `main` and then
83+
merging (not squashing nor rebasing) those PRs so the commit stays the same.
84+
7785
### Versioning
7886

7987
For both our repositories we use Git tags in the form `vX.Y.Z` to mark the releases in the

0 commit comments

Comments
 (0)