-
Notifications
You must be signed in to change notification settings - Fork 513
Pipeline-ify entire release process #3461
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
11 commits
Select commit
Hold shift + click to select a range
18c3732
Fix bug in `ReleaseTools` with `Confirm` in CI
andyleejordan b3353c0
Replace `ResolveEditorServicesPath` task with `Get-EditorServicesPath…
andyleejordan 23e9a2f
Setup to use `release` branches for ADO
andyleejordan 1e933f1
Add `setupReleaseTools.ps1` script
andyleejordan 2302950
Small cleanups
andyleejordan c6928b0
Remove PowerShell daily from CI
andyleejordan cb63102
Fix side effect logic in `ReleaseTools` module
andyleejordan 5d76418
Improve build script
andyleejordan 660ab45
Cleanup miscellaneous build
andyleejordan a987d4d
Make CI build template actually generic
andyleejordan 35704b8
Pipeline-ify release process
andyleejordan File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,21 +1,40 @@ | ||
name: PR-$(System.PullRequest.PullRequestNumber)-$(Date:yyyyMMdd)$(Rev:.rr) | ||
|
||
trigger: | ||
# Batch merge builds together while a merge build is running | ||
batch: true | ||
branches: | ||
include: | ||
- master | ||
- legacy/1.x | ||
|
||
pr: | ||
branches: | ||
include: | ||
- master | ||
- legacy/1.x | ||
- master | ||
|
||
resources: | ||
- repo: self | ||
clean: true | ||
repositories: | ||
- repository: ComplianceRepo | ||
type: github | ||
endpoint: GitHub | ||
name: PowerShell/compliance | ||
|
||
jobs: | ||
- template: templates/credscan.yml | ||
- job: Compliance | ||
pool: | ||
vmImage: windows-latest | ||
steps: | ||
- checkout: self | ||
- checkout: ComplianceRepo | ||
- template: ci-compliance.yml@ComplianceRepo | ||
# NOTE: This enables our project to work with Visual Studio's Rich Navigation: | ||
# https://visualstudio.microsoft.com/services/rich-code-navigation/ | ||
- job: RichCodeNav | ||
pool: | ||
vmImage: windows-latest | ||
steps: | ||
# TODO: Move to GitHub Action | ||
- task: RichCodeNavIndexer@0 | ||
continueOnError: true | ||
inputs: | ||
serviceConnection: rich-nav | ||
nugetServiceConnection: rich-nav-nuget | ||
githubServiceConnection: PowerShell | ||
languages: typescript,csharp | ||
serviceEndpoint: https://prod.richnav.vsengsaas.visualstudio.com |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,55 +1,57 @@ | ||
parameters: | ||
- name: usePipelineArtifact | ||
type: boolean | ||
default: false | ||
|
||
steps: | ||
# Setup | ||
- powershell: | | ||
Write-Host "Installing PowerShell Daily..." | ||
|
||
# Use `AGENT_TEMPDIRECTORY` to make sure the downloaded PowerShell is cleaned up. | ||
$powerShellPath = Join-Path -Path $env:AGENT_TEMPDIRECTORY -ChildPath 'powershell' | ||
Invoke-WebRequest -Uri https://aka.ms/install-powershell.ps1 -OutFile ./install-powershell.ps1 | ||
|
||
./install-powershell.ps1 -Destination $powerShellPath -Daily | ||
|
||
# Using `prependpath` to update the PATH just for this build. | ||
Write-Host "##vso[task.prependpath]$powerShellPath" | ||
continueOnError: true | ||
displayName: Install PowerShell Daily | ||
|
||
- pwsh: '$PSVersionTable' | ||
displayName: Display PowerShell version information | ||
|
||
- pwsh: Write-Host "##vso[build.updatebuildnumber]$env:BUILD_SOURCEBRANCHNAME-$env:BUILD_SOURCEVERSION-$((get-date).ToString("yyyyMMddhhmmss"))" | ||
displayName: Set Build Name for Non-PR | ||
condition: ne(variables['Build.Reason'], 'PullRequest') | ||
|
||
# TODO: Use a submodule or some such so we can actually track a version here. | ||
- pwsh: | | ||
git clone https://github.com/PowerShell/PowerShellEditorServices.git ../PowerShellEditorServices | ||
Install-Module InvokeBuild -Scope CurrentUser -Force | ||
Install-Module PlatyPS -Scope CurrentUser -Force | ||
New-Item -ItemType Directory $(Build.ArtifactStagingDirectory)/vscode-powershell | ||
|
||
# Build | ||
- pwsh: Invoke-Build | ||
|
||
- task: PublishTestResults@2 | ||
inputs: | ||
testRunner: JUnit | ||
testResultsFiles: '**/test-results.xml' | ||
condition: succeededOrFailed() | ||
|
||
- task: PublishBuildArtifacts@1 | ||
inputs: | ||
ArtifactName: vscode-powershell | ||
PathtoPublish: '$(Build.ArtifactStagingDirectory)/vscode-powershell' | ||
|
||
# Rich Navigation | ||
- task: RichCodeNavIndexer@0 | ||
# Note, for now, this is Windows only. | ||
condition: and(succeededOrFailed(), eq(variables['Agent.OS'], 'Windows_NT')) | ||
continueOnError: true | ||
inputs: | ||
serviceConnection: 'rich-nav' | ||
nugetServiceConnection: 'rich-nav-nuget' | ||
githubServiceConnection: 'PowerShell' | ||
languages: 'typescript,csharp' | ||
serviceEndpoint: 'https://prod.richnav.vsengsaas.visualstudio.com' | ||
- pwsh: $PSVersionTable | ||
displayName: PowerShell version | ||
|
||
- checkout: self | ||
|
||
# NOTE: We either checkout the Git repo for PowerShellEditorServices, or we | ||
# download a pre-built artifact from the triggering pipeline and extract it to | ||
# the modules folder. In this way we do not accidentally build a release of the | ||
# server from this pipeline. | ||
- checkout: PowerShellEditorServices | ||
condition: not(${{ parameters.usePipelineArtifact }}) | ||
|
||
- task: DownloadPipelineArtifact@2 | ||
condition: ${{ parameters.usePipelineArtifact }} | ||
displayName: Download PowerShellEditorServices | ||
inputs: | ||
source: specific | ||
project: PowerShellEditorServices | ||
pipeline: 36 | ||
preferTriggeringPipeline: true | ||
allowPartiallySucceededBuilds: true | ||
artifact: PowerShellEditorServices | ||
|
||
- task: ExtractFiles@1 | ||
condition: ${{ parameters.usePipelineArtifact }} | ||
displayName: Extract PowerShellEditorServices module | ||
inputs: | ||
archiveFilePatterns: $(Pipeline.Workspace)/PowerShellEditorServices.zip | ||
destinationFolder: $(Build.SourcesDirectory)/vscode-powershell/modules | ||
|
||
- pwsh: | | ||
Install-Module InvokeBuild -Scope CurrentUser -Force | ||
Invoke-Build | ||
Write-Host "##vso[task.setvariable variable=vsixPath]$(Resolve-Path powershell-*.vsix)" | ||
displayName: Build and test | ||
workingDirectory: $(Build.SourcesDirectory)/vscode-powershell | ||
|
||
- publish: $(vsixPath) | ||
artifact: vscode-powershell-vsix-$(System.JobId) | ||
displayName: Publish extension artifact | ||
|
||
- publish: $(Build.SourcesDirectory)/vscode-powershell/scripts/Install-VSCode.ps1 | ||
artifact: vscode-powershell-unsigned-script-$(System.JobId) | ||
displayName: Publish unsigned script artifact | ||
|
||
- task: PublishTestResults@2 | ||
displayName: Publish test results | ||
inputs: | ||
testRunner: JUnit | ||
testResultsFiles: '**/test-results.xml' | ||
condition: succeededOrFailed() |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
steps: | ||
- checkout: self | ||
|
||
- download: current | ||
artifact: vscode-powershell | ||
displayName: Download signed artifacts | ||
|
||
- pwsh: | | ||
$(Build.SourcesDirectory)/tools/setupReleaseTools.ps1 -Token $(GitHubToken) | ||
New-DraftRelease -RepositoryName vscode-powershell -Assets $(Pipeline.Workspace)/vscode-powershell/powershell-*.vsix,$(Pipeline.Workspace)/vscode-powershell/Install-VSCode.ps1 | ||
displayName: Drafting a GitHub Release |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
steps: | ||
- checkout: self | ||
|
||
- download: current | ||
artifact: vscode-powershell | ||
displayName: Download signed artifacts | ||
|
||
- pwsh: | | ||
npm install -g vsce | ||
vsce publish --packagePath $(Pipeline.Workspace)/powershell-*.vsix --pat $(VsceToken) | ||
andyleejordan marked this conversation as resolved.
Show resolved
Hide resolved
|
||
displayName: Publishing VSIX to VS Code Marketplace | ||
|
||
# NOTE: We rarely update this script, so we can ignore errors from the gallery | ||
# caused by us trying to re-publish an updated script. | ||
- pwsh: | | ||
Publish-Script -Path $(Pipeline.Workspace)/Install-VSCode.ps1 -ErrorAction Continue -NuGetApiKey $(GalleryToken) | ||
displayName: Publishing Install-VSCode.ps1 to PowerShell Gallery |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.