Skip to content

Commit

Permalink
Add action to build onnxruntime wheel
Browse files Browse the repository at this point in the history
  • Loading branch information
Tobias314 committed Aug 27, 2024
1 parent 568d32b commit e524272
Showing 1 changed file with 54 additions and 0 deletions.
54 changes: 54 additions & 0 deletions .github/workflows/onnxruntime.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
name: onnxruntime

on:
workflow_dispatch:
inputs:
onnxruntimeBranch:
description: "onnxruntime branch to build from"
required: true
default: "v1.19.0"

jobs:
build_wheels:
name: Build onnxruntime wheel for
runs-on: ubuntu-latest
container:
image: quay.io/pypa/manylinux2010_x86_64
env:
PYBIN: /opt/python/cp310-cp310/bin
steps:
- name: Build wheel
run: |
$PYBIN/python -m venv /venv
source /venv/bin/activate
python3 -m pip install cmake
yum install -y centos-release-scl
yum install -y devtoolset-9
export PATH=/opt/rh/devtoolset-9/root/usr/bin:$PATH
pip install numpy==2.0 onnx packaging wheel
git clone --depth 1 --branch ${{ inputs.onnxruntimeBranch }} --recursive https://github.com/Microsoft/onnxruntime.git
cd onnxruntime/
./build.sh --config Release --build_shared_lib --parallel --compile_no_warning_as_error --skip_submodule_sync --allow_running_as_root --build_wheel
- uses: actions/upload-artifact@v3
with:
name: wheels
path: /onnxruntime/build/Linux/Release/dist/*.whl

publish:
name: Publish wheels to pypi.scm.io
needs: [build_wheels]
runs-on: ubuntu-latest
steps:
- name: Get wheels
uses: actions/download-artifact@v3
with:
name: wheels
path: dist

- name: Publish to pypy.scm.io
uses: pypa/gh-action-pypi-publish@release/v1
with:
user: ${{ secrets.PYPI_SCM_USERNAME }}
password: ${{ secrets.PYPI_SCM_PASSWORD }}
repository-url: https://pypi.scm.io/simple/
skip-existing: true

0 comments on commit e524272

Please sign in to comment.