Skip to content

Commit f5b94aa

Browse files
committed
Fix release build
A backlog task of removing the `findPsesBuild` script and associated logic caused us to end up with a release with the wrong artifacts. The tagged PSES build was partially succeeded, which the download task then ignored as the trigger, and instead of failing, fell back to this script which gave it the latest fully succeeded build. That PSES build was only partially successful because the "Install PowerShell Daily" step failed due to a transient network error, and so this was intentionally ignored as it did not affect the build. Or so we thought.
1 parent 8d207e6 commit f5b94aa

File tree

6 files changed

+18
-118
lines changed

6 files changed

+18
-118
lines changed

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

-18
Original file line numberDiff line numberDiff line change
@@ -13,24 +13,6 @@ trigger:
1313
branches:
1414
include:
1515
- master
16-
- legacy/1.x
17-
paths:
18-
exclude:
19-
- /.dependabot/*
20-
- /.poshchan/*
21-
- /.github/**/*
22-
- /.vscode/**/*
23-
- /.vsts-ci/misc-analysis.yml
24-
- /tools/**/*
25-
- .editorconfig
26-
- .gitattributes
27-
- .gitignore
28-
- /docs/**/*
29-
- /CHANGELOG.md
30-
- /CONTRIBUTING.md
31-
- /README.md
32-
- /LICENSE
33-
- /CODE_OF_CONDUCT.md
3416

3517
jobs:
3618
- job: Windows

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

+7-26
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
name: PR-$(System.PullRequest.PullRequestNumber)-$(Date:yyyyMMdd)$(Rev:.rr)
2-
31
variables:
42
# Don't download unneeded packages
53
- name: DOTNET_SKIP_FIRST_TIME_EXPERIENCE
@@ -9,47 +7,30 @@ variables:
97
value: 'true'
108

119
trigger:
12-
batch: true
1310
branches:
1411
include:
1512
- master
16-
- legacy/1.x
17-
paths:
18-
exclude:
19-
- /.dependabot/*
20-
- /.poshchan/*
21-
- /.github/**/*
22-
- /.vscode/**/*
23-
- /.vsts-ci/misc-analysis.yml
24-
- /tools/**/*
25-
- .editorconfig
26-
- .gitattributes
27-
- .gitignore
28-
- /docs/**/*
29-
- /CHANGELOG.md
30-
- /CONTRIBUTING.md
31-
- /README.md
32-
- /LICENSE
33-
- /CODE_OF_CONDUCT.md
13+
- release/*
3414

3515
resources:
3616
repositories:
3717
- repository: ComplianceRepo
3818
type: github
3919
endpoint: ComplianceGHRepo
4020
name: PowerShell/Compliance
21+
- repository: self
22+
ref: refs/tags/*
4123
pipelines:
4224
- pipeline: PowerShellEditorServices
4325
source: PowerShellEditorServices
4426
trigger:
4527
branches:
46-
- master
47-
- releases/*
48-
- changelog*
49-
- refs/tags/*
28+
include:
29+
- release/*
30+
tags:
31+
- v*
5032

5133
jobs:
52-
5334
- job: 'ReleaseBuild'
5435
displayName: 'Build release'
5536
pool:

.vsts-ci/templates/ci-general.yml

+9-7
Original file line numberDiff line numberDiff line change
@@ -13,33 +13,35 @@ steps:
1313
Write-Host "##vso[task.prependpath]$powerShellPath"
1414
continueOnError: true
1515
displayName: Install PowerShell Daily
16+
1617
- pwsh: '$PSVersionTable'
1718
displayName: Display PowerShell version information
19+
1820
- pwsh: Write-Host "##vso[build.updatebuildnumber]$env:BUILD_SOURCEBRANCHNAME-$env:BUILD_SOURCEVERSION-$((get-date).ToString("yyyyMMddhhmmss"))"
1921
displayName: Set Build Name for Non-PR
2022
condition: ne(variables['Build.Reason'], 'PullRequest')
21-
- task: PowerShell@2
22-
displayName: 'Set environment variables for VSTS (Phase 1)'
23-
inputs:
24-
targetType: filePath
25-
filePath: ./tools/releaseBuild/setVstsVariables.ps1
23+
24+
# TODO: Use a submodule or some such so we can actually track a version here.
2625
- pwsh: |
27-
Write-Host "Cloning '$env:PSES_BRANCH' branch from '$env:PSES_FORK/PowerShellEditorServices'"
28-
git clone --single-branch --branch $env:PSES_BRANCH https://github.com/$env:PSES_FORK/PowerShellEditorServices.git ../PowerShellEditorServices
26+
git clone https://github.com/PowerShell/PowerShellEditorServices.git ..
2927
Install-Module InvokeBuild -Scope CurrentUser -Force
3028
Install-Module PlatyPS -Scope CurrentUser -Force
3129
New-Item -ItemType Directory $(Build.ArtifactStagingDirectory)/vscode-powershell
30+
3231
# Build
3332
- pwsh: Invoke-Build
33+
3434
- task: PublishTestResults@2
3535
inputs:
3636
testRunner: JUnit
3737
testResultsFiles: '**/test-results.xml'
3838
condition: succeededOrFailed()
39+
3940
- task: PublishBuildArtifacts@1
4041
inputs:
4142
ArtifactName: vscode-powershell
4243
PathtoPublish: '$(Build.ArtifactStagingDirectory)/vscode-powershell'
44+
4345
# Rich Navigation
4446
- task: RichCodeNavIndexer@0
4547
# Note, for now, this is Windows only.

.vsts-ci/templates/release-general.yml

+2-22
Original file line numberDiff line numberDiff line change
@@ -1,40 +1,20 @@
11
steps:
22
- checkout: self
33

4-
- pwsh: Write-Host "##vso[build.updatebuildnumber]$env:BUILD_SOURCEBRANCHNAME-$env:BUILD_SOURCEVERSION-$((get-date).ToString("yyyyMMddhhmmss"))"
5-
displayName: Set Build Name for Non-PR
6-
condition: ne(variables['Build.Reason'], 'PullRequest')
7-
84
- pwsh: |
95
Get-ChildItem -Path env:
106
displayName: Capture environment
117
condition: succeededOrFailed()
128

13-
# TODO: Use modern resources for these variables.
14-
- task: PowerShell@2
15-
displayName: 'Set environment variables for VSTS (Phase 1)'
16-
inputs:
17-
targetType: filePath
18-
filePath: ./vscode-powershell/tools/releaseBuild/setVstsVariables.ps1
19-
20-
# TODO: Remove this when satisfied with added trigger.
21-
- task: PowerShell@2
22-
displayName: 'Find PowerShellEditorServices build'
23-
env:
24-
SYSTEM_ACCESSTOKEN: $(System.AccessToken)
25-
inputs:
26-
targetType: filePath
27-
filePath: ./vscode-powershell/tools/releaseBuild/findPsesBuild.ps1
28-
299
- task: DownloadPipelineArtifact@2
30-
displayName: 'Download Artifacts from PowerShell Editor Services'
10+
displayName: 'Download Artifacts from PowerShellEditorServices'
3111
inputs:
3212
source: specific
3313
project: '8e2735c1-3674-408a-bcab-87f089ea29d5'
3414
pipeline: 1056
3515
preferTriggeringPipeline: true
3616
runVersion: specific
37-
runId: '$(PSES_BUILDID)'
17+
allowPartiallySucceededBuilds: true
3818
artifact: 'PowerShellEditorServices'
3919
path: '$(Build.SourcesDirectory)/PowerShellEditorServices/module/'
4020

tools/releaseBuild/findPsesBuild.ps1

-27
This file was deleted.

tools/releaseBuild/setVstsVariables.ps1

-18
This file was deleted.

0 commit comments

Comments
 (0)