-
Notifications
You must be signed in to change notification settings - Fork 13
110 lines (93 loc) · 2.95 KB
/
publish.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
105
106
107
108
109
110
name: Publish
on:
release:
types: [ published ]
workflow_dispatch:
jobs:
build_sdist:
name: Build source distribution
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: '3.12'
- name: Install dependencies
run: |
python -m pip install --upgrade pip
python -m pip install --upgrade build twine
- name: Build SDist
run: python -m build --sdist
- name: Check metadata
run: python -m twine check dist/*
- name: Test
run: |
python -m pip install dist/*.tar.gz pytest requests
pytest test/ --ignore test/test_ros.py --color=yes -v
- uses: actions/upload-artifact@v3
with:
path: dist/*.tar.gz
build_wheels:
name: ${{ matrix.platform[0] }} - ${{ matrix.platform[2] }}
runs-on: ${{ matrix.platform[1] }}
strategy:
fail-fast: false
matrix:
platform:
# Build only for 64-bit platforms that have binaries for NumPy
- [Linux, ubuntu-latest, x86_64]
# - [Linux, ubuntu-latest, i686]
- [Linux, ubuntu-latest, aarch64]
# - [Linux, ubuntu-latest, ppc64le]
# - [Linux, ubuntu-latest, s390x]
- [Windows, windows-latest, AMD64]
# - [Windows, windows-latest, x86]
# - [Windows, windows-latest, ARM64]
- [MacOS, macos-latest, x86_64]
- [MacOS, macos-latest, arm64]
# - [MacOS, macos-latest, universal2]
steps:
- uses: actions/checkout@v4
- name: Set up QEMU
if: runner.os == 'Linux'
uses: docker/setup-qemu-action@v3
with:
platforms: all
- uses: actions/setup-python@v5
with:
python-version: '3.12'
- name: Download test data
run: |
python -m pip install pytest requests
python -m pytest test --color=yes || true
- name: Install cibuildwheel
run: python -m pip install cibuildwheel
- name: Build wheels
run: python -m cibuildwheel --output-dir wheelhouse
env:
CIBW_ARCHS: ${{ matrix.platform[2] }}
# Needed for C++17 support on macOS
MACOSX_DEPLOYMENT_TARGET: 10.14
- name: Inspect
run: ls wheelhouse/
- name: Upload wheels
uses: actions/upload-artifact@v3
with:
path: wheelhouse/*.whl
upload_all:
name: Upload if release
needs: [ build_wheels, build_sdist ]
runs-on: ubuntu-latest
if: github.event_name == 'release' && github.event.action == 'published'
steps:
- uses: actions/setup-python@v5
with:
python-version: '3.12'
- uses: actions/download-artifact@v3
with:
name: artifact
path: dist
- uses: pypa/gh-action-pypi-publish@release/v1
with:
user: __token__
password: ${{ secrets.PYPI_API_TOKEN }}