From 99412724b7a3afa34a101cd447c805c94a2ea0de Mon Sep 17 00:00:00 2001 From: Baiju Meswani Date: Tue, 29 Apr 2025 22:49:47 +0000 Subject: [PATCH 1/2] Sign the MacOS library and use that binary --- .../custom-nuget-packaging-pipeline.yml | 21 ++++++++++++------- .../templates/mac-cpu-packaging-pipeline.yml | 6 ++---- .../templates/mac-esrp-dylib.yml | 10 +-------- 3 files changed, 16 insertions(+), 21 deletions(-) diff --git a/tools/ci_build/github/azure-pipelines/custom-nuget-packaging-pipeline.yml b/tools/ci_build/github/azure-pipelines/custom-nuget-packaging-pipeline.yml index 410cf375d0583..e8b1c9972da1c 100644 --- a/tools/ci_build/github/azure-pipelines/custom-nuget-packaging-pipeline.yml +++ b/tools/ci_build/github/azure-pipelines/custom-nuget-packaging-pipeline.yml @@ -87,7 +87,7 @@ extends: DoEsrp: true - stage: NugetPackaging - dependsOn: [Windows_Packaging_CUDA, OnnxRuntime_QNN_Nuget_Win_Arm64, MacOS_C_API_Packaging_CPU] + dependsOn: [Windows_Packaging_CUDA, OnnxRuntime_QNN_Nuget_Win_Arm64, MacOS_C_API_Package_Publish] jobs: - job: CreateNugetPackage pool: 'Onnxruntime-Win2022-GPU-A10' @@ -121,16 +121,21 @@ extends: targetPath: '$(Build.BinariesDirectory)/win-arm64' - task: DownloadPipelineArtifact@0 - displayName: 'Download Pipeline Artifact - osx-x64' + displayName: 'Download Pipeline Artifact - osx' inputs: - artifactName: 'onnxruntime-osx-x86_64' - targetPath: '$(Build.BinariesDirectory)/osx-x64' + artifactName: 'onnxruntime-osx' + targetPath: '$(Build.BinariesDirectory)/osx' - - task: DownloadPipelineArtifact@0 - displayName: 'Download Pipeline Artifact - osx-arm64' + - task: PowerShell@2 + displayName: 'Create osx directories' inputs: - artifactName: 'onnxruntime-osx-arm64' - targetPath: '$(Build.BinariesDirectory)/osx-arm64' + targetType: 'inline' + script: | + mkdir -p $(Build.BinariesDirectory)/osx-x64 + mv osx/onnxruntime-osx-x86_64* $(Build.BinariesDirectory)/osx-x64 + + mkdir -p $(Build.BinariesDirectory)/osx-arm64 + mv osx/onnxruntime-osx-arm64* $(Build.BinariesDirectory)/osx-arm64 - task: PowerShell@2 displayName: 'List all files downloaded' diff --git a/tools/ci_build/github/azure-pipelines/templates/mac-cpu-packaging-pipeline.yml b/tools/ci_build/github/azure-pipelines/templates/mac-cpu-packaging-pipeline.yml index 8fcdab437052c..7547b841c7480 100644 --- a/tools/ci_build/github/azure-pipelines/templates/mac-cpu-packaging-pipeline.yml +++ b/tools/ci_build/github/azure-pipelines/templates/mac-cpu-packaging-pipeline.yml @@ -107,12 +107,12 @@ stages: ls -l popd displayName: tgz to zip + - template: mac-esrp-dylib.yml parameters: FolderPath: '$(Build.ArtifactStagingDirectory)' - DisplayName: 'ESRP - Sign Mac' - DoEsrp: true Pattern: '*.zip' + - script: | pushd '$(Build.ArtifactStagingDirectory)' find . '*.zip' -exec unzip {} \; @@ -136,5 +136,3 @@ stages: targetPath: '$(Build.ArtifactStagingDirectory)' artifactName: 'onnxruntime-osx' condition: 'succeededOrFailed()' - - diff --git a/tools/ci_build/github/azure-pipelines/templates/mac-esrp-dylib.yml b/tools/ci_build/github/azure-pipelines/templates/mac-esrp-dylib.yml index aeebf2a39c8e0..a9a22945d3701 100644 --- a/tools/ci_build/github/azure-pipelines/templates/mac-esrp-dylib.yml +++ b/tools/ci_build/github/azure-pipelines/templates/mac-esrp-dylib.yml @@ -1,16 +1,8 @@ parameters: -- name: DoEsrp - type: boolean - default: true - - name: FolderPath type: string default: '' -- name: DisplayName - type: string - default: '' - - name: Pattern type: string default: '*.zip' @@ -27,7 +19,7 @@ steps: AuthSignCertName: '53d54d02-978d-4305-8572-583cf6711c4f' FolderPath: ${{ parameters.FolderPath }} - Pattern: '*.nupkg' + Pattern: ${{ parameters.Pattern }} SessionTimeout: 90 ServiceEndpointUrl: 'https://api.esrp.microsoft.com/api/v2' MaxConcurrency: 25 From 1e9d98d3a5857030ad05e5324ef06986bcbcb6a5 Mon Sep 17 00:00:00 2001 From: Baiju Meswani Date: Wed, 30 Apr 2025 13:20:27 +0000 Subject: [PATCH 2/2] Use absolute paths --- .../azure-pipelines/custom-nuget-packaging-pipeline.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tools/ci_build/github/azure-pipelines/custom-nuget-packaging-pipeline.yml b/tools/ci_build/github/azure-pipelines/custom-nuget-packaging-pipeline.yml index e8b1c9972da1c..5314c8368809b 100644 --- a/tools/ci_build/github/azure-pipelines/custom-nuget-packaging-pipeline.yml +++ b/tools/ci_build/github/azure-pipelines/custom-nuget-packaging-pipeline.yml @@ -132,10 +132,10 @@ extends: targetType: 'inline' script: | mkdir -p $(Build.BinariesDirectory)/osx-x64 - mv osx/onnxruntime-osx-x86_64* $(Build.BinariesDirectory)/osx-x64 + Move-Item -Path $(Build.BinariesDirectory)/osx/onnxruntime-osx-x86_64* -Destination $(Build.BinariesDirectory)/osx-x64 mkdir -p $(Build.BinariesDirectory)/osx-arm64 - mv osx/onnxruntime-osx-arm64* $(Build.BinariesDirectory)/osx-arm64 + Move-Item -Path $(Build.BinariesDirectory)/osx/onnxruntime-osx-arm64* -Destination $(Build.BinariesDirectory)/osx-arm64 - task: PowerShell@2 displayName: 'List all files downloaded'