185 строки
6.3 KiB
YAML
185 строки
6.3 KiB
YAML
parameters:
|
|
- name: JavaPackagingandPublishing
|
|
displayName: Package and Publish Java Package
|
|
type: boolean
|
|
default: true
|
|
stages:
|
|
- stage: Java_Packaging_and_Publishing
|
|
jobs:
|
|
|
|
- job: Windows_CPU_Java_Packaging
|
|
workspace:
|
|
clean: all
|
|
pool: {name: 'onnxruntime-Win-CPU-2022'}
|
|
|
|
steps:
|
|
- task: PowerShell@2
|
|
displayName: 'Set version'
|
|
inputs:
|
|
targetType: 'inline'
|
|
script: |
|
|
$_ExtVersion=(cat version.txt)
|
|
echo "##vso[task.setvariable variable=OrtExtVersion;]$_ExtVersion"
|
|
workingDirectory: '$(Build.SourcesDirectory)'
|
|
|
|
- script: |
|
|
call .\build.bat -DOCOS_BUILD_JAVA=ON
|
|
displayName: build the extensions java package
|
|
|
|
- task: CopyFiles@2
|
|
displayName: 'Copy Java Files for Windows Arch to Artifact Staging Directory'
|
|
inputs:
|
|
SourceFolder: 'out\Windows\java\build\libs'
|
|
TargetFolder: '$(Build.ArtifactStagingDirectory)'
|
|
|
|
- script: |
|
|
cd $(Build.ArtifactStagingDirectory)
|
|
jar xvf onnxruntime-extensions-$(OrtExtVersion).jar
|
|
tree $(Build.ArtifactStagingDirectory) /f
|
|
displayName: Unpack JAR to sign DLL
|
|
|
|
- template: templates/win-esrp-dll.yml
|
|
parameters:
|
|
FolderPath: '$(Build.ArtifactStagingDirectory)/ai/onnxruntime/extensions/native/win-x64'
|
|
DisplayName: 'Sign DLL'
|
|
DoEsrp: 'true'
|
|
|
|
- publish: $(Build.ArtifactStagingDirectory)/ai/onnxruntime/extensions/native/
|
|
displayName: 'Publish Windows Binaries for Combined JAR'
|
|
artifact: WindowsBinaries
|
|
|
|
- template: templates/component-governance-component-detection-steps.yml
|
|
parameters :
|
|
condition : 'succeeded'
|
|
|
|
- task: mspremier.PostBuildCleanup.PostBuildCleanup-task.PostBuildCleanup@3
|
|
displayName: 'Clean Agent Directories'
|
|
condition: always()
|
|
|
|
- job: Linux_CPU_Java_Packaging
|
|
workspace:
|
|
clean: all
|
|
pool: {name: 'Azure-Pipelines-EO-Ubuntu-2004-aiinfra'}
|
|
|
|
steps:
|
|
- task: PowerShell@2
|
|
displayName: 'Set version'
|
|
inputs:
|
|
targetType: 'inline'
|
|
script: |
|
|
$_ExtVersion=(cat version.txt)
|
|
echo "##vso[task.setvariable variable=OrtExtVersion;]$_ExtVersion"
|
|
workingDirectory: '$(Build.SourcesDirectory)'
|
|
|
|
- script: |
|
|
sh ./build.sh -DOCOS_BUILD_JAVA=ON
|
|
displayName: build the extensions java package
|
|
|
|
- task: CopyFiles@2
|
|
displayName: 'Copy Java Files for $(Agent.OS) Arch to Artifact Staging Directory'
|
|
inputs:
|
|
SourceFolder: 'out/$(Agent.OS)/RelWithDebInfo/java/build/libs'
|
|
TargetFolder: '$(Build.ArtifactStagingDirectory)'
|
|
|
|
- script: |
|
|
cd $(Build.ArtifactStagingDirectory)
|
|
echo $(OrtExtVersion)
|
|
jar xvf onnxruntime-extensions-$(OrtExtVersion).jar
|
|
tree $(Build.ArtifactStagingDirectory) /f
|
|
displayName: Unpack JAR
|
|
|
|
- publish: $(Build.ArtifactStagingDirectory)/ai/onnxruntime/extensions/native/
|
|
displayName: 'Publish Linux Binaries for Combined JAR'
|
|
artifact: LinuxBinaries
|
|
|
|
- template: templates/component-governance-component-detection-steps.yml
|
|
parameters :
|
|
condition : 'succeeded'
|
|
|
|
- task: mspremier.PostBuildCleanup.PostBuildCleanup-task.PostBuildCleanup@3
|
|
displayName: 'Clean Agent Directories'
|
|
condition: always()
|
|
|
|
- job: MacOS_CPU_Java_Packaging
|
|
dependsOn:
|
|
- Windows_CPU_Java_Packaging
|
|
- Linux_CPU_Java_Packaging
|
|
workspace:
|
|
clean: all
|
|
pool:
|
|
vmImage: 'macOS-13'
|
|
|
|
steps:
|
|
- task: PowerShell@2
|
|
displayName: 'Set version'
|
|
inputs:
|
|
targetType: 'inline'
|
|
script: |
|
|
$_ExtVersion=(cat version.txt)
|
|
echo "##vso[task.setvariable variable=OrtExtVersion;]$_ExtVersion"
|
|
workingDirectory: '$(Build.SourcesDirectory)'
|
|
|
|
- script: |
|
|
sh ./build.sh -DOCOS_BUILD_JAVA=ON
|
|
displayName: build the extensions java package
|
|
|
|
- task: CopyFiles@2
|
|
displayName: 'Copy Java Files for $(Agent.OS) Arch to Artifact Staging Directory'
|
|
inputs:
|
|
SourceFolder: 'out/$(Agent.OS)/RelWithDebInfo/java/build/libs'
|
|
TargetFolder: '$(Build.ArtifactStagingDirectory)'
|
|
|
|
- script: |
|
|
cd $(Build.ArtifactStagingDirectory)
|
|
echo $(OrtExtVersion)
|
|
jar xvf onnxruntime-extensions-$(OrtExtVersion).jar
|
|
brew install tree
|
|
tree $(Build.ArtifactStagingDirectory)
|
|
displayName: Unpack JAR to view contents
|
|
|
|
- task: DownloadPipelineArtifact@0
|
|
displayName: 'Download Windows Pipeline Artifact'
|
|
inputs:
|
|
artifactName: 'WindowsBinaries'
|
|
targetPath: '$(Build.ArtifactStagingDirectory)/ai/onnxruntime/extensions/native/'
|
|
|
|
- task: DownloadPipelineArtifact@0
|
|
displayName: 'Download Linux Pipeline Artifact'
|
|
inputs:
|
|
artifactName: 'LinuxBinaries'
|
|
targetPath: '$(Build.ArtifactStagingDirectory)/ai/onnxruntime/extensions/native/'
|
|
|
|
- script: |
|
|
brew install tree
|
|
tree $(Build.ArtifactStagingDirectory)
|
|
displayName: Print contents
|
|
|
|
- script: |
|
|
cd $(Build.ArtifactStagingDirectory)
|
|
rm onnxruntime-extensions-$(OrtExtVersion).jar
|
|
jar cmf0 META-INF/MANIFEST.MF onnxruntime-extensions-$(OrtExtVersion).jar *
|
|
displayName: Combine and pack JAR with Windows, Linux and MacOS Binaries
|
|
|
|
- script: |
|
|
cd $(Build.ArtifactStagingDirectory)
|
|
mkdir drop
|
|
cp onnxruntime-extensions-$(OrtExtVersion).jar drop/onnxruntime-extensions-$(OrtExtVersion).jar
|
|
cp onnxruntime-extensions-$(OrtExtVersion)-javadoc.jar drop/onnxruntime-extensions-$(OrtExtVersion)-javadoc.jar
|
|
cp onnxruntime-extensions-$(OrtExtVersion)-sources.jar drop/onnxruntime-extensions-$(OrtExtVersion)-sources.jar
|
|
cp META-INF/maven/com.microsoft.onnxruntime/onnxruntime-extensions/pom.xml drop/onnxruntime-extensions-$(OrtExtVersion).pom
|
|
displayName: Move files to a drop folder for publishing
|
|
|
|
- task: PublishPipelineArtifact@1
|
|
displayName: 'Publish MacOS Artifact'
|
|
inputs:
|
|
targetPath: '$(Build.ArtifactStagingDirectory)/drop'
|
|
artifact: 'drop-onnxruntime-extensions-java-cpu'
|
|
|
|
- template: templates/component-governance-component-detection-steps.yml
|
|
parameters :
|
|
condition : 'succeeded'
|
|
|
|
- task: mspremier.PostBuildCleanup.PostBuildCleanup-task.PostBuildCleanup@3
|
|
displayName: 'Clean Agent Directories'
|
|
condition: always()
|