Skip to content

Commit

Permalink
Adding a new stage
Browse files Browse the repository at this point in the history
  • Loading branch information
jchen351 committed Feb 7, 2025
1 parent 58183eb commit 0714630
Showing 1 changed file with 81 additions and 79 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -42,99 +42,101 @@ stages:
- stage: MacOS_C_API_Packaging_CPU
dependsOn: []
jobs:
- template: mac-cpu-packing-jobs.yml
parameters:
MacosArch: 'x86_64'
AllowReleasedOpsetOnly: ${{ parameters.AllowReleasedOpsetOnly }}
AdditionalBuildFlags: ${{ parameters.AdditionalBuildFlags }}
WithCache: ${{ parameters.WithCache }}

- ${{ if eq(parameters.BuildForAllArchs, true) }}:
- template: mac-cpu-packing-jobs.yml
parameters:
MacosArch: 'x86_64'
MacosArch: 'arm64'
AllowReleasedOpsetOnly: ${{ parameters.AllowReleasedOpsetOnly }}
AdditionalBuildFlags: ${{ parameters.AdditionalBuildFlags }}
WithCache: ${{ parameters.WithCache }}
- template: mac-cpu-packing-jobs.yml
parameters:
MacosArch: 'universal2'
AllowReleasedOpsetOnly: ${{ parameters.AllowReleasedOpsetOnly }}
AdditionalBuildFlags: ${{ parameters.AdditionalBuildFlags }}
WithCache: ${{ parameters.WithCache }}

- ${{ if eq(parameters.BuildForAllArchs, true) }}:
- template: mac-cpu-packing-jobs.yml
parameters:
MacosArch: 'arm64'
AllowReleasedOpsetOnly: ${{ parameters.AllowReleasedOpsetOnly }}
AdditionalBuildFlags: ${{ parameters.AdditionalBuildFlags }}
WithCache: ${{ parameters.WithCache }}
- template: mac-cpu-packing-jobs.yml
parameters:
MacosArch: 'universal2'
AllowReleasedOpsetOnly: ${{ parameters.AllowReleasedOpsetOnly }}
AdditionalBuildFlags: ${{ parameters.AdditionalBuildFlags }}
WithCache: ${{ parameters.WithCache }}

- stage: MacOS_C_API_Package_Publish
dependsOn: MacOS_C_API_Packaging_CPU
jobs:
- job: MacOS_C_API_Package_Publish
pool:
vmImage: 'macOS-13'
steps:
- checkout: none
- job: MacOS_C_API_Package_Publish
pool:
name: 'Azure Pipelines'
image: 'macOS-13'
os: 'macOS'
steps:
- checkout: none
- template: flex-downloadPipelineArtifact.yml
parameters:
StepName: 'Download Pipeline onnxruntime-osx-x86_64'
ArtifactName: 'onnxruntime-osx-x86_64'
TargetPath: '$(Build.ArtifactStagingDirectory)'
SpecificArtifact: ${{ parameters.SpecificArtifact }}
BuildId: ${{ parameters.BuildId }}

- ${{ if eq(parameters.BuildForAllArchs, true) }}:
- template: flex-downloadPipelineArtifact.yml
parameters:
StepName: 'Download Pipeline onnxruntime-osx-x86_64'
ArtifactName: 'onnxruntime-osx-x86_64'
StepName: 'Download Pipeline onnxruntime-osx-arm64'
ArtifactName: 'onnxruntime-osx-arm64'
TargetPath: '$(Build.ArtifactStagingDirectory)'
SpecificArtifact: ${{ parameters.SpecificArtifact }}
BuildId: ${{ parameters.BuildId }}
- template: flex-downloadPipelineArtifact.yml
parameters:
StepName: 'Download Pipeline onnxruntime-osx-universal2'
ArtifactName: 'onnxruntime-osx-universal2'
TargetPath: '$(Build.ArtifactStagingDirectory)'
SpecificArtifact: ${{ parameters.SpecificArtifact }}
BuildId: ${{ parameters.BuildId }}

- ${{ if eq(parameters.BuildForAllArchs, true) }}:
- template: flex-downloadPipelineArtifact.yml
parameters:
StepName: 'Download Pipeline onnxruntime-osx-arm64'
ArtifactName: 'onnxruntime-osx-arm64'
TargetPath: '$(Build.ArtifactStagingDirectory)'
SpecificArtifact: ${{ parameters.SpecificArtifact }}
BuildId: ${{ parameters.BuildId }}
- template: flex-downloadPipelineArtifact.yml
parameters:
StepName: 'Download Pipeline onnxruntime-osx-universal2'
ArtifactName: 'onnxruntime-osx-universal2'
TargetPath: '$(Build.ArtifactStagingDirectory)'
SpecificArtifact: ${{ parameters.SpecificArtifact }}
BuildId: ${{ parameters.BuildId }}

- ${{ if eq(parameters.DoESRP, true)}}:
- script: |
pushd '$(Build.ArtifactStagingDirectory)'
find . '*.tgz' -exec tar -zxvf {} \;
rm -f *.tgz;
find . -type d -name 'onnxruntime-osx-*' -exec zip -FSr --symlinks {}.zip {} \;
find . -type d -name 'onnxruntime-osx-*' -exec rm -rf {} \;
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 {} \;
rm -f *.zip;
find . -type d -name 'onnxruntime-osx-*' -exec tar -czf {}.tgz {} \;
find . -type d -name 'onnxruntime-osx-*' -exec rm -rf {} \;
ls -l
popd
displayName: zip to tgz
- bash: |
set -ex
mkdir -p $(Agent.TempDirectory)/macpackage
find $(Build.ArtifactStagingDirectory) -name "*.tgz" -exec tar -zxvf {} -C $(Agent.TempDirectory)/macpackage \;
find $(Agent.TempDirectory)/macpackage -name "*.dylib" -exec codesign -dvvv {} \;
find $(Agent.TempDirectory)/macpackage -name "*.dylib" -exec ls -l {} \;
rm -rf $(Agent.TempDirectory)/macpackage
displayName: 'Verify code signing'
- ${{ if eq(parameters.DoESRP, true)}}:
- script: |
pushd '$(Build.ArtifactStagingDirectory)'
find . '*.tgz' -exec tar -zxvf {} \;
rm -f *.tgz;
find . -type d -name 'onnxruntime-osx-*' -exec zip -FSr --symlinks {}.zip {} \;
find . -type d -name 'onnxruntime-osx-*' -exec rm -rf {} \;
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 {} \;
rm -f *.zip;
find . -type d -name 'onnxruntime-osx-*' -exec tar -czf {}.tgz {} \;
find . -type d -name 'onnxruntime-osx-*' -exec rm -rf {} \;
ls -l
popd
displayName: zip to tgz
- bash: |
set -ex
mkdir -p $(Agent.TempDirectory)/macpackage
find $(Build.ArtifactStagingDirectory) -name "*.tgz" -exec tar -zxvf {} -C $(Agent.TempDirectory)/macpackage \;
find $(Agent.TempDirectory)/macpackage -name "*.dylib" -exec codesign -dvvv {} \;
find $(Agent.TempDirectory)/macpackage -name "*.dylib" -exec ls -l {} \;
rm -rf $(Agent.TempDirectory)/macpackage
displayName: 'Verify code signing'
- task: 1ES.PublishPipelineArtifact@1
inputs:
targetPath: '$(Build.ArtifactStagingDirectory)'
artifact: 'onnxruntime-osx'
condition: 'succeededOrFailed()'
- task: 1ES.PublishPipelineArtifact@1
inputs:
targetPath: '$(Build.ArtifactStagingDirectory)'
artifact: 'onnxruntime-osx'
condition: 'succeededOrFailed()'

- template: component-governance-component-detection-steps.yml
parameters:
condition: 'succeeded'
- template: component-governance-component-detection-steps.yml
parameters:
condition: 'succeeded'

0 comments on commit 0714630

Please sign in to comment.