Skip to content

Commit

Permalink
update main.yml
Browse files Browse the repository at this point in the history
  • Loading branch information
j042 committed Oct 4, 2023
1 parent 70995e1 commit 4d63d1e
Show file tree
Hide file tree
Showing 2 changed files with 117 additions and 10 deletions.
126 changes: 117 additions & 9 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,36 +3,144 @@ name: main
on:
push:
branches: ["main"]
pull_request:

jobs:
wheel_build_full:
runs-on: ${{ matrix.os }}
macos_wheel:
runs-on: macos-latest
strategy:
matrix:
os: [macos-latest, ubuntu-20.04, windows-latest]
arch: [x86_64, arm64]
cw_build: ["pp*", "cp*"]
exclude:
- arch: arm64
cw_build: "pp*"

steps:
- uses: actions/checkout@v3
with:
submodules: recursive
- name: build wheels
uses: pypa/[email protected]
uses: pypa/[email protected]
env:
CIBW_ARCHS: ${{ matrix.arch }}
CIBW_BUILD: ${{ matrix.cw_build }}
CIBW_TEST_SKIP: "*-macosx_arm64"

- uses: actions/upload-artifact@v3
with:
path: ./wheelhouse/*.whl


linux_wheel:
runs-on: ubuntu-latest
strategy:
matrix:
arch: [x86_64]
cw_build: ["cp*manylinux*", "pp*manylinux*", "*musllinux*"]


steps:
- uses: actions/checkout@v3
with:
submodules: recursive
- name: build wheels
uses: pypa/[email protected]
env:
CIBW_ARCHS: ${{ matrix.arch }}
CIBW_BUILD: ${{ matrix.cw_build }}
CIBW_SKIP: "pp39-many*"

- uses: actions/upload-artifact@v3
with:
path: ./wheelhouse/*.whl

linux_wheel_qemu:
runs-on: ubuntu-latest
strategy:
matrix:
arch: [aarch64, ppc64le]
cw_build: ["cp36*many*", "cp37*many*", "cp38*many*", "cp39*many*", "cp310*many*", "cp311*many*", "pp37*many*", "pp38*many*", "pp39*many*"]
exclude:
- arch: ppc64le
cw_build: "pp37*many*"
- arch: ppc64le
cw_build: "pp38*many*"
- arch: ppc64le
cw_build: "pp39*many*"

steps:
- uses: actions/checkout@v3
with:
submodules: recursive

- name: Set up QEMU
if: runner.os == 'Linux'
uses: docker/setup-qemu-action@v2
with:
platforms: arm64, ppc64le

- name: build wheels
uses: pypa/[email protected]
env:
CIBW_ARCHS: ${{ matrix.arch }}
CIBW_BUILD: ${{ matrix.cw_build }}
CIBW_TEST_SKIP: "*-*linux_{aarch64,ppc64le,s390x}"

- uses: actions/upload-artifact@v3
with:
path: ./wheelhouse/*.whl



windows_wheel:
runs-on: windows-latest
strategy:
matrix:
arch: [x86, AMD64]

steps:
- uses: actions/checkout@v3
with:
submodules: recursive
- name: build wheels
uses: pypa/[email protected]
env:
CIBW_ARCHS: ${{ matrix.arch }}


- uses: actions/upload-artifact@v3
with:
path: ./wheelhouse/*.whl


source_dist:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
submodules: recursive

- name: Build sdist
run: pipx run build --sdist

- uses: actions/upload-artifact@v3
with:
path: ./dist/*

upload_pypi:
needs: [wheel_build_full]
needs: [macos_wheel, linux_wheel, windows_wheel, source_dist]
runs-on: ubuntu-latest
permissions:
id-token: write
# try to publish only if this is a push to stable branch
if: ${{ github.event_name == 'push' && github.ref == 'refs/heads/main' }}
steps:
- uses: actions/download-artifact@v3
with:
name: artifact
path: dist

- uses: pypa/gh-action-pypi-publish@v1.6.1
- uses: pypa/gh-action-pypi-publish@release/v1
with:
skip_existing: true
user: __token__
password: ${{ secrets.PYPI_TOKEN }}
skip-existing: true
1 change: 0 additions & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ build-backend = "setuptools.build_meta"

[tool.cibuildwheel]
test-command = "python {project}/tests/test_tetgenpy.py"
before-build = "rm -rf {project}/build" # is this necessary?

[tool.cibuildwheel.macos]
archs = ["x86_64", "arm64"]
Expand Down

0 comments on commit 4d63d1e

Please sign in to comment.