Skip to content

Commit

Permalink
Use scikit-build-core for building
Browse files Browse the repository at this point in the history
Signed-off-by: Lucas Heitzmann Gabrielli <[email protected]>
  • Loading branch information
heitzmann committed Apr 17, 2024
1 parent 919cff6 commit a0532b1
Show file tree
Hide file tree
Showing 23 changed files with 292 additions and 432 deletions.
44 changes: 0 additions & 44 deletions .github/release-drafter.yml

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,11 @@ name: Create release
on:
push:
tags:
- 'v*.*'
- 'v*.*.*'

jobs:
release_add:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
submodules: 'recursive'
- uses: softprops/action-gh-release@v1
- uses: softprops/action-gh-release@v2
18 changes: 8 additions & 10 deletions .github/workflows/docs.yml → .github/workflows/publish-docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,33 +5,31 @@ on:
branches: [main]

jobs:
deploy-docs:
publish-docs:
runs-on: ubuntu-latest
name: Docs builder and publisher
steps:
- uses: actions/checkout@v4
with:
submodules: 'recursive'
- uses: actions/setup-python@v5
with:
python-version: 3.11
architecture: x64
cache: 'pip'
- name: Install dependencies
run: sudo apt-get install -y libqhull-dev
if: runner.os == 'Linux'
- name: Install Python dependencies
run: |
pip install --upgrade pip setuptools wheel
sudo apt-get update
sudo apt-get install -y libqhull-dev
- name: Install python dependencies
run: |
pip install pip-tools
python -m piptools compile --resolver=backtracking --extra=docs -o requirements.txt pyproject.toml
pip install -r requirements.txt
- name: Install Gdstk
run: python setup.py install --user
- name: Install gdstk
run: pip install .
- name: Build docs
run: sphinx-build docs docs/_build
- name: Deploy
uses: peaceiris/actions-gh-pages@v3
uses: peaceiris/actions-gh-pages@v4
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: ./docs/_build
Expand Down
158 changes: 158 additions & 0 deletions .github/workflows/publish-packages.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,158 @@
name: Package Builder

on:
push:
tags:
- 'v*.*'
workflow_dispatch:

jobs:
build_manylinux2014:
name: Build wheels on manylinux2014
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: pypa/[email protected]
env:
CIBW_BUILD: "*-manylinux_x86_64 *-manylinux_i686 *-manylinux_aarch64"
CIBW_SKIP: "cp36-* cp37-* pp*"
CIBW_MANYLINUX_X86_64_IMAGE: "manylinux2014"
CIBW_MANYLINUX_I686_IMAGE: "manylinux2014"
CIBW_MANYLINUX_AARCH64_IMAGE: "manylinux2014"
CIBW_BEFORE_ALL_LINUX: >
yum install -y wget &&
wget https://github.com/qhull/qhull/archive/refs/tags/v8.0.2.tar.gz &&
tar -xf v8.0.2.tar.gz &&
cd qhull-8.0.2 &&
cmake -S . -B build &&
cmake --build build --target install
- uses: actions/upload-artifact@v3
with:
path: ./wheelhouse/*.whl

build_manylinux_2_28:
name: Build wheels on manylinux_2_28
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: pypa/[email protected]
env:
CIBW_BUILD: "*-manylinux_x86_64 *-manylinux_aarch64"
CIBW_SKIP: "cp36-* cp37-* pp*"
CIBW_MANYLINUX_X86_64_IMAGE: "manylinux_2_28"
CIBW_MANYLINUX_I686_IMAGE: "manylinux_2_28"
CIBW_MANYLINUX_AARCH64_IMAGE: "manylinux_2_28"
# See https://almalinux.org/blog/2023-12-20-almalinux-8-key-update/
CIBW_BEFORE_ALL_LINUX: >
rpm --import https://repo.almalinux.org/almalinux/RPM-GPG-KEY-AlmaLinux &&
yum install -y wget &&
wget https://github.com/qhull/qhull/archive/refs/tags/v8.0.2.tar.gz &&
tar -xf v8.0.2.tar.gz &&
cd qhull-8.0.2 &&
cmake -S . -B build &&
cmake --build build --target install
- uses: actions/upload-artifact@v3
with:
path: ./wheelhouse/*.whl

build_musllinux:
name: Build wheels on musllinux
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: pypa/[email protected]
env:
CIBW_BUILD: "*-musllinux_x86_64 *-musllinux_i686 *-musllinux_aarch64"
CIBW_SKIP: "cp36-* cp37-* pp*"
CIBW_BEFORE_ALL_LINUX: >
apk update &&
apk add wget &&
wget https://github.com/qhull/qhull/archive/refs/tags/v8.0.2.tar.gz &&
tar -xf v8.0.2.tar.gz &&
cd qhull-8.0.2 &&
cmake -S . -B build &&
cmake --build build --target install
- uses: actions/upload-artifact@v3
with:
path: ./wheelhouse/*.whl

build_macos:
name: Build wheels on MacOS
runs-on: macos-latest
steps:
- uses: actions/checkout@v4
- uses: pypa/[email protected]
env:
CIBW_SKIP: "cp36-* cp37-* pp*"
CIBW_ARCHS_MACOS: "x86_64 universal2"
CIBW_BEFORE_ALL_MACOS: >
wget https://github.com/qhull/qhull/archive/refs/tags/v8.0.2.tar.gz &&
tar -xf v8.0.2.tar.gz &&
cd qhull-8.0.2 &&
cmake -DCMAKE_OSX_ARCHITECTURES='x86_64;arm64' -DBUILD_SHARED_LIBS=OFF -DBUILD_STATIC_LIBS=ON -DBUILD_APPLICATIONS=OFF -S . -B build &&
cmake --build build --target install
- uses: actions/upload-artifact@v3
with:
path: ./wheelhouse/*.whl

build_windows:
strategy:
fail-fast: false
matrix:
python-version: ["3.8", "3.9", "3.10", "3.11", "3.12"]
name: Build wheels for Windows (${{ matrix.python-version }})
runs-on: windows-latest
steps:
- uses: actions/checkout@v4
- uses: ilammy/msvc-dev-cmd@v1
- uses: johnwason/vcpkg-action@v6
with:
manifest-dir: ${{ github.workspace }}
triplet: x64-windows-static
token: ${{ github.token }}
github-binarycache: true
- uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
cache: 'pip'
- name: Install build dependencies (pip)
run: |
python -m pip install --upgrade pip
pip install --upgrade setuptools wheel pip-tools ninja scikit_build_core
python -m piptools compile --resolver=backtracking -o requirements.txt pyproject.toml
pip install -r requirements.txt
- name: Build Python ${{ matrix.python-version }} wheel
run: python -m build -w
env:
CMAKE_GENERATOR: "Ninja"
CMAKE_TOOLCHAIN_FILE: "${{ github.workspace }}/vcpkg/scripts/buildsystems/vcpkg.cmake"
SKBUILD_CMAKE_ARGS: "-DVCPKG_TARGET_TRIPLET=x64-windows-static;-DVCPKG_MANIFEST_MODE=OFF"
- uses: actions/upload-artifact@v3
with:
path: dist/*.whl

build_sdist:
name: Build source distribution
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Build sdist
run: python -m build -s
- uses: actions/upload-artifact@v3
with:
path: dist/*.tar.gz

upload_pypi:
name: Upload wheel to PyPI
needs: [build_manylinux2014, build_manylinux_2_28, build_musllinux, build_macos, build_windows]
runs-on: ubuntu-latest
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags/v')
steps:
- uses: actions/download-artifact@v3
with:
name: artifact
path: dist
- uses: pypa/[email protected]
with:
user: __token__
password: ${{ secrets.PYPI_API_TOKEN }}
102 changes: 0 additions & 102 deletions .github/workflows/pypi-packages.yml

This file was deleted.

Loading

0 comments on commit a0532b1

Please sign in to comment.