Skip to content

Commit

Permalink
Fix OneBranch pipeline
Browse files Browse the repository at this point in the history
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-`).
  • Loading branch information
andyleejordan committed Apr 3, 2024
1 parent ea8d715 commit d787187
Show file tree
Hide file tree
Showing 2 changed files with 29 additions and 14 deletions.
31 changes: 19 additions & 12 deletions .pipelines/vscode-powershell-Official.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,16 +27,12 @@ resources:
type: git
name: OneBranch.Pipelines/GovernedTemplates
ref: refs/heads/main
- repository: PowerShellEditorServices
type: git
name: PowerShellEditorServices
ref: release
pipelines:
- pipeline: PowerShellEditorServices-Official
source: PowerShellEditorServices-Official
trigger:
branches:
- release
- main

extends:
# https://aka.ms/obpipelines/templates
Expand Down Expand Up @@ -126,16 +122,14 @@ extends:
ob_outputDirectory: $(Build.SourcesDirectory)/out
skipComponentGovernanceDetection: true
steps:
- checkout: self
- checkout: PowerShellEditorServices
- task: UseNode@1
displayName: Use Node 18.x
inputs:
version: 18.x
- task: npmAuthenticate@0
displayName: Authenticate NPM with Azure Artifacts
inputs:
workingFile: vscode-powershell/.npmrc
workingFile: .npmrc
- task: UseDotNet@2
displayName: Use .NET 8.x SDK
inputs:
Expand All @@ -145,10 +139,23 @@ extends:
displayName: Install PSResources
inputs:
pwsh: true
filePath: vscode-powershell/tools/installPSResources.ps1
filePath: tools/installPSResources.ps1
- task: DownloadPipelineArtifact@2
displayName: Download PowerShellEditorServices
inputs:
source: specific
project: PowerShellCore
definition: 2905
specificBuildWithTriggering: true
artifact: drop_release_github
itemPattern: PowerShellEditorServices.zip
- task: ExtractFiles@1
displayName: Extract PowerShellEditorServices module
inputs:
archiveFilePatterns: $(Pipeline.Workspace)/PowerShellEditorServices.zip
destinationFolder: $(Build.SourcesDirectory)/modules
- pwsh: Invoke-Build Test -Configuration $(BuildConfiguration)
displayName: Run tests
workingDirectory: vscode-powershell
- stage: release
dependsOn: build
variables:
Expand All @@ -171,7 +178,7 @@ extends:
inputs:
gitHubConnection: GitHub
repositoryName: PowerShell/vscode-powershell
assets: $(drop)/vscode-powershell-$(vsixVersion).vsix
assets: $(drop)/powershell-$(vsixVersion).vsix
tagSource: userSpecifiedTag
tag: v$(version)
isDraft: true
Expand Down Expand Up @@ -214,7 +221,7 @@ extends:
'--pat'
'$(token)'
'--packagePath'
'$(drop)/vscode-powershell-$(vsixVersion).vsix'
'$(drop)/powershell-$(vsixVersion).vsix'
if ([bool]::Parse('$(prerelease)')) { '--pre-release' }
)
npm run publish -- @publishArgs
Expand Down
12 changes: 10 additions & 2 deletions docs/development.md
Original file line number Diff line number Diff line change
Expand Up @@ -52,20 +52,24 @@ For more information on contributing snippets please read our
These are the current steps for creating a release for both the editor services
and the extension. Azure DevOps access is restricted to Microsoft employees and
is used to sign and validate the produced binaries before publishing on behalf
of Microsoft.
of Microsoft. Assume `origin` is GitHub and `ado` is Azure DevOps.

```powershell
cd ./PowerShellEditorServices
git checkout -B release
./tools/updateVersion.ps1 -Version "4.0.0" -Changes "Major release!"
git push --force-with-lease origin
git push ado HEAD:main
cd ../vscode-powershell
git checkout -B release
./tools/updateVersion.ps1 -Version "2024.4.0" -Changes "Major release!"
git push --force-with-lease origin
git push ado HEAD:main
```

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

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

### Versioning

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

0 comments on commit d787187

Please sign in to comment.