Skip to content

Build

Build #22

Workflow file for this run

name: Build
on:
workflow_dispatch:
inputs:
onnxruntime-version:
type: string
description: "ONNX Runtime version (e.g. 1.18.0)"
required: true
env:
GCC_VERSION: '11'
CMAKE_VERSION: '3.28'
PYTHON_VERSION: '3.10'
NODE_VERSION: '18'
XCODE_VERSION: '14.3'
MACOSX_DEPLOYMENT_TARGET: '10.15'
jobs:
build:
name: Build
runs-on: ${{ matrix.runs-on }}
strategy:
fail-fast: false
matrix:
include:
- target: aarch64-unknown-linux-gnu
args: "-t -A aarch64"
static: true
feature-set: train
runs-on: ubuntu-22.04
- target: x86_64-unknown-linux-gnu
args: "-t --cuda --trt"
static: false
feature-set: train,cu12
cuda-version: '12.3.0'
runs-on: ubuntu-22.04
- target: aarch64-apple-darwin
args: "-t -A aarch64"
static: true
feature-set: train
runs-on: macos-14
- target: x86_64-apple-darwin
args: "-t"
static: true
feature-set: train
runs-on: macos-14
- target: x86_64-pc-windows-msvc
args: "-t --cuda --trt"
static: false
feature-set: train,cu12
cuda-version: '12.2.2'
runs-on: windows-2022
- target: aarch64-pc-windows-msvc
args: "-t"
static: true
feature-set: train
runs-on: windows-2022
- target: x86_64-pc-windows-msvc
args: "-t"
static: true
feature-set: train
runs-on: windows-2022
steps:
- name: Install cross-compile tools
if: matrix.target == 'aarch64-unknown-linux-gnu'
run: |
sudo apt update && sudo apt install -y gcc make gcc-11-aarch64-linux-gnu g++-11-aarch64-linux-gnu binutils-aarch64-linux-gnu
- name: Remove unnecessary software
if: runner.os == 'Linux'
run: |
sudo rm -rf /usr/local/lib/android
sudo rm -rf /opt/ghc
sudo rm -rf /opt/hostedtoolcache/CodeQL
sudo docker image prune --all --force
- uses: actions/checkout@v4
- uses: Jimver/[email protected]
if: matrix.cuda-version && runner.os != 'macOS'
with:
cuda: ${{ matrix.cuda-version }}
- uses: denoland/setup-deno@v1
with:
deno-version: v1.43
- name: Run builder
run:
deno run -A src/build.ts -v ${{ inputs.onnxruntime-version }} ${{ matrix.static && '-s' || '' }} ${{ matrix.args }}
env:
CUDNN_URL: ${{ matrix.cuda-version && (startsWith(matrix.cuda-version, '12') && (runner.os == 'Linux' && secrets.CUDNN8_9_CUDA12_LINUX_URL || secrets.CUDNN8_9_CUDA12_WINDOWS_URL) || (runner.os == 'Linux' && secrets.CUDNN8_9_CUDA11_LINUX_URL || secrets.CUDNN8_9_CUDA11_WINDOWS_URL)) }}
TENSORRT_URL: ${{ matrix.cuda-version && (startsWith(matrix.cuda-version, '12') && (runner.os == 'Linux' && secrets.TENSORRT10_0_CUDA12_LINUX_URL || secrets.TENSORRT10_0_CUDA12_WINDOWS_URL) || (runner.os == 'Linux' && secrets.TENSORRT10_0_CUDA11_LINUX_URL || secrets.TENSORRT10_0_CUDA11_WINDOWS_URL)) }}
- uses: actions/upload-artifact@v4
with:
name: ortrs-${{ !startsWith(matrix.target, 'wasm32') && 'msort' || 'pkort' }}_${{ matrix.static && 'static' || 'dylib' }}${{ matrix.feature-set != 'none' && format('_{0}', matrix.feature-set) || '' }}-v${{ inputs.onnxruntime-version }}-${{ matrix.target }}
path: artifact
if-no-files-found: error