Skip to content

Merge pull request #188 from qulacs/set-prec-json #64

Merge pull request #188 from qulacs/set-prec-json

Merge pull request #188 from qulacs/set-prec-json #64

Workflow file for this run

name: Wheel build
on:
push:
paths-ignore:
- ".devcontainer/**"
- ".vscode/**"
- "*.md"
branches:
- "main"
tags:
- "v*"
workflow_dispatch:
jobs:
wheel-build:
name: Python wheel build
strategy:
fail-fast: false
matrix:
os: ["linux", "macos"]
arch: ["x86_64", "arm64"]
cibw-python: ["cp38", "cp39", "cp310", "cp311", "cp312"]
exclude:
# currently ARM runner is not supported
- os: "linux"
arch: "arm64"
include:
- os: "linux"
arch: "x86_64"
runs-on: "ubuntu-22.04"
cibw-os-arch: "manylinux_x86_64"
- os: "macos"
arch: "x86_64"
runs-on: "macos-13"
cibw-os-arch: "macosx_x86_64"
- os: "macos"
arch: "arm64"
runs-on: "macos-14"
cibw-os-arch: "macosx_arm64"
- cibw-python: "cp38"
python-version: "3.8"
- cibw-python: "cp39"
python-version: "3.9"
- cibw-python: "cp310"
python-version: "3.10"
- cibw-python: "cp311"
python-version: "3.11"
- cibw-python: "cp312"
python-version: "3.12"
runs-on: ${{ matrix.runs-on }}
env:
CMAKE_C_COMPILER: ${{ matrix.os == 'macos' && 'gcc-14' || 'gcc' }}
CMAKE_CXX_COMPILER: ${{ matrix.os == 'macos' && 'g++-14' || 'g++' }}
CIBW_BUILD: ${{ matrix.cibw-python }}-${{ matrix.cibw-os-arch }}
PYTHON: ${{ matrix.python-version }}
MACOSX_DEPLOYMENT_TARGET: ${{ matrix.runs-on == 'macos-14' && '14.0' || '13.0' }}
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
- name: Install Python dependencies
run: python -m pip install cibuildwheel twine
- name: Build wheels
run: python -m cibuildwheel --output-dir wheels
- name: Upload wheel to GitHub
uses: actions/upload-artifact@v4
with:
name: ${{ matrix.cibw-python }}-${{ matrix.cibw-os-arch }}
path: ./wheels/*.whl
- name: Upload wheel data if the Git tag is set
run: python -m twine upload wheels/*.whl
if: ${{ contains(github.ref, 'tags/') }}
env:
TWINE_USERNAME: "__token__"
TWINE_PASSWORD: ${{ secrets.PYPI_TOKEN_SCALUQ }}