forked from FABLE-3DXRD/ImageD11
-
Notifications
You must be signed in to change notification settings - Fork 2
121 lines (103 loc) · 3.76 KB
/
release.yml
File metadata and controls
121 lines (103 loc) · 3.76 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
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
name: Build and deploy
on:
workflow_dispatch:
release:
types:
- published
jobs:
build_wheels:
name: Build wheels on ${{ matrix.os }}-${{ matrix.cibw_archs }}
runs-on: ${{ matrix.os }}
strategy:
# Ensure that a wheel builder finishes even if another fails
fail-fast: false
matrix:
include:
- os: ubuntu-22.04
cibw_archs: "auto64"
#- os: ubuntu-20.04
# cibw_archs: "auto32"
- os: ubuntu-22.04
cibw_archs: "aarch64"
- os: ubuntu-22.04
cibw_archs: "ppc64le"
- os: windows-latest
cibw_archs: "auto64"
#- os: windows-2019
# cibw_archs: "auto32"
- os: macos-14
cibw_archs: "universal2"
steps:
- uses: actions/checkout@v4
- name: Set up QEMU
if: runner.os == 'Linux'
uses: docker/setup-qemu-action@v3
with:
platforms: all
- name: Build wheels
uses: pypa/cibuildwheel@v3.0.0
env:
CIBW_BUILD_VERBOSITY: 1
CIBW_PROJECT_REQUIRES_PYTHON: ">=3.8"
CIBW_BUILD: cp38-* cp39-* cp310-* cp311-* cp312-* cp313-*
# Do not build for muslinux and python>=3.12 on ppc64le
CIBW_SKIP: "*-musllinux_* cp312-*linux_ppc64le cp313-*linux_ppc64le"
CIBW_ARCHS: ${{ matrix.cibw_archs }}
# Use silx wheelhouse: needed for ppc64le
CIBW_ENVIRONMENT_LINUX: "PIP_FIND_LINKS=https://www.silx.org/pub/wheelhouse/ PIP_TRUSTED_HOST=www.silx.org"
# Build without isolation needed to use older wheels for ppc64le
CIBW_BEFORE_BUILD: pip install setuptools wheel "numpy; python_version >= '3.9'" "oldest-supported-numpy; python_version < '3.9'" --only-binary numpy
CIBW_BUILD_FRONTEND: "build; args: --no-isolation"
CIBW_BEFORE_TEST: "pip install --only-binary :all: numba fabio PyQt5 pyFAI"
CIBW_TEST_EXTRAS: full
CIBW_TEST_COMMAND: pytest {project}/test
# Skip tests for 32bits, emulated architectures, on Windows and on macos python313 (missing siphash wheel)
CIBW_TEST_SKIP: "*-*linux_i686 *-*linux_{aarch64,ppc64le,s390x} *-win32 *-win_amd64 cp313-macosx_universal2"
- uses: actions/upload-artifact@v4
with:
name: cibw-wheels-${{ matrix.os }}-${{ strategy.job-index }}
path: ./wheelhouse/*.whl
build_sdist:
name: Build source distribution
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: '3.11'
cache: 'pip'
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install build twine
- name: Build sdist
run: python -m build --sdist
- name: Check the package
run: |
python -m twine check dist/*
- name: Install and test sdist
run: |
pip install "$(ls dist/imaged11*.tar.gz)[full]"
pytest test
- uses: actions/upload-artifact@v4
with:
name: cibw-sdist
path: dist/*.tar.gz
pypi-publish:
needs: [build_wheels, build_sdist]
name: Upload release to PyPI
runs-on: ubuntu-latest
environment:
name: pypi
permissions:
id-token: write
if: github.event_name == 'release' && github.event.action == 'published'
# or, alternatively, upload to PyPI on every tag starting with 'v' (remove on: release above to use this)
# if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags/v')
steps:
- uses: actions/download-artifact@v4
with:
pattern: cibw-*
path: dist
merge-multiple: true
- uses: pypa/gh-action-pypi-publish@release/v1