Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit 94d6231

Browse files
authoredApr 3, 2024
Multiple fixes in official build pipeline (PowerShell#21408)
1 parent dafe0a8 commit 94d6231

File tree

7 files changed

+40
-27
lines changed

7 files changed

+40
-27
lines changed
 

‎.config/tsaoptions.json

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,11 @@
11
{
22
"instanceUrl": "https://msazure.visualstudio.com",
33
"projectName": "One",
4-
"areaPath": "One\\MGMT\\Compute\\Powershell\\Powershell\\PowerShell Core"
4+
"areaPath": "One\\MGMT\\Compute\\Powershell\\Powershell\\PowerShell Core",
5+
"notificationAliases": [
6+
"adityap@microsoft.com",
7+
"dongbow@microsoft.com",
8+
"pmeinecke@microsoft.com",
9+
"tplunk@microsoft.com"
10+
]
511
}

‎.pipelines/PowerShell-Coordinated_Packages-Official.yml

Lines changed: 2 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,5 @@
11
name: UnifiedPackageBuild-$(Build.BuildId)
2-
trigger:
3-
branches:
4-
include:
5-
- master
6-
- release*
7-
pr:
8-
branches:
9-
include:
10-
- master
11-
- release*
2+
trigger: none
123

134
parameters:
145
- name: ForceAzureBlobDelete
@@ -194,7 +185,7 @@ extends:
194185
parameters:
195186
Architecture: x64
196187
BuildConfiguration: minSize
197-
JobName: build_windows_x64_minSize
188+
JobName: build_windows_x64_minSize_release
198189
- template: /.pipelines/templates/windows-hosted-build.yml@self
199190
parameters:
200191
Architecture: x86

‎.pipelines/templates/insert-nuget-config-azfeed.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ steps:
55
- pwsh: |
66
$configPath = "${env:NugetConfigDir}/nuget.config"
77
Import-Module ${{ parameters.repoRoot }}/build.psm1 -Force
8-
New-NugetConfigFile -NugetFeedUrl $(AzDevOpsFeed) -UserName $(AzDevOpsFeedUserName) -ClearTextPAT $(AzDevOpsFeedPAT2) -FeedName AzDevOpsFeed -Destination "${env:NugetConfigDir}"
8+
New-NugetConfigFile -NugetFeedUrl $(PowerShellCore_PublicPackages) -UserName $(AzDevOpsFeedUserName) -ClearTextPAT $(AzDevOpsFeedUserName) -FeedName AzDevOpsFeed -Destination "${env:NugetConfigDir}"
99
if(-not (Test-Path $configPath))
1010
{
1111
throw "nuget.config is not created"
@@ -20,7 +20,7 @@ steps:
2020
- pwsh: |
2121
$configPath = "${env:NugetConfigDir}/nuget.config"
2222
Import-Module ${{ parameters.repoRoot }}/build.psm1 -Force
23-
New-NugetConfigFile -NugetFeedUrl $(PSInternalNugetFeed) -UserName $(PSInternalNugetFeedUserName) -ClearTextPAT $(PSInternalNugetFeedPAT) -FeedName AzDevOpsFeed -Destination "${env:NugetConfigDir}"
23+
New-NugetConfigFile -NugetFeedUrl $(PowerShellCore_PublicPackages) -UserName $(AzDevOpsFeedUserName) -ClearTextPAT $(AzDevOpsFeedUserName) -FeedName AzDevOpsFeed -Destination "${env:NugetConfigDir}"
2424
if(-not (Test-Path $configPath))
2525
{
2626
throw "nuget.config is not created"

‎.pipelines/templates/linux.yml

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ jobs:
2727
value: $(Build.SourcesDirectory)\PowerShell\.config\tsaoptions.json
2828
- name: ob_sdl_credscan_suppressionsFile
2929
value: $(Build.SourcesDirectory)\PowerShell\.config\suppress.json
30-
- name: BuildConfiguration
30+
- name: BUILDCONFIGURATION
3131
value: ${{ parameters.BuildConfiguration }}
3232
- name: Runtime
3333
value: ${{ parameters.Runtime }}
@@ -66,7 +66,8 @@ jobs:
6666
$runtime = $env:RUNTIME
6767
6868
$params = @{}
69-
if ($env:BuildConfiguration -eq 'minSize') {
69+
if ($env:BUILDCONFIGURATION -eq 'minSize') {
70+
Write-Verbose -Message "Building for minimal size"
7071
$params['ForMinimalSize'] = $true
7172
}
7273
@@ -78,6 +79,11 @@ jobs:
7879
$null = New-Item -ItemType Directory -Path $buildWithSymbolsPath -Force -Verbose
7980
Start-PSBuild -Runtime $runtime -Configuration Release -Output $buildWithSymbolsPath @params -Clean -PSModuleRestore
8081
82+
$outputPath = Join-Path '$(ob_outputDirectory)' 'psoptions'
83+
$null = New-Item -ItemType Directory -Path $outputPath -Force
84+
$psOptPath = "$outputPath/psoptions.json"
85+
Save-PSOptions -PSOptionsPath $psOptPath
86+
8187
Write-Verbose -Verbose "Verifying pdbs exist in build folder"
8288
$pdbs = Get-ChildItem -Path $buildWithSymbolsPath -Recurse -Filter *.pdb
8389
if ($pdbs.Count -eq 0) {
@@ -90,7 +96,7 @@ jobs:
9096
}
9197
}
9298
93-
Write-Verbose -Verbose "Completed building PowerShell for '$env:BuildConfiguration' configuration"
99+
Write-Verbose -Verbose "Completed building PowerShell for '$env:BUILDCONFIGURATION' configuration"
94100
displayName: 'Build Linux - $(Runtime)'
95101
env:
96102
__DOTNET_RUNTIME_FEED_KEY: $(RUNTIME_SOURCEFEED_KEY)

‎.pipelines/templates/mac.yml

Lines changed: 14 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,17 @@ jobs:
5454
$env:AzDevOpsFeedPAT2 = '$(AzDevOpsFeedPAT2)'
5555
# Add -SkipReleaseChecks as a mitigation to unblock release.
5656
# macos-10.15 does not allow creating a folder under root. Hence, moving the folder.
57-
$(Build.SourcesDirectory)/tools/releaseBuild/macOS/PowerShellPackageVsts.ps1 -ReleaseTag $(ReleaseTagVar) -Destination $(System.ArtifactsDirectory) -Symbols -location $(PowerShellRoot) -Build -ArtifactName macosBinResults -Runtime 'osx-${{ parameters.buildArchitecture }}' -SkipReleaseChecks
57+
58+
Import-Module ./build.psm1 -Force
59+
Start-PSBuild -Runtime 'osx-${{ parameters.buildArchitecture }}' -Configuration Release -PSModuleRestore -Clean -Output $(OB_OUTPUTDIRECTORY)
60+
$artifactName = "macosBinResults-${{ parameters.buildArchitecture }}"
61+
62+
$psOptPath = "$(OB_OUTPUTDIRECTORY)/psoptions.json"
63+
Save-PSOptions -PSOptionsPath $psOptPath
64+
65+
# Since we are using custom pool for macOS, we need to use artifact.upload to publish the artifacts
66+
Write-Host "##vso[artifact.upload containerfolder=$artifactName;artifactname=$artifactName]$(OB_OUTPUTDIRECTORY)"
67+
5868
$env:AzDevOpsFeedPAT2 = $null
5969
displayName: 'Build'
6070
env:
@@ -84,7 +94,7 @@ jobs:
8494
- name: ob_sdl_codeql_compiled_enabled
8595
value: false
8696
- name: ob_sdl_sbom_packageName
87-
value: 'Microsoft.Powershell.Windows.${{parameters.buildArchitecture}}'
97+
value: 'Microsoft.Powershell.MacOS.${{parameters.buildArchitecture}}'
8898

8999
steps:
90100
- checkout: self
@@ -100,7 +110,7 @@ jobs:
100110

101111
- task: DownloadPipelineArtifact@2
102112
inputs:
103-
artifact: 'macosBinResults'
113+
artifact: 'macosBinResults-$(BuildArchitecture)'
104114
path: '$(Pipeline.Workspace)\Symbols'
105115
displayName: Download build
106116

@@ -115,12 +125,7 @@ jobs:
115125
Write-Host "sending.. vso[task.setvariable variable=Runtime]$runtime"
116126
Write-Host "##vso[task.setvariable variable=Runtime]$runtime"
117127
118-
$zipPath = Get-Item '$(Pipeline.Workspace)\Symbols\*symbol*${{ parameters.buildArchitecture }}*.zip' -Verbose
119-
Write-Verbose -Verbose "Zip Path: $zipPath"
120-
121-
$expandedFolder = $zipPath.BaseName
122-
Expand-Archive -Path $zipPath -Destination "$(Pipeline.Workspace)\$expandedFolder" -Force
123-
$rootPath = "$(Pipeline.Workspace)\$expandedFolder"
128+
$rootPath = "$(Pipeline.Workspace)\Symbols"
124129
Write-Verbose -Verbose "Setting vso[task.setvariable variable=DropRootPath]$rootPath"
125130
Write-Host "##vso[task.setvariable variable=DropRootPath]$rootPath"
126131
displayName: Expand symbols zip

‎.pipelines/templates/windows-hosted-build.yml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -89,6 +89,11 @@ jobs:
8989
$null = New-Item -ItemType Directory -Path $buildWithSymbolsPath -Force -Verbose
9090
Start-PSBuild -Runtime $runtime -Configuration Release -Output $buildWithSymbolsPath -Clean -PSModuleRestore @params
9191
92+
$outputPath = Join-Path '$(ob_outputDirectory)' 'psoptions'
93+
$null = New-Item -ItemType Directory -Path $outputPath -Force
94+
$psOptPath = "$outputPath/psoptions.json"
95+
Save-PSOptions -PSOptionsPath $psOptPath
96+
9297
Write-Verbose -Verbose "Verifying pdbs exist in build folder"
9398
$pdbs = Get-ChildItem -Path $buildWithSymbolsPath -Recurse -Filter *.pdb
9499
if ($pdbs.Count -eq 0) {

‎src/System.Management.Automation/SourceGenerators/PSVersionInfoGenerator/PSVersionInfoGenerator.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,6 @@
1515

1616
<ItemGroup>
1717
<PackageReference Include="Microsoft.CodeAnalysis.CSharp" Version="4.9.2" PrivateAssets="all" />
18-
<PackageReference Include="Microsoft.CodeAnalysis.Analyzers" Version="3.11.0-beta1.24154.1" PrivateAssets="all" />
18+
<PackageReference Include="Microsoft.CodeAnalysis.Analyzers" Version="3.11.0-beta1.24122.1" PrivateAssets="all" />
1919
</ItemGroup>
2020
</Project>

0 commit comments

Comments
 (0)
Please sign in to comment.