-
Notifications
You must be signed in to change notification settings - Fork 49
104 lines (97 loc) · 3.03 KB
/
cibuildwheel.yml
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
# This CI run builds wheels using the cibuildwheel infrastructure.
# This means it:
# - Uses as old dependencies/infrastructure as possible:
# - An old manylinux docker container on Linux
# - An old MACOSX_DEPLOYMENT_TARGET on macOS
# - An old SYSTEM_VERSION target on Windows
# - Builds OpenMEEG
# - Creates wheels
# - Delocates them
# - Uploads them to TestPyPI (main) or PyPi (releases)
# Most of the config lives in `pyproject.toml` and build_tools/cibw_* scripts.
name: cibuildwheel
concurrency:
group: ${{ github.workflow }}-${{ github.event.number }}-${{ github.event.ref }}
cancel-in-progress: true
on:
push:
branches: [ main ]
pull_request:
branches: [ main ]
release:
types: [ published ]
env:
BUILD_TYPE: Release
# https://cibuildwheel.readthedocs.io/en/stable/setup/#github-actions
jobs:
build_wheels:
continue-on-error: true
runs-on: ${{ matrix.os }}
timeout-minutes: 60
strategy:
matrix:
include:
- os: ubuntu-20.04
- os: macos-13
- os: macos-14
- os: windows-2019
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- uses: actions/setup-python@v5 # to make before-all work properly
with:
python-version: '3.10'
- uses: hendrikmuhs/ccache-action@v1.2
if: matrix.os != 'ubuntu-20.04'
with:
key: ${{ github.job }}-${{ matrix.os }}
- name: Cache vcpkg
if: matrix.os != 'ubuntu-20.04'
uses: actions/cache@v4
with:
path: |
vcpkg
build/vcpkg_installed
key: ${{ github.job }}-${{ hashFiles('**/vcpkg.json') }}-${{ matrix.os }}-0
- uses: pypa/cibuildwheel@v2.18.1
with:
package-dir: ./wrapping/python
output-dir: wheelhouse
- uses: actions/upload-artifact@v4
with:
name: wheels-${{ matrix.os }}
path: ./wheelhouse/*.whl
upload_test_pypi:
name: Upload to TestPyPI
needs: [build_wheels]
runs-on: ubuntu-latest
steps:
- uses: actions/download-artifact@v4
with:
path: dist
merge-multiple: true
- run: ls -alt dist/
# upload to Test PyPI for every commit on main branch
- uses: pypa/gh-action-pypi-publish@release/v1
if: github.event_name == 'push' && github.event.ref == 'refs/heads/main'
with:
user: __token__
password: ${{ secrets.OPENMEEG_TEST_PYPI_TOKEN }}
repository_url: https://test.pypi.org/legacy/
skip_existing: true
upload_pypi:
name: Upload to PyPI
needs: [build_wheels]
runs-on: ubuntu-latest
steps:
- uses: actions/download-artifact@v4
with:
path: dist
merge-multiple: true
# upload to PyPI on every tag (we assume these are releases!)
- uses: pypa/gh-action-pypi-publish@release/v1
if: github.event_name == 'release' && github.event.action == 'published'
with:
user: __token__
password: ${{ secrets.OPENMEEG_PYPI_TOKEN }}