Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 7 additions & 3 deletions .pipelines/PowerShell-Release-Official.yml
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@ variables:
value: mcr.microsoft.com/onebranch/cbl-mariner/build:2.0
- name: ReleaseTagVar
value: ${{ parameters.ReleaseTagVar }}
- group: PoolNames

resources:
repositories:
Expand Down Expand Up @@ -111,19 +112,22 @@ extends:
parameters:
jobName: "windowsSDK"
displayName: "Windows SDK Validation"
jobtype: windows
imageName: PSMMS2019-Secure
poolName: $(windowsPool)

- template: /.pipelines/templates/release-validate-sdk.yml@self
parameters:
jobName: "MacOSSDK"
displayName: "MacOS SDK Validation"
jobtype: macos
imageName: macOS-latest
poolName: Azure Pipelines

- template: /.pipelines/templates/release-validate-sdk.yml@self
parameters:
jobName: "LinuxSDK"
displayName: "Linux SDK Validation"
jobtype: linux
imageName: PSMMSUbuntu20.04-Secure
poolName: $(ubuntuPool)

- stage: gbltool
displayName: 'Validate Global tools'
Expand Down
44 changes: 25 additions & 19 deletions .pipelines/templates/release-validate-sdk.yml
Original file line number Diff line number Diff line change
@@ -1,33 +1,35 @@
parameters:
jobName: ""
displayName: ""
jobtype: "windows"
poolName: "windows"
imageName: 'none'

jobs:
- job: ${{ parameters.jobName }}
displayName: ${{ parameters.displayName }}
pool:
${{ if eq(parameters.jobtype, 'macos') }}:
type: linux
isCustom: true
name: Azure Pipelines
vmImage: 'macOS-latest'
type: linux
isCustom: true
${{ if eq( parameters.poolName, 'Azure Pipelines') }}:
name: ${{ parameters.poolName }}
vmImage: ${{ parameters.imageName }}
${{ else }}:
type: ${{ parameters.jobtype }}
name: ${{ parameters.poolName }}
demands:
- ImageOverride -equals ${{ parameters.imageName }}

variables:
- group: AzDevOpsArtifacts
- group: DotNetPrivateBuildAccess
- name: ob_outputDirectory
value: '$(Build.ArtifactStagingDirectory)/ONEBRANCH_ARTIFACT'
- name: ob_sdl_credscan_suppressionsFile
value: $(Build.SourcesDirectory)\PowerShell\.config\suppress.json
- name: ob_sdl_tsa_configFile
value: $(Build.SourcesDirectory)\PowerShell\.config\tsaoptions.json

steps:
- checkout: self
clean: true
lfs: false

- template: /.pipelines/templates/insert-nuget-config-azfeed.yml@self
parameters:
repoRoot: "$(Build.SourcesDirectory)"

- template: release-SetReleaseTagandContainerName.yml@self

Expand All @@ -44,7 +46,7 @@ jobs:
displayName: 'Capture Downloaded Artifacts'

- pwsh: |
$repoRoot = $isMacOS ? "$(Build.SourcesDirectory)" : "$(Build.SourcesDirectory)/PowerShell"
$repoRoot = "$(Build.SourcesDirectory)"

$dotnetMetadataPath = "$repoRoot/DotnetRuntimeMetadata.json"
$dotnetMetadataJson = Get-Content $dotnetMetadataPath -Raw | ConvertFrom-Json
Expand Down Expand Up @@ -79,7 +81,7 @@ jobs:
__DOTNET_RUNTIME_FEED_KEY: $(RUNTIME_SOURCEFEED_KEY)

- pwsh: |
$repoRoot = $isMacOS ? "$(Build.SourcesDirectory)" : "$(Build.SourcesDirectory)/PowerShell"
$repoRoot = "$(Build.SourcesDirectory)"

$env:DOTNET_SKIP_FIRST_TIME_EXPERIENCE=1
Import-Module "$repoRoot/build.psm1" -Force
Expand All @@ -101,12 +103,17 @@ jobs:
Get-ChildItem

## register the packages download directory in the nuget file
$nugetConfigContent = Get-Content ./NuGet.Config -Raw
$nugetPath = './NuGet.Config'
if(!(test-path $nugetPath)) {
$nugetPath = "$repoRoot/nuget.config"
}
Write-Verbose -Verbose "nugetPath: $nugetPath"
$nugetConfigContent = Get-Content $nugetPath -Raw
$updateNugetContent = $nugetConfigContent.Replace("</packageSources>", $xmlElement)

$updateNugetContent | Out-File ./NuGet.Config -Encoding ascii
$updateNugetContent | Out-File $nugetPath -Encoding ascii

Get-Content ./NuGet.Config
Get-Content $nugetPath

# Add workaround to unblock xUnit testing see issue: https://github.com/dotnet/sdk/issues/26462
$dotnetPath = if ($IsWindows) { "$env:LocalAppData\Microsoft\dotnet" } else { "$env:HOME/.dotnet" }
Expand All @@ -115,7 +122,6 @@ jobs:
dotnet --info
dotnet restore
dotnet test /property:RELEASE_VERSION=$releaseVersion --test-adapter-path:. "--logger:xunit;LogFilePath=$(System.DefaultWorkingDirectory)/test-hosting.xml"

displayName: Restore and execute tests
env:
__DOTNET_RUNTIME_FEED_KEY: $(RUNTIME_SOURCEFEED_KEY)
Expand Down