From 54a8dd4583c5eaf793aa591f4fec0deab3c052e2 Mon Sep 17 00:00:00 2001 From: Eduardo Villalpando Mello Date: Fri, 31 Jan 2025 13:18:58 -0800 Subject: [PATCH 1/9] ci/cd mac loop architectures --- .vsts-ci.yml | 118 ++++++++++++++++------------------------------- .vsts-pr.yml | 127 +++++++++++++++++---------------------------------- 2 files changed, 83 insertions(+), 162 deletions(-) diff --git a/.vsts-ci.yml b/.vsts-ci.yml index b3dc815d..513e9757 100644 --- a/.vsts-ci.yml +++ b/.vsts-ci.yml @@ -119,82 +119,44 @@ extends: artifactName: 'drop-windows' publishLocation: 'Container' parallel: true - - job: OSX_latest_x64 - displayName: 'Mac OS (x64)' - pool: - name: Azure Pipelines - image: 'macOS-latest' - os: macOS - variables: - - name: _RID - value: osx-x64 - - name: _BuildConfig - value: Release - - name: _SignType - value: none - - name: _DotNetPublishToBlobFeed - value: false - steps: - - checkout: self - clean: true - - script: eng/common/cibuild.sh - --configuration $(_BuildConfig) - --prepareMachine - /p:RID=$(_RID) - displayName: Build - - task: ArchiveFiles@2 - condition: and(eq(variables['system.pullrequest.isfork'], false), eq(variables['_BuildConfig'], 'Release')) - inputs: - rootFolderOrFile: 'artifacts/layout/dotnet-core-uninstall/' - includeRootFolder: false - archiveType: 'tar' - tarCompression: 'gz' - archiveFile: '$(Build.ArtifactStagingDirectory)/dotnet-core-uninstall.tar.gz' - replaceExistingArchive: true - - task: 1ES.PublishBuildArtifacts@1 - condition: and(eq(variables['system.pullrequest.isfork'], false), eq(variables['_BuildConfig'], 'Release')) - inputs: - PathtoPublish: '$(Build.ArtifactStagingDirectory)' - artifactName: 'drop-osx' - publishLocation: 'Container' - parallel: true - - job: OSX_latest_arm64 - displayName: 'Mac OS (arm64)' - pool: - name: Azure Pipelines - image: 'macOS-latest' - os: macOS - variables: - - name: _RID - value: osx-arm64 - - name: _BuildConfig - value: Release - - name: _SignType - value: none - - name: _DotNetPublishToBlobFeed - value: false - steps: - - checkout: self - clean: true - - script: eng/common/cibuild.sh - --configuration $(_BuildConfig) - --prepareMachine - /p:RID=$(_RID) - displayName: Build - - task: ArchiveFiles@2 - condition: and(eq(variables['system.pullrequest.isfork'], false), eq(variables['_BuildConfig'], 'Release')) - inputs: - rootFolderOrFile: 'artifacts/layout/dotnet-core-uninstall/' - includeRootFolder: false - archiveType: 'tar' - tarCompression: 'gz' - archiveFile: '$(Build.ArtifactStagingDirectory)/dotnet-core-uninstall.tar.gz' - replaceExistingArchive: true - - task: 1ES.PublishBuildArtifacts@1 - condition: and(eq(variables['system.pullrequest.isfork'], false), eq(variables['_BuildConfig'], 'Release')) - inputs: - PathtoPublish: '$(Build.ArtifactStagingDirectory)' - artifactName: 'drop-osx' - publishLocation: 'Container' - parallel: true + - {{ each _RID in ['x64', 'arm64'] }} + - job: OSX_latest_${_RID} + displayName: 'Mac OS (${_RID})' + pool: + name: Azure Pipelines + image: 'macOS-latest' + os: macOS + variables: + - name: _RID + value: osx-${_RID} + - name: _BuildConfig + value: Release + - name: _SignType + value: none + - name: _DotNetPublishToBlobFeed + value: false + steps: + - checkout: self + clean: true + - script: eng/common/cibuild.sh + --configuration $(_BuildConfig) + --prepareMachine + /p:RID=$(_RID) + displayName: Build + - task: ArchiveFiles@2 + condition: and(eq(variables['system.pullrequest.isfork'], false), eq(variables['_BuildConfig'], 'Release')) + inputs: + rootFolderOrFile: 'artifacts/layout/dotnet-core-uninstall/' + includeRootFolder: false + archiveType: 'tar' + tarCompression: 'gz' + archiveFile: '$(Build.ArtifactStagingDirectory)/dotnet-core-uninstall.tar.gz' + replaceExistingArchive: true + - task: 1ES.PublishBuildArtifacts@1 + condition: and(eq(variables['system.pullrequest.isfork'], false), eq(variables['_BuildConfig'], 'Release')) + inputs: + PathtoPublish: '$(Build.ArtifactStagingDirectory)' + artifactName: 'drop-osx-${_RID}' + publishLocation: 'Container' + parallel: true \ No newline at end of file diff --git a/.vsts-pr.yml b/.vsts-pr.yml index a5429558..829a910c 100644 --- a/.vsts-pr.yml +++ b/.vsts-pr.yml @@ -98,90 +98,49 @@ stages: artifactName: 'drop-windows' publishLocation: 'Container' parallel: true - - job: OSX_latest_x64 - displayName: 'Mac OS (x64)' - pool: - vmImage: 'macOS-latest' - strategy: - matrix: - ${{ if in(variables['Build.Reason'], 'PullRequest') }}: - Debug: - _BuildConfig: Debug - _SignType: none - _DotNetPublishToBlobFeed : false - Release: - _BuildConfig: Release - _SignType: none - _DotNetPublishToBlobFeed : false - variables: - - name: _RID - value: osx-x64 - steps: - - checkout: self - clean: true - - script: eng/common/cibuild.sh - --configuration $(_BuildConfig) - --prepareMachine - /p:RID=$(_RID) - displayName: Build - - task: ArchiveFiles@2 - condition: and(eq(variables['system.pullrequest.isfork'], false), eq(variables['_BuildConfig'], 'Release')) - inputs: - rootFolderOrFile: 'artifacts/layout/dotnet-core-uninstall/' - includeRootFolder: false - archiveType: 'tar' - tarCompression: 'gz' - archiveFile: '$(Build.ArtifactStagingDirectory)/dotnet-core-uninstall.tar.gz' - replaceExistingArchive: true - - task: PublishBuildArtifacts@1 - condition: and(eq(variables['system.pullrequest.isfork'], false), eq(variables['_BuildConfig'], 'Release')) - inputs: - pathtoPublish: '$(Build.ArtifactStagingDirectory)' - artifactName: 'drop-osx' - publishLocation: 'Container' - parallel: true - - job: OSX_latest_arm64 - displayName: 'Mac OS (arm64)' - pool: - vmImage: 'macOS-latest' - strategy: - matrix: - ${{ if in(variables['Build.Reason'], 'PullRequest') }}: - Debug: - _BuildConfig: Debug - _SignType: none - _DotNetPublishToBlobFeed : false - Release: - _BuildConfig: Release - _SignType: none - _DotNetPublishToBlobFeed : false - variables: - - name: _RID - value: osx-arm64 - steps: - - checkout: self - clean: true - - script: eng/common/cibuild.sh - --configuration $(_BuildConfig) - --prepareMachine - /p:RID=$(_RID) - displayName: Build - - task: ArchiveFiles@2 - condition: and(eq(variables['system.pullrequest.isfork'], false), eq(variables['_BuildConfig'], 'Release')) - inputs: - rootFolderOrFile: 'artifacts/layout/dotnet-core-uninstall/' - includeRootFolder: false - archiveType: 'tar' - tarCompression: 'gz' - archiveFile: '$(Build.ArtifactStagingDirectory)/dotnet-core-uninstall.tar.gz' - replaceExistingArchive: true - - task: PublishBuildArtifacts@1 - condition: and(eq(variables['system.pullrequest.isfork'], false), eq(variables['_BuildConfig'], 'Release')) - inputs: - pathtoPublish: '$(Build.ArtifactStagingDirectory)' - artifactName: 'drop-osx' - publishLocation: 'Container' - parallel: true + - {{ each _RID in ['x64', 'arm64'] }} + - job: OSX_latest_${_RID} + displayName: 'Mac OS (${_RID})' + pool: + vmImage: 'macOS-latest' + strategy: + matrix: + ${{ if in(variables['Build.Reason'], 'PullRequest') }}: + Debug: + _BuildConfig: Debug + _SignType: none + _DotNetPublishToBlobFeed : false + Release: + _BuildConfig: Release + _SignType: none + _DotNetPublishToBlobFeed : false + variables: + - name: _RID + value: osx-${_RID} + steps: + - checkout: self + clean: true + - script: eng/common/cibuild.sh + --configuration $(_BuildConfig) + --prepareMachine + /p:RID=$(_RID) + displayName: Build + - task: ArchiveFiles@2 + condition: and(eq(variables['system.pullrequest.isfork'], false), eq(variables['_BuildConfig'], 'Release')) + inputs: + rootFolderOrFile: 'artifacts/layout/dotnet-core-uninstall/' + includeRootFolder: false + archiveType: 'tar' + tarCompression: 'gz' + archiveFile: '$(Build.ArtifactStagingDirectory)/dotnet-core-uninstall.tar.gz' + replaceExistingArchive: true + - task: PublishBuildArtifacts@1 + condition: and(eq(variables['system.pullrequest.isfork'], false), eq(variables['_BuildConfig'], 'Release')) + inputs: + pathtoPublish: '$(Build.ArtifactStagingDirectory)' + artifactName: 'drop-osx-${_RID}' + publishLocation: 'Container' + parallel: true - ${{ if eq(variables._RunAsInternal, True) }}: - template: eng\common\templates\post-build\post-build.yml From e6de7b52ceddb6d5a5314bceb1fdd0ee28902e9a Mon Sep 17 00:00:00 2001 From: Eduardo Villalpando Mello Date: Fri, 31 Jan 2025 13:21:01 -0800 Subject: [PATCH 2/9] Fix formatting --- .vsts-pr.yml | 84 ++++++++++++++++++++++++++-------------------------- 1 file changed, 42 insertions(+), 42 deletions(-) diff --git a/.vsts-pr.yml b/.vsts-pr.yml index 829a910c..c7635fed 100644 --- a/.vsts-pr.yml +++ b/.vsts-pr.yml @@ -99,48 +99,48 @@ stages: publishLocation: 'Container' parallel: true - {{ each _RID in ['x64', 'arm64'] }} - - job: OSX_latest_${_RID} - displayName: 'Mac OS (${_RID})' - pool: - vmImage: 'macOS-latest' - strategy: - matrix: - ${{ if in(variables['Build.Reason'], 'PullRequest') }}: - Debug: - _BuildConfig: Debug - _SignType: none - _DotNetPublishToBlobFeed : false - Release: - _BuildConfig: Release - _SignType: none - _DotNetPublishToBlobFeed : false - variables: - - name: _RID - value: osx-${_RID} - steps: - - checkout: self - clean: true - - script: eng/common/cibuild.sh - --configuration $(_BuildConfig) - --prepareMachine - /p:RID=$(_RID) - displayName: Build - - task: ArchiveFiles@2 - condition: and(eq(variables['system.pullrequest.isfork'], false), eq(variables['_BuildConfig'], 'Release')) - inputs: - rootFolderOrFile: 'artifacts/layout/dotnet-core-uninstall/' - includeRootFolder: false - archiveType: 'tar' - tarCompression: 'gz' - archiveFile: '$(Build.ArtifactStagingDirectory)/dotnet-core-uninstall.tar.gz' - replaceExistingArchive: true - - task: PublishBuildArtifacts@1 - condition: and(eq(variables['system.pullrequest.isfork'], false), eq(variables['_BuildConfig'], 'Release')) - inputs: - pathtoPublish: '$(Build.ArtifactStagingDirectory)' - artifactName: 'drop-osx-${_RID}' - publishLocation: 'Container' - parallel: true + - job: OSX_latest_${_RID} + displayName: 'Mac OS (${_RID})' + pool: + vmImage: 'macOS-latest' + strategy: + matrix: + ${{ if in(variables['Build.Reason'], 'PullRequest') }}: + Debug: + _BuildConfig: Debug + _SignType: none + _DotNetPublishToBlobFeed : false + Release: + _BuildConfig: Release + _SignType: none + _DotNetPublishToBlobFeed : false + variables: + - name: _RID + value: osx-${_RID} + steps: + - checkout: self + clean: true + - script: eng/common/cibuild.sh + --configuration $(_BuildConfig) + --prepareMachine + /p:RID=$(_RID) + displayName: Build + - task: ArchiveFiles@2 + condition: and(eq(variables['system.pullrequest.isfork'], false), eq(variables['_BuildConfig'], 'Release')) + inputs: + rootFolderOrFile: 'artifacts/layout/dotnet-core-uninstall/' + includeRootFolder: false + archiveType: 'tar' + tarCompression: 'gz' + archiveFile: '$(Build.ArtifactStagingDirectory)/dotnet-core-uninstall.tar.gz' + replaceExistingArchive: true + - task: PublishBuildArtifacts@1 + condition: and(eq(variables['system.pullrequest.isfork'], false), eq(variables['_BuildConfig'], 'Release')) + inputs: + pathtoPublish: '$(Build.ArtifactStagingDirectory)' + artifactName: 'drop-osx-${_RID}' + publishLocation: 'Container' + parallel: true - ${{ if eq(variables._RunAsInternal, True) }}: - template: eng\common\templates\post-build\post-build.yml From 07458c9b57b5fe876916759567d461363bc9b211 Mon Sep 17 00:00:00 2001 From: Eduardo Villalpando Mello Date: Fri, 31 Jan 2025 13:21:45 -0800 Subject: [PATCH 3/9] Test with fixed val --- .vsts-ci.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.vsts-ci.yml b/.vsts-ci.yml index 513e9757..0a86992d 100644 --- a/.vsts-ci.yml +++ b/.vsts-ci.yml @@ -121,15 +121,15 @@ extends: parallel: true - {{ each _RID in ['x64', 'arm64'] }} - - job: OSX_latest_${_RID} - displayName: 'Mac OS (${_RID})' + - job: OSX_latest_arm64 + displayName: 'Mac OS (arm64)' pool: name: Azure Pipelines image: 'macOS-latest' os: macOS variables: - name: _RID - value: osx-${_RID} + value: osx-arm64 - name: _BuildConfig value: Release - name: _SignType @@ -157,6 +157,6 @@ extends: condition: and(eq(variables['system.pullrequest.isfork'], false), eq(variables['_BuildConfig'], 'Release')) inputs: PathtoPublish: '$(Build.ArtifactStagingDirectory)' - artifactName: 'drop-osx-${_RID}' + artifactName: 'drop-osx-arm64' publishLocation: 'Container' parallel: true \ No newline at end of file From e65c521452afb31fca8b55dda526ddf310236c57 Mon Sep 17 00:00:00 2001 From: Eduardo Villalpando Mello Date: Fri, 31 Jan 2025 13:23:16 -0800 Subject: [PATCH 4/9] Fix syntax --- .vsts-ci.yml | 10 +++++----- .vsts-pr.yml | 10 +++++----- 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/.vsts-ci.yml b/.vsts-ci.yml index 0a86992d..4e01b215 100644 --- a/.vsts-ci.yml +++ b/.vsts-ci.yml @@ -120,16 +120,16 @@ extends: publishLocation: 'Container' parallel: true - - {{ each _RID in ['x64', 'arm64'] }} - - job: OSX_latest_arm64 - displayName: 'Mac OS (arm64)' + - {{ each _RID in ['x64', 'arm64'] }}: + - job: OSX_latest_${{ _RID }} + displayName: 'Mac OS (${{ _RID }})' pool: name: Azure Pipelines image: 'macOS-latest' os: macOS variables: - name: _RID - value: osx-arm64 + value: osx-${{ _RID }})' - name: _BuildConfig value: Release - name: _SignType @@ -157,6 +157,6 @@ extends: condition: and(eq(variables['system.pullrequest.isfork'], false), eq(variables['_BuildConfig'], 'Release')) inputs: PathtoPublish: '$(Build.ArtifactStagingDirectory)' - artifactName: 'drop-osx-arm64' + artifactName: 'drop-osx-${{ _RID }})' publishLocation: 'Container' parallel: true \ No newline at end of file diff --git a/.vsts-pr.yml b/.vsts-pr.yml index c7635fed..7cd7002a 100644 --- a/.vsts-pr.yml +++ b/.vsts-pr.yml @@ -98,9 +98,9 @@ stages: artifactName: 'drop-windows' publishLocation: 'Container' parallel: true - - {{ each _RID in ['x64', 'arm64'] }} - - job: OSX_latest_${_RID} - displayName: 'Mac OS (${_RID})' + - {{ each _RID in ['x64', 'arm64'] }}: + - job: OSX_latest_${{ _RID }} + displayName: 'Mac OS (${{ _RID }})' pool: vmImage: 'macOS-latest' strategy: @@ -116,7 +116,7 @@ stages: _DotNetPublishToBlobFeed : false variables: - name: _RID - value: osx-${_RID} + value: osx-${{ _RID }} steps: - checkout: self clean: true @@ -138,7 +138,7 @@ stages: condition: and(eq(variables['system.pullrequest.isfork'], false), eq(variables['_BuildConfig'], 'Release')) inputs: pathtoPublish: '$(Build.ArtifactStagingDirectory)' - artifactName: 'drop-osx-${_RID}' + artifactName: 'drop-osx-${{ _RID }}' publishLocation: 'Container' parallel: true From d20607eb62ab39c9dd69cf906cc480cdb6ce5c8c Mon Sep 17 00:00:00 2001 From: Eduardo Villalpando Mello Date: Fri, 31 Jan 2025 13:25:08 -0800 Subject: [PATCH 5/9] Fix loop syntax: --- .vsts-ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.vsts-ci.yml b/.vsts-ci.yml index 4e01b215..c48dd66c 100644 --- a/.vsts-ci.yml +++ b/.vsts-ci.yml @@ -120,7 +120,7 @@ extends: publishLocation: 'Container' parallel: true - - {{ each _RID in ['x64', 'arm64'] }}: + - ${{ each _RID in ['x64', 'arm64'] }}: - job: OSX_latest_${{ _RID }} displayName: 'Mac OS (${{ _RID }})' pool: From 47efe25a89792884c5a6424bff3e9ec1fb423ea8 Mon Sep 17 00:00:00 2001 From: Eduardo Villalpando Mello Date: Fri, 31 Jan 2025 14:01:53 -0800 Subject: [PATCH 6/9] Fix syntax --- .vsts-ci.yml | 17 ++++++++++++----- .vsts-pr.yml | 17 ++++++++++++----- 2 files changed, 24 insertions(+), 10 deletions(-) diff --git a/.vsts-ci.yml b/.vsts-ci.yml index c48dd66c..b0fcaf84 100644 --- a/.vsts-ci.yml +++ b/.vsts-ci.yml @@ -16,6 +16,13 @@ pr: include: - '*' +parameters: +- name: MacOSArchitectures + type: object + default: + - arm64 + - x64 + resources: repositories: - repository: 1ESPipelineTemplates @@ -120,16 +127,16 @@ extends: publishLocation: 'Container' parallel: true - - ${{ each _RID in ['x64', 'arm64'] }}: - - job: OSX_latest_${{ _RID }} - displayName: 'Mac OS (${{ _RID }})' + - ${{ each arch in parameters.MacOSArchitectures }}: + - job: OSX_latest_${{ arch }} + displayName: 'Mac OS (${{ arch }})' pool: name: Azure Pipelines image: 'macOS-latest' os: macOS variables: - name: _RID - value: osx-${{ _RID }})' + value: osx-${{ arch }})' - name: _BuildConfig value: Release - name: _SignType @@ -157,6 +164,6 @@ extends: condition: and(eq(variables['system.pullrequest.isfork'], false), eq(variables['_BuildConfig'], 'Release')) inputs: PathtoPublish: '$(Build.ArtifactStagingDirectory)' - artifactName: 'drop-osx-${{ _RID }})' + artifactName: 'drop-osx-${{ arch }}' publishLocation: 'Container' parallel: true \ No newline at end of file diff --git a/.vsts-pr.yml b/.vsts-pr.yml index 7cd7002a..3dba1a6f 100644 --- a/.vsts-pr.yml +++ b/.vsts-pr.yml @@ -15,6 +15,13 @@ pr: include: - '*' +parameters: +- name: MacOSArchitectures + type: object + default: + - arm64 + - x64 + stages: - stage: build displayName: Build @@ -98,9 +105,9 @@ stages: artifactName: 'drop-windows' publishLocation: 'Container' parallel: true - - {{ each _RID in ['x64', 'arm64'] }}: - - job: OSX_latest_${{ _RID }} - displayName: 'Mac OS (${{ _RID }})' + - ${{ each arch in parameters.MacOSArchitectures }}: + - job: OSX_latest_${{ arch }} + displayName: 'Mac OS (${{ arch }})' pool: vmImage: 'macOS-latest' strategy: @@ -116,7 +123,7 @@ stages: _DotNetPublishToBlobFeed : false variables: - name: _RID - value: osx-${{ _RID }} + value: osx-${{ arch }} steps: - checkout: self clean: true @@ -138,7 +145,7 @@ stages: condition: and(eq(variables['system.pullrequest.isfork'], false), eq(variables['_BuildConfig'], 'Release')) inputs: pathtoPublish: '$(Build.ArtifactStagingDirectory)' - artifactName: 'drop-osx-${{ _RID }}' + artifactName: 'drop-osx-${{ arch }}' publishLocation: 'Container' parallel: true From b7b05366ef50338ca23bb03be96ee96440772a26 Mon Sep 17 00:00:00 2001 From: Eduardo Villalpando Mello Date: Fri, 31 Jan 2025 14:09:54 -0800 Subject: [PATCH 7/9] Try matrix strategy --- .vsts-ci.yml | 89 +++++++++++++++++++++++------------------------ .vsts-pr.yml | 97 ++++++++++++++++++++++++++-------------------------- 2 files changed, 91 insertions(+), 95 deletions(-) diff --git a/.vsts-ci.yml b/.vsts-ci.yml index b0fcaf84..8ff704fb 100644 --- a/.vsts-ci.yml +++ b/.vsts-ci.yml @@ -16,13 +16,6 @@ pr: include: - '*' -parameters: -- name: MacOSArchitectures - type: object - default: - - arm64 - - x64 - resources: repositories: - repository: 1ESPipelineTemplates @@ -126,44 +119,46 @@ extends: artifactName: 'drop-windows' publishLocation: 'Container' parallel: true + - job: OSX_latest + displayName: 'Mac OS' + pool: + name: Azure Pipelines + image: 'macOS-latest' + os: macOS + strategy: + matrix: + - ARM64: + _RID: osx-arm64 + _BuildConfig: Release + _SignType: none + _DotNetPublishToBlobFeed: false + X64: + _RID: osx-x64 + _BuildConfig: Release + _SignType: none + _DotNetPublishToBlobFeed: false + steps: + - checkout: self + clean: true + - script: eng/common/cibuild.sh + --configuration $(_BuildConfig) + --prepareMachine + /p:RID=$(_RID) + displayName: Build + - task: ArchiveFiles@2 + condition: and(eq(variables['system.pullrequest.isfork'], false), eq(variables['_BuildConfig'], 'Release')) + inputs: + rootFolderOrFile: 'artifacts/layout/dotnet-core-uninstall/' + includeRootFolder: false + archiveType: 'tar' + tarCompression: 'gz' + archiveFile: '$(Build.ArtifactStagingDirectory)/dotnet-core-uninstall.tar.gz' + replaceExistingArchive: true + - task: 1ES.PublishBuildArtifacts@1 + condition: and(eq(variables['system.pullrequest.isfork'], false), eq(variables['_BuildConfig'], 'Release')) + inputs: + PathtoPublish: '$(Build.ArtifactStagingDirectory)' + artifactName: 'drop-osx' + publishLocation: 'Container' + parallel: true - - ${{ each arch in parameters.MacOSArchitectures }}: - - job: OSX_latest_${{ arch }} - displayName: 'Mac OS (${{ arch }})' - pool: - name: Azure Pipelines - image: 'macOS-latest' - os: macOS - variables: - - name: _RID - value: osx-${{ arch }})' - - name: _BuildConfig - value: Release - - name: _SignType - value: none - - name: _DotNetPublishToBlobFeed - value: false - steps: - - checkout: self - clean: true - - script: eng/common/cibuild.sh - --configuration $(_BuildConfig) - --prepareMachine - /p:RID=$(_RID) - displayName: Build - - task: ArchiveFiles@2 - condition: and(eq(variables['system.pullrequest.isfork'], false), eq(variables['_BuildConfig'], 'Release')) - inputs: - rootFolderOrFile: 'artifacts/layout/dotnet-core-uninstall/' - includeRootFolder: false - archiveType: 'tar' - tarCompression: 'gz' - archiveFile: '$(Build.ArtifactStagingDirectory)/dotnet-core-uninstall.tar.gz' - replaceExistingArchive: true - - task: 1ES.PublishBuildArtifacts@1 - condition: and(eq(variables['system.pullrequest.isfork'], false), eq(variables['_BuildConfig'], 'Release')) - inputs: - PathtoPublish: '$(Build.ArtifactStagingDirectory)' - artifactName: 'drop-osx-${{ arch }}' - publishLocation: 'Container' - parallel: true \ No newline at end of file diff --git a/.vsts-pr.yml b/.vsts-pr.yml index 3dba1a6f..aa60d347 100644 --- a/.vsts-pr.yml +++ b/.vsts-pr.yml @@ -15,13 +15,6 @@ pr: include: - '*' -parameters: -- name: MacOSArchitectures - type: object - default: - - arm64 - - x64 - stages: - stage: build displayName: Build @@ -105,49 +98,57 @@ stages: artifactName: 'drop-windows' publishLocation: 'Container' parallel: true - - ${{ each arch in parameters.MacOSArchitectures }}: - - job: OSX_latest_${{ arch }} - displayName: 'Mac OS (${{ arch }})' - pool: - vmImage: 'macOS-latest' - strategy: - matrix: - ${{ if in(variables['Build.Reason'], 'PullRequest') }}: - Debug: - _BuildConfig: Debug - _SignType: none - _DotNetPublishToBlobFeed : false - Release: - _BuildConfig: Release + - job: OSX_latest + displayName: 'Mac OS' + pool: + vmImage: 'macOS-latest' + strategy: + matrix: + ${{ if in(variables['Build.Reason'], 'PullRequest') }}: + Debug_arm64: + _BuildConfig: Debug _SignType: none _DotNetPublishToBlobFeed : false - variables: - - name: _RID - value: osx-${{ arch }} - steps: - - checkout: self - clean: true - - script: eng/common/cibuild.sh - --configuration $(_BuildConfig) - --prepareMachine - /p:RID=$(_RID) - displayName: Build - - task: ArchiveFiles@2 - condition: and(eq(variables['system.pullrequest.isfork'], false), eq(variables['_BuildConfig'], 'Release')) - inputs: - rootFolderOrFile: 'artifacts/layout/dotnet-core-uninstall/' - includeRootFolder: false - archiveType: 'tar' - tarCompression: 'gz' - archiveFile: '$(Build.ArtifactStagingDirectory)/dotnet-core-uninstall.tar.gz' - replaceExistingArchive: true - - task: PublishBuildArtifacts@1 - condition: and(eq(variables['system.pullrequest.isfork'], false), eq(variables['_BuildConfig'], 'Release')) - inputs: - pathtoPublish: '$(Build.ArtifactStagingDirectory)' - artifactName: 'drop-osx-${{ arch }}' - publishLocation: 'Container' - parallel: true + _RID: osx-arm64 + Debug_x64: + _BuildConfig: Debug + _SignType: none + _DotNetPublishToBlobFeed : false + _RID: osx-x64 + Release_arm64: + _BuildConfig: Release + _SignType: none + _DotNetPublishToBlobFeed : false + _RID: osx-arm64 + Release_x64: + _BuildConfig: Release + _SignType: none + _DotNetPublishToBlobFeed : false + _RID: osx-x64 + steps: + - checkout: self + clean: true + - script: eng/common/cibuild.sh + --configuration $(_BuildConfig) + --prepareMachine + /p:RID=$(_RID) + displayName: Build + - task: ArchiveFiles@2 + condition: and(eq(variables['system.pullrequest.isfork'], false), eq(variables['_BuildConfig'], 'Release')) + inputs: + rootFolderOrFile: 'artifacts/layout/dotnet-core-uninstall/' + includeRootFolder: false + archiveType: 'tar' + tarCompression: 'gz' + archiveFile: '$(Build.ArtifactStagingDirectory)/dotnet-core-uninstall.tar.gz' + replaceExistingArchive: true + - task: PublishBuildArtifacts@1 + condition: and(eq(variables['system.pullrequest.isfork'], false), eq(variables['_BuildConfig'], 'Release')) + inputs: + pathtoPublish: '$(Build.ArtifactStagingDirectory)' + artifactName: 'drop-osx' + publishLocation: 'Container' + parallel: true - ${{ if eq(variables._RunAsInternal, True) }}: - template: eng\common\templates\post-build\post-build.yml From 62a8965b02dc401f6647d9c07458d90873027f82 Mon Sep 17 00:00:00 2001 From: Eduardo Villalpando Mello Date: Fri, 31 Jan 2025 14:12:51 -0800 Subject: [PATCH 8/9] Name macos drops according to arch --- .vsts-ci.yml | 2 +- .vsts-pr.yml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.vsts-ci.yml b/.vsts-ci.yml index 8ff704fb..6b1b7359 100644 --- a/.vsts-ci.yml +++ b/.vsts-ci.yml @@ -158,7 +158,7 @@ extends: condition: and(eq(variables['system.pullrequest.isfork'], false), eq(variables['_BuildConfig'], 'Release')) inputs: PathtoPublish: '$(Build.ArtifactStagingDirectory)' - artifactName: 'drop-osx' + artifactName: 'drop-$(_RID)' publishLocation: 'Container' parallel: true diff --git a/.vsts-pr.yml b/.vsts-pr.yml index aa60d347..a0400d0f 100644 --- a/.vsts-pr.yml +++ b/.vsts-pr.yml @@ -146,7 +146,7 @@ stages: condition: and(eq(variables['system.pullrequest.isfork'], false), eq(variables['_BuildConfig'], 'Release')) inputs: pathtoPublish: '$(Build.ArtifactStagingDirectory)' - artifactName: 'drop-osx' + artifactName: 'drop-$(_RID)' publishLocation: 'Container' parallel: true From e9ffd46e8e5b08105218c311eee26309aed28b47 Mon Sep 17 00:00:00 2001 From: Eduardo Villalpando Mello Date: Mon, 3 Feb 2025 11:13:46 -0800 Subject: [PATCH 9/9] vsts-ci.yml: fix syntax --- .vsts-ci.yml | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/.vsts-ci.yml b/.vsts-ci.yml index 6b1b7359..61432b7e 100644 --- a/.vsts-ci.yml +++ b/.vsts-ci.yml @@ -127,16 +127,16 @@ extends: os: macOS strategy: matrix: - - ARM64: - _RID: osx-arm64 - _BuildConfig: Release - _SignType: none - _DotNetPublishToBlobFeed: false - X64: - _RID: osx-x64 - _BuildConfig: Release - _SignType: none - _DotNetPublishToBlobFeed: false + ARM64: + _RID: osx-arm64 + _BuildConfig: Release + _SignType: none + _DotNetPublishToBlobFeed: false + X64: + _RID: osx-x64 + _BuildConfig: Release + _SignType: none + _DotNetPublishToBlobFeed: false steps: - checkout: self clean: true