-
Notifications
You must be signed in to change notification settings - Fork 7
71 lines (60 loc) · 2.16 KB
/
cibuildwheel.yml
File metadata and controls
71 lines (60 loc) · 2.16 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
name: Build and Test Wheels
on:
pull_request:
push:
jobs:
build_wheels:
name: Build wheels on ${{ matrix.os }}
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest, macos-latest, windows-latest]
steps:
- uses: actions/checkout@v4
with:
submodules: recursive
- name: Install Python
uses: actions/setup-python@v5
with:
python-version: '3.x' # cibuildwheel will use its own Python versions
- name: Install cibuildwheel
run: python -m pip install cibuildwheel
- name: Build wheels
run: python -m cibuildwheel --output-dir wheelhouse
env:
CIBW_BUILD_VERBOSITY: 1
CIBW_SKIP: "cp37-* cp38-* pp*" # Skip Python 3.7, 3.8 and PyPy as per existing workflows
CIBW_ARCHS_MACOS: "x86_64 arm64" # Build for both architectures on macOS
CIBW_BEFORE_TEST: >
pip install -r {project}/requirements.txt -r {project}/requirements-dev.txt
CIBW_TEST_COMMAND: >
curl -L -o test_image.jpg "https://raw.githubusercontent.com/mohammadimtiazz/standard-test-images-for-Image-Processing/refs/heads/master/standard_test_images/tulips.png" &&
python {project}/tests/test_all.py --image test_image.jpg --quality 1 --method pillow --tonal-spot &&
python {project}/tests/test_all.py --image test_image.jpg --quality 1 --method cpp --tonal-spot
CIBW_BEFORE_BUILD: >
pip install setuptools wheel
CIBW_ENVIRONMENT: >
PURE_PYTHON=False
- uses: actions/upload-artifact@v4
with:
name: cibuildwheel-wheels-${{ matrix.os }}
path: wheelhouse/*.whl
deploy:
name: Publish to PyPI
needs: build_wheels
runs-on: ubuntu-latest
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags')
permissions:
id-token: write
steps:
- uses: actions/checkout@v4
- name: Download all wheels
uses: actions/download-artifact@v4
with:
pattern: cibuildwheel-wheels-*
merge-multiple: true
path: dist
- name: Publish to PyPI
uses: pypa/gh-action-pypi-publish@release/v1
with:
packages_dir: dist