/
githubmirror
/
PowerShell
Обзор
Документация
Войти
/
githubmirror
/
PowerShell
Код
Запросы
0
Пакеты
0
Релизы
0
Аналитика
Безопасность
master
.pipelines/templates/testartifacts.yml
138 строк
5 KB
Aditya Patwardhan
Use .NET SDK and NuGet feed early access for build, package and release pipelines (#27795)
10 авг 2026, 21:39
Не верифицирован
10 авг 2026, 21:39
9f74707
Код
Авторство
О чём код?
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 parameters: architecture: 'win-x64' - 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 parameters: architecture: 'linux-x64' - 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