-
Notifications
You must be signed in to change notification settings - Fork 216
92 lines (75 loc) · 2.27 KB
/
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
87
88
89
90
91
92
name: Python wheels
on:
schedule:
- cron: '0 3 * * *'
release:
workflow_dispatch:
inputs:
publish:
description: force publish to pypi
type: boolean
pypi_version_override:
description: override version id detection
type: string
env:
CARGO_INCREMENTAL: false
PYPI_VERSION_OVERRIDE: ${{ inputs.pypi_version_override }}
CIBW_ENVIRONMENT_PASS_LINUX: "PYPI_VERSION_OVERRIDE"
FORCE_JAVASCRIPT_ACTIONS_TO_NODE20: true
MACOSX_DEPLOYMENT_TARGET: 10.12
jobs:
build_wheels:
name: Build wheels on ${{ matrix.os }}
runs-on: ${{ matrix.os}}
strategy:
fail-fast: false
matrix:
os: [ubuntu-20.04, windows-2019, macos-14]
steps:
- uses: actions/checkout@v4
- name: Setup | Rust
uses: hecrj/setup-rust-action@v1
with:
rust-version: stable
- uses: actions/setup-python@v3
- name: Install rust toolchains
if: startsWith(matrix.os, 'macOS')
run: rustup target install x86_64-apple-darwin aarch64-apple-darwin
- name: Install cibuildwheel
run: python -m pip install cibuildwheel
- name: Build wheels
uses: nick-fields/retry@v2
with:
max_attempts: 2
timeout_seconds: 54000 # 15 hours :/
command: python -m cibuildwheel --output-dir wheelhouse api/py
- uses: actions/upload-artifact@v4
with:
name: wheels-${{github.run_id}}-${{matrix.os}}
path: ./wheelhouse/*.whl
make_sdist:
name: Make SDist
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Build SDist
run: cd api/py ; pipx run build --sdist
- uses: actions/upload-artifact@v4
with:
name: wheels-${{github.run_id}}-src
path: api/py/dist/*.tar.gz
upload_all:
needs: [build_wheels, make_sdist]
runs-on: ubuntu-latest
if: (github.event_name == 'release' && github.event.action == 'published') || inputs.publish
steps:
- uses: actions/[email protected]
with:
pattern: wheels-${{github.run_id}}-*
merge-multiple: true
path: dist
- uses: pypa/[email protected]
with:
user: __token__
password: ${{ secrets.PYPI }}
verbose: true