v0.2.12 #72
Workflow file for this run
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
# Copyright (c) 2024 Zero ASIC Corporation | |
# This code is licensed under Apache License 2.0 (see LICENSE for details) | |
# adapted from: | |
# https://github.com/siliconcompiler/siliconcompiler/blob/main/.github/workflows/wheels.yml | |
name: Wheels Build | |
on: | |
workflow_dispatch: | |
release: | |
types: | |
- published | |
# Ensure C compilation works on MacOS. | |
env: | |
MACOSX_DEPLOYMENT_TARGET: "10.13" | |
jobs: | |
build_wheels: | |
name: Wheels on ${{ matrix.platform.os }} ${{ matrix.platform.arch}} ${{ matrix.python-version }} | |
runs-on: ${{ matrix.platform.os }} | |
strategy: | |
fail-fast: false | |
matrix: | |
python-version: [cp37, cp38, cp39, cp310, cp311, cp312] | |
platform: | |
- os: ubuntu-latest | |
arch: x86_64 | |
- os: ubuntu-latest | |
arch: aarch64 | |
- os: macos-latest | |
arch: universal | |
env: | |
CIBW_ARCHS_LINUX: ${{ matrix.platform.arch }} | |
steps: | |
- uses: actions/checkout@v4 | |
# This facilitates building Linux+arm64 wheels | |
# https://cibuildwheel.readthedocs.io/en/stable/faq/#emulation | |
- name: Set up QEMU | |
if: runner.os == 'Linux' | |
uses: docker/setup-qemu-action@v3 | |
with: | |
platforms: all | |
- uses: pypa/cibuildwheel@v2.19.1 | |
env: | |
CIBW_MANYLINUX_X86_64_IMAGE: manylinux2014 | |
CIBW_BUILD: ${{ matrix.python-version }}* | |
CIBW_SKIP: "pp* *win32 *i686 *-musllinux_*" | |
CIBW_ARCHS_MACOS: x86_64 arm64 | |
CIBW_TEST_SKIP: "*_arm64" | |
# "if: always()" ensures that we always upload any wheels that have | |
# been created, even if cibuildwheel action fails | |
- name: Upload wheels | |
if: always() | |
uses: actions/upload-artifact@v4 | |
with: | |
path: wheelhouse/*.whl | |
name: switchboard-${{ matrix.python-version }}-${{ matrix.platform.os }}-${{ matrix.platform.arch }} | |
retention-days: 14 | |
publish: | |
needs: [build_wheels] | |
runs-on: ubuntu-latest | |
if: github.event_name == 'release' && github.event.action == 'published' && !contains(github.event.release.body, 'NOPUBLISH') | |
steps: | |
- uses: actions/download-artifact@v4 | |
with: | |
pattern: switchboard-* | |
merge-multiple: true | |
path: dist | |
- uses: pypa/gh-action-pypi-publish@release/v1 | |
with: | |
user: __token__ | |
password: ${{ secrets.PYPI_DEPLOY }} | |
- name: Add wheels to GitHub release artifacts | |
uses: softprops/action-gh-release@v2 | |
with: | |
files: dist/*.whl |