Skip to content

WindowsRelease

WindowsRelease #22

Workflow file for this run

name: WindowsRelease
on:
schedule:
# Run weekly on Monday 00:00
- cron: '00 00 * * MON'
push:
branches: [main, rel-*]
pull_request:
branches: [main, rel-*]
workflow_dispatch:
permissions: # set top-level default permissions as security best practice
contents: read
jobs:
build:
if: github.event_name != 'pull_request' || startsWith( github.base_ref, 'rel-') || contains( github.event.pull_request.labels.*.name, 'run release CIs')
runs-on: windows-latest
strategy:
matrix:
python-version: ['3.8', '3.9', '3.10', '3.11']
architecture: ['x64', 'x86']
steps:
- name: Checkout ONNX
uses: actions/checkout@c85c95e3d7251135ab7dc9ce3241c5835cc595a9 # v3.5.3
with:
path: ./onnx
- name: Checkout ONNX submodules
shell: bash
run: |
cd onnx
auth_header="$(git config --local --get http.https://github.com/.extraheader)"
git submodule sync --recursive
git -c "http.extraheader=$auth_header" -c protocol.version=2 submodule update --init --force --recursive --depth=1
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@bd6b4b6205c4dbad673328db7b31b7fab9e241c0 # v4.6.1
with:
python-version: ${{ matrix.python-version }}
architecture: ${{ matrix.architecture }}
- name: Add msbuild to PATH
uses: microsoft/setup-msbuild@1ff57057b5cfdc39105cd07a01d78e9b0ea0c14c # v1.3.1
with:
msbuild-architecture: ${{ matrix.architecture }}
- name: Install Python dependencies
run: |
python -m pip install -q --upgrade pip
cd onnx
python -m pip install -q -r requirements-release.txt
- name: Build ONNX wheel
run: |
$arch = 'x64'
if ('${{ matrix.architecture }}' -eq 'x86') {
$arch = 'Win32'
}
. .\onnx\workflow_scripts\protobuf\build_protobuf_win.ps1 -arch $arch
cd onnx
echo "Install ONNX"
$Env:ONNX_ML=1
$Env:CMAKE_ARGS="-DONNX_USE_PROTOBUF_SHARED_LIBS=OFF -DONNX_USE_LITE_PROTO=ON"
if ('${{ github.event_name }}' -eq 'schedule') {
echo "Build weekly PyPI package"
python setup.py bdist_wheel --weekly_build
} else {
python setup.py bdist_wheel
}
Get-ChildItem -Path dist/*.whl | foreach {python -m pip install --upgrade $_.fullname}
- name: Test the installed wheel
run: |
cd onnx
pytest
- uses: actions/upload-artifact@0b7f8abb1508181956e8e162db84b466c27e18ce # v3.1.2
with:
name: wheels
path: ./onnx/dist
- name: Upload onnx-weekly wheel to PyPI/PyPI weekly
if: (github.event_name == 'schedule') # Only triggered by weekly event
run: |
twine upload --verbose onnx/dist/*.whl --repository-url https://upload.pypi.org/legacy/ -u ${{ secrets.ONNXWEEKLY_USERNAME }} -p ${{ secrets.ONNXWEEKLY_TOKEN }}
- name: Verify ONNX with the latest numpy
if: ${{ always() }}
run: |
cd onnx
python -m pip uninstall -y numpy onnx && python -m pip install numpy
Get-ChildItem -Path dist/*.whl | foreach {python -m pip install --upgrade $_.fullname}
pytest
# TODO: Remove if conditions in all release CIs after the minimum supported numpy is upgraded to 1.23.2 or higher
- name: Verify ONNX with the minimum supported numpy
if: ${{ always() }}
run: |
cd onnx
if ('${{ matrix.python-version }}' -eq '3.8' -Or '${{ matrix.python-version }}' -eq '3.9') {
$minimum_numpy_version="1.16.6"
} else {
$minimum_numpy_version="1.23.2"
}
python -m pip uninstall -y numpy onnx && python -m pip install numpy==$minimum_numpy_version
Get-ChildItem -Path dist/*.whl | foreach {python -m pip install --upgrade $_.fullname}
pytest
- name: Verify ONNX with the latest protobuf
if: ${{ always() }}
run: |
cd onnx
python -m pip uninstall -y protobuf onnx && python -m pip install protobuf
Get-ChildItem -Path dist/*.whl | foreach {python -m pip install --upgrade $_.fullname}
pytest
- name: Verify ONNX with the minimum supported protobuf (from requirements.txt)
if: ${{ always() }}
run: |
cd onnx
python -m pip uninstall -y protobuf onnx && python -m pip install protobuf==3.20.2
Get-ChildItem -Path dist/*.whl | foreach {python -m pip install --upgrade $_.fullname}
pytest
- name: Verify ONNX with ONNX Runtime PyPI package
run: |
cd onnx
python -m pip uninstall -y protobuf numpy && python -m pip install -q -r requirements-release.txt
python -m pip install -q onnxruntime
$Env:ORT_MAX_IR_SUPPORTED_VERSION=9
$Env:ORT_MAX_ML_OPSET_SUPPORTED_VERSION=3
$Env:ORT_MAX_ONNX_OPSET_SUPPORTED_VERSION=19
pytest