-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add action to build onnxruntime wheel
- Loading branch information
Showing
1 changed file
with
54 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |