Skip to content

Merge branch 'main' into ci-build-wheel #9

Merge branch 'main' into ci-build-wheel

Merge branch 'main' into ci-build-wheel #9

Workflow file for this run

name: Build
env:
# WARNING: If you update this also update it in the pyproject.toml
BINARYEN_VERSION: 117
# WARNING: If you update this also update it in the pyproject.toml
on:
workflow_dispatch:
pull_request:
push:
branches:
- main
- ci-build-wheel
release:
types:
- published
jobs:
build_wheels:
name: Build wheels on ${{ matrix.os }}
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
# macos-13 is an intel runner, macos-14 is apple silicon
os: [ubuntu-latest, windows-latest, macos-13, macos-14]
steps:
- uses: actions/checkout@v4
- name: Install macOS Dependencies
if: runner.os == 'macOS'
run: 'brew install ninja'
- name: Install Windows Dependencies
if: runner.os == 'Windows'
run: 'choco install wget -y'
- name: Restore cached libbinaryen
id: cache-libbinaryen-restore
uses: actions/cache/restore@v4
with:
path: ./binaryen/libbinaryen
key: ${{ matrix.os }}-${{ runner.os }}-${{ runner.arch }}-v${{env.BINARYEN_VERSION}}-libbinaryen
- name: Build wheels
uses: pypa/cibuildwheel@v2.16.5
- name: Cache libbinaryen
id: cache-libbinaryen-save
uses: actions/cache/save@v4
with:
path: ./binaryen/libbinaryen
key: ${{steps.cache-libbinaryen-restore.outputs.cache-primary-key}}
- uses: actions/upload-artifact@v4
with:
name: binaryen-py-${{ matrix.os }}-${{ strategy.job-index }}
path: ./wheelhouse/*.whl
build_sdist:
name: Build source distribution
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Link Binaryen
run: bash ./scripts/build_libbinaryen.sh
- name: Build sdist
run: pipx run build --sdist
- uses: actions/upload-artifact@v4
with:
name: binaryen-py-sdist
path: dist/*.tar.gz