Skip to content

Commit

Permalink
Update azure-pipelines.yml
Browse files Browse the repository at this point in the history
  • Loading branch information
mattleibow committed Aug 8, 2024
1 parent f32ba47 commit 5990b22
Showing 1 changed file with 19 additions and 65 deletions.
84 changes: 19 additions & 65 deletions azure-pipelines.yml
Original file line number Diff line number Diff line change
@@ -1,67 +1,21 @@
pool:
vmImage: 'windows-latest'

stages:
- stage: A
jobs:
- job: A1
steps:
- checkout: none
- script: echo "hi" > $(Build.ArtifactStagingDirectory)\file1.txt
- task: PublishPipelineArtifact@1
inputs:
targetPath: '$(Build.ArtifactStagingDirectory)'
artifact: A1
- job: A2
steps:
- checkout: none
- script: echo "hi" > $(Build.ArtifactStagingDirectory)\file2.txt
- task: PublishPipelineArtifact@1
inputs:
targetPath: '$(Build.ArtifactStagingDirectory)'
artifact: A2
- job: A3
steps:
- checkout: none
- script: echo "hi" > $(Build.ArtifactStagingDirectory)\file3.txt
- task: PublishPipelineArtifact@1
inputs:
targetPath: '$(Build.ArtifactStagingDirectory)'
artifact: A3

- stage: B
dependsOn: A
variables:
jobsInStageA: $[ convertToJson(stageDependencies.A) ]
jobs:
- job: B1
steps:
- checkout: none
- pwsh: az devops configure --defaults organization=$(System.TeamFoundationCollectionUri) project=$(System.TeamProject) --use-git-aliases true
- pwsh: |
$test=@'
$(jobsInStageA)
'@
strategy:
matrix:
linux:
imageName: 'ubuntu-latest'
mac:
imageName: 'macos-latest'
windows:
imageName: 'windows-latest'

echo $test
$json = ConvertFrom-Json $test
$objects = $json | Get-Member -MemberType NoteProperty
$names = $objects | ForEach-Object { $json."$($_.Name)".name }
Write-Host "Found $($names.Length) items:"
$names | ForEach-Object { Write-Host " - $_" }
pool:
vmImage: $(imageName)

$dir = "$(Build.ArtifactStagingDirectory)"
$id = "$(Build.BuildId)"
foreach ($name in $names) {
Write-Host "Downloading '$name'..."
az pipelines runs artifact download --artifact-name "$name" --path "$dir" --run-id "$id"
}
Write-Host "Downloads complete."
env:
AZURE_DEVOPS_EXT_PAT: $(System.AccessToken)
- task: PublishPipelineArtifact@1
inputs:
targetPath: '$(Build.ArtifactStagingDirectory)'
artifact: merged
steps:
- pwsh: Get-PSDrive -PSProvider FileSystem
- task: UseDotNet@2
inputs:
version: '9.0.100-preview.7.24406.8'
includePreviewVersions: true
- pwsh: dotnet --info
- pwsh: dotnet workload install android ios macos tvos maccatalyst --skip-sign-check --from-rollback-file ./rollback.json --verbosity diag --configfile ./NuGet.config
- pwsh: Get-PSDrive -PSProvider FileSystem

0 comments on commit 5990b22

Please sign in to comment.