forked from ScQ-Cloud/pyquafu
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'master' of github.com:beizhansl/pyquafu into zsl
- Loading branch information
Showing
1 changed file
with
59 additions
and
0 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,59 @@ | ||
name: Build | ||
|
||
on: | ||
push: | ||
branches: | ||
- "master" | ||
tags: | ||
- "v*" | ||
pull_request: | ||
pull_request_review: | ||
types: [submitted, edited] | ||
workflow_dispatch: | ||
|
||
|
||
|
||
jobs: | ||
build_wheels: | ||
name: Build python wheels | ||
strategy: | ||
matrix: | ||
os-arch: ["manylinux_x86_64", "win_amd64", "macosx_x86_64", "macosx_arm64"] | ||
python-version: ["3.10"] | ||
cibw-python: ["cp38", "cp39", "cp310","cp311"] | ||
include: | ||
- os-arch: "manylinux_x86_64" | ||
os: "ubuntu-20.04" | ||
- os-arch: "win_amd64" | ||
os: "windows-2019" | ||
- os-arch: "macosx_x86_64" | ||
os: "macos-11" | ||
- os-arch: "macosx_arm64" | ||
os: "macos-11" | ||
runs-on: ${{ matrix.os }} | ||
|
||
env: | ||
CIBW_BUILD: ${{ matrix.cibw-python }}-${{ matrix.os-arch }} | ||
PYTHON: ${{ matrix.python-version }} | ||
TWINE_USERNAME: "__token__" | ||
|
||
steps: | ||
- uses: actions/checkout@v3 | ||
|
||
# Used to host cibuildwheel | ||
- uses: actions/setup-python@v3 | ||
- name: Install dependence | ||
run: python -m pip install pybind11 cibuildwheel scikit-build twine pytest | ||
|
||
- name: Build wheels | ||
run: python -m cibuildwheel --output-dir dist | ||
|
||
- name: Run unit tests | ||
run: pip install . && pytest tests/ | ||
|
||
- name: Publish package | ||
run: python -m twine upload dist/*.whl | ||
if: ${{ contains(github.ref, '/tags/') }} | ||
env: | ||
TWINE_USERNAME: ${{ secrets.TWINE_USERNAME }} | ||
TWINE_PASSWORD: ${{ secrets.TWINE_PASSWORD }} |