Skip to content

Commit e7f3168

Browse files
committed
Implement onnxruntime wheel building action
1 parent 34051d1 commit e7f3168

File tree

1 file changed

+53
-0
lines changed

1 file changed

+53
-0
lines changed

.github/workflows/onnxruntime.yaml

+53
Original file line numberDiff line numberDiff line change
@@ -1 +1,54 @@
11
name: onnxruntime
2+
3+
on:
4+
workflow_dispatch:
5+
inputs:
6+
onnxruntimeBranch:
7+
description: "onnxruntime branch to build from"
8+
required: true
9+
default: "v1.19.0"
10+
11+
jobs:
12+
build_wheels:
13+
name: Build onnxruntime wheel for
14+
runs-on: ubuntu-latest
15+
container:
16+
image: quay.io/pypa/manylinux2010_x86_64
17+
env:
18+
PYBIN: /opt/python/cp310-cp310/bin
19+
steps:
20+
- name: Build wheel
21+
run: |
22+
$PYBIN/python -m venv /venv
23+
source /venv/bin/activate
24+
python3 -m pip install cmake
25+
yum install -y centos-release-scl
26+
yum install -y devtoolset-9
27+
export PATH=/opt/rh/devtoolset-9/root/usr/bin:$PATH
28+
pip install numpy==2.0 onnx packaging wheel
29+
git clone --depth 1 --branch ${{ inputs.onnxruntimeBranch }} --recursive https://github.com/Microsoft/onnxruntime.git
30+
cd onnxruntime/
31+
./build.sh --config Release --build_shared_lib --parallel --compile_no_warning_as_error --skip_submodule_sync --allow_running_as_root --build_wheel
32+
- uses: actions/upload-artifact@v3
33+
with:
34+
name: wheels
35+
path: /onnxruntime/build/Linux/Release/dist/*.whl
36+
37+
publish:
38+
name: Publish wheels to pypi.scm.io
39+
needs: [build_wheels]
40+
runs-on: ubuntu-latest
41+
steps:
42+
- name: Get wheels
43+
uses: actions/download-artifact@v3
44+
with:
45+
name: wheels
46+
path: dist
47+
48+
- name: Publish to pypy.scm.io
49+
uses: pypa/gh-action-pypi-publish@release/v1
50+
with:
51+
user: ${{ secrets.PYPI_SCM_USERNAME }}
52+
password: ${{ secrets.PYPI_SCM_PASSWORD }}
53+
repository-url: https://pypi.scm.io/simple/
54+
skip-existing: true

0 commit comments

Comments
 (0)