2023-02-24 05:29:44 +08:00
|
|
|
name: Upload Wheels
|
|
|
|
|
|
|
|
on:
|
|
|
|
release:
|
|
|
|
types: [created]
|
|
|
|
workflow_dispatch:
|
|
|
|
|
|
|
|
jobs:
|
|
|
|
build_wheels:
|
|
|
|
name: Build wheels with ${{ matrix.config.cibw_build }}
|
|
|
|
runs-on: ${{ matrix.config.os }}
|
|
|
|
if: github.repository == 'llvm/circt'
|
|
|
|
strategy:
|
|
|
|
matrix:
|
|
|
|
config:
|
|
|
|
- os: ubuntu-20.04
|
|
|
|
cibw_build: cp37-manylinux_x86_64
|
|
|
|
- os: ubuntu-20.04
|
|
|
|
cibw_build: cp310-manylinux_x86_64
|
|
|
|
|
|
|
|
steps:
|
|
|
|
- name: Get CIRCT
|
|
|
|
uses: actions/checkout@v3
|
|
|
|
with:
|
|
|
|
fetch-depth: 2
|
|
|
|
submodules: "true"
|
|
|
|
|
|
|
|
- name: Unshallow CIRCT
|
|
|
|
run: |
|
|
|
|
git fetch --unshallow --tags --no-recurse-submodules
|
|
|
|
|
|
|
|
- name: Setup Python
|
|
|
|
uses: actions/setup-python@v3
|
|
|
|
|
|
|
|
- name: Install cibuildwheel
|
|
|
|
run: python -m pip install cibuildwheel==2.12.0
|
|
|
|
|
|
|
|
- name: Build wheels
|
|
|
|
run: python -m cibuildwheel --output-dir wheelhouse ./lib/Bindings/Python
|
|
|
|
env:
|
|
|
|
CIBW_BUILD: ${{ matrix.config.cibw_build }}
|
|
|
|
CIBW_MANYLINUX_X86_64_IMAGE: manylinux2014
|
|
|
|
CIBW_BUILD_FRONTEND: build
|
|
|
|
SETUPTOOLS_SCM_DEBUG: True
|
|
|
|
|
|
|
|
- name: Upload wheels (Non-Tag)
|
|
|
|
uses: actions/upload-artifact@v3
|
|
|
|
if: github.ref_type != 'tag'
|
|
|
|
with:
|
|
|
|
path: ./wheelhouse/*.whl
|
|
|
|
retention-days: 7
|
|
|
|
|
|
|
|
- name: Upload wheels (Tag)
|
2023-03-14 04:22:01 +08:00
|
|
|
uses: pypa/gh-action-pypi-publish@release/v1
|
2023-02-24 05:29:44 +08:00
|
|
|
if: github.ref_type == 'tag'
|
|
|
|
with:
|
2023-03-14 04:22:01 +08:00
|
|
|
password: ${{ secrets.PYPI_CIRCT_API_TOKEN }}
|
|
|
|
packages-dir: wheelhouse/
|
2023-03-24 12:19:32 +08:00
|
|
|
verify-metadata: false
|