-
Notifications
You must be signed in to change notification settings - Fork 2
131 lines (115 loc) · 4 KB
/
Copy pathbuild-wheels.yml
File metadata and controls
131 lines (115 loc) · 4 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
122
123
124
125
126
127
128
129
130
131
name: Build wheels and upload to PyPI
on:
workflow_dispatch:
release:
types:
- published
concurrency:
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
cancel-in-progress: true
jobs:
build_wheels:
name: Build wheels on ${{ matrix.os }}
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [windows-latest] # [ubuntu-latest, windows-latest, macos-14, macos-15-intel]
steps:
- name: Checkout code
uses: actions/checkout@v5
- name: macOS - Set up Fortran
if: runner.os == 'macOS'
uses: fortran-lang/setup-fortran@v1
with:
version: 14
- name: macOS - Set deployment target
if: runner.os == 'macOS'
run: |
echo "MACOSX_DEPLOYMENT_TARGET=$(sw_vers -productVersion | cut -d '.' -f 1-2)" >> $GITHUB_ENV
# This does not work inside CIBW_BEFORE_ALL_MACOS; Without it, the wheel repair fails.
- name: Windows - Set up pkg-config and CMake
if: runner.os == 'windows'
# shell: bash
run: |
choco install cmake --version=3.31.5 --allow-downgrade -y --no-progress
choco install -y --no-progress --stoponfirstfailure pkgconfiglite
echo "PKG_CONFIG_PATH=C:/mingw64/lib/pkgconfig" >> $GITHUB_ENV
# echo "C:/msys64/mingw64/bin" >> $GITHUB_PATH
- name: Build wheels
uses: pypa/cibuildwheel@v3.4.1
env:
# All cibuildwheel options are here (nothing "hidden" in pyproject.toml)
CIBW_SKIP: "*-win32 *i686 cp3??t-*"
CIBW_BUILD_FRONTEND: build
CIBW_BUILD_VERBOSITY: 3
CIBW_TEST_REQUIRES: pytest scipy
CIBW_TEST_COMMAND: |
pytest {project}/tests
CIBW_MANYLINUX_X86_64_IMAGE: quay.io/pypa/manylinux_2_28_x86_64
CIBW_MUSLLINUX_X86_64_IMAGE: musllinux_1_2
CIBW_BEFORE_ALL_LINUX: |
bash {project}/cibw-scripts/before_all_linux.sh {project}
# CIBW_ENVIRONMENT_WINDOWS: >
# MESON_ARGS="-Dodrpack95:blas_option=refblas"
CIBW_BEFORE_ALL_WINDOWS: |
bash {project}/cibw-scripts/before_all_windows.sh
CIBW_BEFORE_BUILD_WINDOWS: |
pip install delvewheel
CIBW_REPAIR_WHEEL_COMMAND_WINDOWS: |
bash ./cibw-scripts/repair_wheel_command_windows.sh {wheel} {dest_dir}
- name: Upload wheels
uses: actions/upload-artifact@v6
with:
name: cibw-wheels-${{ matrix.os }}-${{ strategy.job-index }}
path: ./wheelhouse/*.whl
build_sdist:
name: Build source distribution
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v5
with:
submodules: recursive
- name: Build sdist
run: pipx run build --sdist
- name: Upload wheels
uses: actions/upload-artifact@v6
with:
name: cibw-sdist
path: dist/*.tar.gz
upload_pypi:
name: Publish to PyPI
needs: [build_wheels, build_sdist]
runs-on: ubuntu-latest
environment:
name: pypi
permissions:
id-token: write
if: ${{ success() && github.event_name == 'release' && github.event.action == 'published' }}
steps:
- uses: actions/download-artifact@v4
with:
pattern: cibw-*
path: dist
merge-multiple: true
- uses: pypa/gh-action-pypi-publish@release/v1
# upload_test_pypi:
# name: Publish to TestPyPI
# needs: [build_wheels, build_sdist]
# runs-on: ubuntu-latest
# environment:
# name: testpypi
# url: https://test.pypi.org/p/odrpack
# permissions:
# id-token: write
# if: ${{ github.event_name == 'workflow_dispatch' }}
# steps:
# - uses: actions/download-artifact@v4
# with:
# pattern: cibw-*
# path: dist
# merge-multiple: true
# - uses: pypa/gh-action-pypi-publish@release/v1
# with:
# repository-url: https://test.pypi.org/legacy/