-
-
Notifications
You must be signed in to change notification settings - Fork 3
60 lines (59 loc) · 2.56 KB
/
build-onnxruntime-extensions.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
# Build multi-platform ONNX Runtime Extensions
#
# Based on onnxruntime-minimal-builder: MIT License
# https://github.com/stakemura/onnxruntime-minimal-builder/blob/main/LICENSE
name: Build ONNX Runtime Extensions
on:
workflow_dispatch:
inputs:
version:
description: "Tag or Branch name (e.g., v0.9.0 or main)"
required: false
env:
VERSION: ${{ github.event.inputs.version || 'main' }}
ORT_VERSION: 1.17.1
jobs:
# Build for each platform. See example build script at
# .pipelines/templates/build-package-for-{PLATFORM}.yml
build:
strategy:
matrix:
include:
- artifact-name: linux-x64
run-os: ubuntu-latest
build-script: ./build_lib.sh --build_dir out/ --config RelWithDebInfo --parallel --cmake_extra_defines OCOS_ONNXRUNTIME_VERSION="$ORT_VERSION"
artifact-path: out/RelWithDebInfo/lib/libortextensions.so
- artifact-name: win-x64
run-os: windows-latest
build-script: cmd /c .\build_lib.bat --x64 --build_dir out --config RelWithDebInfo --parallel --cmake_generator "Visual Studio 17 2022" --cmake_extra_defines OCOS_ONNXRUNTIME_VERSION="$ORT_VERSION"
artifact-path: out\RelWithDebInfo\bin\RelWithDebInfo\ortextensions.dll
- artifact-name: macos-universal
run-os: macos-latest
build-script: ./build_lib.sh --build_dir out/ --config RelWithDebInfo --parallel --cmake_extra_defines CMAKE_OSX_ARCHITECTURES="arm64;x86_64" OCOS_ONNXRUNTIME_VERSION="$ORT_VERSION"
artifact-path: out/RelWithDebInfo/lib/libortextensions.dylib
runs-on: ${{ matrix.run-os }}
steps:
- uses: actions/checkout@v4
with:
repository: microsoft/onnxruntime-extensions
ref: ${{ env.VERSION }}
- name: Dump matrix context
env:
MATRIX_CONTEXT: ${{ toJSON(matrix) }}
run: echo "$MATRIX_CONTEXT" > matrix.json
- name: Cache build result
id: cache-build-result
uses: actions/cache@v4
with:
path: out/
key: ${{ matrix.artifact-name }}-${{ env.VERSION }}-${{ env.ORT_VERSION }}-${{ hashFiles('matrix.json') }}
- name: Build ONNX Runtime Extensions
if: steps.cache-build-result.outputs.cache-hit != 'true'
run: |
${{ matrix.build-script }}
- name: Upload build result
uses: actions/upload-artifact@v4
with:
name: onnxruntime-extensions-${{ matrix.artifact-name }}-${{ env.VERSION }}
path: ${{ matrix.artifact-path }}
retention-days: 7