mirror of
https://github.com/PowerShell/PowerShell
synced 2026-06-08 12:12:50 +00:00
Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com> Co-authored-by: TravisEz13 <10873629+TravisEz13@users.noreply.github.com> Co-authored-by: Travis Plunk (HE/HIM) <tplunk@ntdev.microsoft.com>
135 lines
4.8 KiB
YAML
135 lines
4.8 KiB
YAML
jobs:
|
|
- job: build_testartifacts_win
|
|
variables:
|
|
- name: NugetSecurityAnalysisWarningLevel
|
|
value: none
|
|
- group: DotNetPrivateBuildAccess
|
|
- name: ob_outputDirectory
|
|
value: '$(Build.ArtifactStagingDirectory)/ONEBRANCH_ARTIFACT'
|
|
- name: ob_sdl_tsa_configFile
|
|
value: $(Build.SourcesDirectory)\PowerShell\.config\tsaoptions.json
|
|
- name: ob_sdl_credscan_suppressionsFile
|
|
value: $(Build.SourcesDirectory)\PowerShell\.config\suppress.json
|
|
- name: ob_sdl_codeSignValidation_excludes
|
|
value: '-|**\*.ps1;-|**\*.psm1;-|**\*.ps1xml;-|**\*.psd1;-|**\*.exe;-|**\*.dll;-|**\*.cdxml'
|
|
|
|
displayName: Build windows test artifacts
|
|
condition: succeeded()
|
|
pool:
|
|
type: windows
|
|
steps:
|
|
- checkout: self
|
|
clean: true
|
|
env:
|
|
ob_restore_phase: true
|
|
|
|
- template: /.pipelines/templates/SetVersionVariables.yml@self
|
|
parameters:
|
|
ReleaseTagVar: $(ReleaseTagVar)
|
|
|
|
- template: /.pipelines/templates/insert-nuget-config-azfeed.yml@self
|
|
parameters:
|
|
repoRoot: $(RepoRoot)
|
|
ob_restore_phase: true
|
|
|
|
- template: /.pipelines/templates/install-dotnet.yml@self
|
|
|
|
- pwsh: |
|
|
New-Item -Path '$(ob_outputDirectory)' -ItemType Directory -Force
|
|
Import-Module $(Build.SourcesDirectory)/PowerShell/build.psm1
|
|
function BuildTestPackage([string] $runtime)
|
|
{
|
|
Write-Verbose -Verbose "Starting to build package for $runtime"
|
|
New-TestPackage -Destination $(System.ArtifactsDirectory) -Runtime $runtime
|
|
if (-not (Test-Path $(System.ArtifactsDirectory)/TestPackage.zip))
|
|
{
|
|
throw "Test Package was not found at: $(System.ArtifactsDirectory)"
|
|
}
|
|
switch ($runtime)
|
|
{
|
|
win7-x64 { $packageName = "TestPackage-win-x64.zip" }
|
|
win7-x86 { $packageName = "TestPackage-win-x86.zip" }
|
|
win-arm64 { $packageName = "TestPackage-win-arm64.zip" }
|
|
}
|
|
Rename-Item $(System.ArtifactsDirectory)/TestPackage.zip $packageName
|
|
## Write-Host "##vso[artifact.upload containerfolder=testArtifacts;artifactname=testArtifacts]$(System.ArtifactsDirectory)/$packageName"
|
|
|
|
Copy-Item -Path $(System.ArtifactsDirectory)/$packageName -Destination $(ob_outputDirectory) -Force -Verbose
|
|
}
|
|
BuildTestPackage -runtime win7-x64
|
|
BuildTestPackage -runtime win7-x86
|
|
BuildTestPackage -runtime win-arm64
|
|
displayName: Build test package and upload
|
|
retryCountOnTaskFailure: 1
|
|
env:
|
|
ob_restore_phase: true
|
|
|
|
- pwsh: |
|
|
Write-Host "This doesn't do anything but make the build phase run."
|
|
displayName: Dummy build task
|
|
|
|
|
|
- job: build_testartifacts_nonwin
|
|
variables:
|
|
- name: NugetSecurityAnalysisWarningLevel
|
|
value: none
|
|
- group: DotNetPrivateBuildAccess
|
|
- name: ob_outputDirectory
|
|
value: '$(Build.ArtifactStagingDirectory)/ONEBRANCH_ARTIFACT'
|
|
displayName: Build non-windows test artifacts
|
|
condition: succeeded()
|
|
pool:
|
|
type: linux
|
|
steps:
|
|
- checkout: self
|
|
clean: true
|
|
env:
|
|
ob_restore_phase: true
|
|
|
|
- template: /.pipelines/templates/SetVersionVariables.yml@self
|
|
parameters:
|
|
ReleaseTagVar: $(ReleaseTagVar)
|
|
|
|
- template: /.pipelines/templates/insert-nuget-config-azfeed.yml@self
|
|
parameters:
|
|
repoRoot: $(Build.SourcesDirectory)/PowerShell
|
|
ob_restore_phase: true
|
|
|
|
- template: /.pipelines/templates/install-dotnet.yml@self
|
|
|
|
- pwsh: |
|
|
New-Item -Path '$(ob_outputDirectory)' -ItemType Directory -Force
|
|
Import-Module $(Build.SourcesDirectory)/PowerShell/build.psm1
|
|
function BuildTestPackage([string] $runtime)
|
|
{
|
|
Write-Verbose -Verbose "Starting to build package for $runtime"
|
|
New-TestPackage -Destination $(System.ArtifactsDirectory) -Runtime $runtime
|
|
if (-not (Test-Path $(System.ArtifactsDirectory)/TestPackage.zip))
|
|
{
|
|
throw "Test Package was not found at: $(System.ArtifactsDirectory)"
|
|
}
|
|
switch ($runtime)
|
|
{
|
|
linux-x64 { $packageName = "TestPackage-linux-x64.zip" }
|
|
linux-arm { $packageName = "TestPackage-linux-arm.zip" }
|
|
linux-arm64 { $packageName = "TestPackage-linux-arm64.zip" }
|
|
osx-x64 { $packageName = "TestPackage-macOS.zip" }
|
|
linux-musl-x64 { $packageName = "TestPackage-alpine-x64.zip"}
|
|
}
|
|
Rename-Item $(System.ArtifactsDirectory)/TestPackage.zip $packageName
|
|
Copy-Item -Path $(System.ArtifactsDirectory)/$packageName -Destination $(ob_outputDirectory) -Force -Verbose
|
|
}
|
|
BuildTestPackage -runtime linux-x64
|
|
BuildTestPackage -runtime linux-arm
|
|
BuildTestPackage -runtime linux-arm64
|
|
BuildTestPackage -runtime osx-x64
|
|
BuildTestPackage -runtime linux-musl-x64
|
|
displayName: Build test package and upload
|
|
retryCountOnTaskFailure: 1
|
|
env:
|
|
ob_restore_phase: true
|
|
|
|
- pwsh: |
|
|
Write-Host "This doesn't do anything but make the build phase run."
|
|
displayName: Dummy build task
|