This repository has been archived by the owner on Oct 1, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
86 lines (83 loc) · 2.65 KB
/
build_wheels.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
name: Build
on:
push:
pull_request:
release:
types:
- published
env:
CIBW_ARCHS_MACOS: x86_64 arm64
CIBW_ARCHS_LINUX: x86_64
CIBW_BEFORE_ALL_LINUX: curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- --default-toolchain=stable --profile=minimal -y
CIBW_ENVIRONMENT_LINUX: 'PATH="$HOME/.cargo/bin:$PATH"'
CIBW_SKIP: cp36-* cp37-* pp* *i686
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
- uses: dtolnay/rust-toolchain@stable
- run: rustup target add aarch64-apple-darwin x86_64-apple-darwin
if: startsWith(matrix.os, 'macos')
- run: rustup target add i686-pc-windows-msvc
if: startsWith(matrix.os, 'windows')
- uses: pypa/[email protected]
- uses: actions/upload-artifact@v4
with:
name: wheelhouse-${{ matrix.os }}
path: ./wheelhouse/*.whl
import_library:
name: Import library on ${{ matrix.os }} with Python ${{ matrix.python }}
runs-on: ${{ matrix.os }}
needs: [build_wheels]
strategy:
matrix:
python: ["3.8", "3.9", "3.10", "3.11", "3.12"]
os: [ubuntu-latest, macos-latest, windows-latest]
steps:
- uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python }}
- uses: actions/download-artifact@v4
with:
name: wheelhouse-${{ matrix.os }}
path: ./wheelhouse/*.whl
- run: python -m pip install --find-links wheelhouse faery
- uses: actions/checkout@v4
- run: python tests/test_timestamps.py
- run: python tests/test_decoders.py
- run: python tests/test_encoders.py
- run: python tests/test_filters.py
build_sdist:
name: Build source distribution
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- run: pipx run build --sdist
- uses: actions/upload-artifact@v4
with:
name: dist
path: dist/*.tar.gz
upload_pypi:
name: Upload wheels and sidst to PyPI
runs-on: ubuntu-latest
needs: [build_wheels, import_library, build_sdist]
if: github.event_name == 'release' && github.event.action == 'published'
steps:
- uses: actions/download-artifact@v4
with:
path: wheelhouse
pattern: wheelhouse-*
merge-multiple: true
- uses: actions/download-artifact@v4
with:
name: dist
path: dist
- run: mv wheelhouse/* dist/
- uses: pypa/[email protected]
with:
password: ${{ secrets.PYPI_API_TOKEN }}