Skip to content

* update 2

* update 2 #18

Workflow file for this run

name: Build Wheels
on:
push:
branches: [main, master]
tags: ['v*']
pull_request:
branches: [main, master]
workflow_dispatch:
jobs:
build_wheels:
name: Build wheels on ${{ matrix.os }}
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, macos-latest]
steps:
- uses: actions/checkout@v4
with:
submodules: recursive
- name: Cache extern dependencies
uses: actions/cache@v4
with:
path: extern/local
key: ${{ runner.os }}-${{ runner.arch }}-extern-${{ hashFiles('build.sh', 'extern/KaHIP/**', 'extern/MtKaHyPar/**') }}
restore-keys: |
${{ runner.os }}-${{ runner.arch }}-extern-
- name: Cache cibuildwheel downloads
uses: actions/cache@v4
with:
path: |
~/.cache/cibuildwheel
~/Library/Caches/cibuildwheel
key: ${{ runner.os }}-${{ runner.arch }}-cibw-v1
restore-keys: |
${{ runner.os }}-${{ runner.arch }}-cibw-
- name: Pre-download virtualenv.pyz on macOS
if: runner.os == 'macOS'
shell: bash
run: |
set -euxo pipefail
mkdir -p ~/Library/Caches/cibuildwheel
test -f ~/Library/Caches/cibuildwheel/virtualenv-20.27.1.pyz || \
curl -fL --retry 8 --retry-delay 5 --retry-all-errors \
"https://github.com/pypa/get-virtualenv/blob/20.27.1/public/virtualenv.pyz?raw=true" \
-o ~/Library/Caches/cibuildwheel/virtualenv-20.27.1.pyz
- name: Build wheels
uses: pypa/cibuildwheel@v2.22
env:
CIBW_BUILD: cp38-* cp39-* cp310-* cp311-* cp312-*
CIBW_SKIP: "*-musllinux_* *-win32 *-win_amd64 *-manylinux_i686"
CIBW_ARCHS_LINUX: x86_64
CIBW_ARCHS_MACOS: x86_64 arm64
CIBW_BEFORE_BUILD: ./build.sh
CIBW_BUILD_VERBOSITY: 1
CIBW_DEPENDENCY_VERSIONS: "packages: virtualenv==20.27.1"
- uses: actions/upload-artifact@v4
with:
name: wheels-${{ matrix.os }}
path: ./wheelhouse/*.whl
build_sdist:
name: Build source distribution
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
submodules: recursive
- name: Build sdist
run: pipx run build --sdist
- uses: actions/upload-artifact@v4
with:
name: sdist
path: dist/*.tar.gz
upload_pypi:
needs: [build_wheels, build_sdist]
runs-on: ubuntu-latest
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags/v')
steps:
- uses: actions/download-artifact@v4
with:
pattern: "*"
path: dist
merge-multiple: true
- uses: pypa/gh-action-pypi-publish@release/v1
with:
password: ${{ secrets.PYPI_API_TOKEN }}