Skip to content

Build Wheels

Build Wheels #3

Workflow file for this run

name: Build Wheels
on:
workflow_call:
inputs:
branch:
required: true
type: string
workflow_dispatch:
jobs:
build:
runs-on: ubuntu-latest
strategy:
matrix:
include:
- arch: macosx_x86_64
ext: dylib
whl: macosx_10_16_x86_64
- arch: macosx_arm64
ext: dylib
whl: macosx_11_0_arm64
- arch: linux_aarch64
ext: so
whl: manylinux2014_aarch64
- arch: linux_x86_64
ext: so
whl: manylinux2014_x86_64
- arch: musllinux_x86_64
ext: so
whl: musllinux_1_2_x86_64
- arch: linux_armv6l
ext: so
whl: linux_armv6l
- arch: linux_armv6l
ext: so
whl: linux_armv7l
steps:
- name: Checkout Code - Call
uses: actions/checkout@v4
with:
ref: ${{ inputs.branch }}
if: ${{ inputs.branch }}
- name: Checkout Code - Dispatch
uses: actions/checkout@v4
if: ${{ !inputs.branch }}
- name: Setup Python
uses: actions/setup-python@v5
with:
python-version: "3.12"
- name: Install Poetry
uses: snok/install-poetry@v1
- name: Install package
run: poetry install --all-extras
- name: Download binary
run: curl -sL -o src/viam/rpc/libviam_rust_utils.${{ matrix.ext }} https://github.com/viamrobotics/rust-utils/releases/latest/download/libviam_rust_utils-${{ matrix.arch }}.${{ matrix.ext }}
- name: HACK for arm7l
if: ${{ matrix.whl == 'linux_armv7l' }}
run: echo "This file enables arm7l support. PyPI doesn't allow for packages with the same hash, so this file must be added to differentiate this arm7l package from the arm6l package." > src/viam/arm7l.txt
- name: Build
run: poetry build -f wheel
- name: Rename
run: |
echo "WHL_NAME=viam_sdk-$(poetry run python -c 'import viam; print(viam.__version__)')-py3-none-${{ matrix.whl }}.whl" >> $GITHUB_ENV
mv dist/viam_sdk-$(poetry run python -c "import viam; print(viam.__version__)")-py3-none-any.whl dist/viam_sdk-$(poetry run python -c 'import viam; print(viam.__version__)')-py3-none-${{ matrix.whl }}.whl
- name: Upload artifacts
uses: actions/upload-artifact@v4
with:
name: ${{ env.WHL_NAME }}
path: dist/${{ env.WHL_NAME }}