-
Notifications
You must be signed in to change notification settings - Fork 4
131 lines (112 loc) · 3.24 KB
/
wheels.yml
File metadata and controls
131 lines (112 loc) · 3.24 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: Wheels
on:
push:
tags:
- "v*"
workflow_dispatch:
permissions:
contents: read
jobs:
build-wheels:
name: ${{ matrix.os_name }}
runs-on: ${{ matrix.runner }}
strategy:
fail-fast: false
matrix:
include:
- os_name: linux
runner: ubuntu-latest
rust_target: x86_64-unknown-linux-gnu
- os_name: linux-arm64
runner: ubuntu-24.04-arm
rust_target: aarch64-unknown-linux-gnu
- os_name: windows-amd64
runner: windows-latest
rust_target: x86_64-pc-windows-msvc
- os_name: windows-arm64
runner: windows-11-arm
rust_target: aarch64-pc-windows-msvc
python_versions: "3.11 3.12 3.13 3.14 3.14t"
- os_name: macos-intel
runner: macos-15-intel
rust_target: x86_64-apple-darwin
- os_name: macos-arm64
runner: macos-15
rust_target: aarch64-apple-darwin
steps:
- name: Check out repository
uses: actions/checkout@v6
with:
persist-credentials: false
- name: Set up Python
uses: actions/setup-python@v6
with:
python-version: "3.13"
- name: Set up uv
uses: astral-sh/setup-uv@v6
- name: Set up Rust
uses: dtolnay/rust-toolchain@stable
with:
toolchain: 1.94.0
- name: Cache Cargo registry and target
uses: Swatinem/rust-cache@v2
- name: Build wheels
shell: bash
env:
RSLOOP_PYTHON_VERSIONS: ${{ matrix.python_versions }}
run: scripts/build-wheels.sh --out dist --target "${{ matrix.rust_target }}"
- name: Upload wheel artifacts
uses: actions/upload-artifact@v4
with:
name: wheels-${{ matrix.os_name }}
path: dist/*.whl
if-no-files-found: error
build-sdist:
name: sdist
runs-on: ubuntu-latest
steps:
- name: Check out repository
uses: actions/checkout@v6
with:
persist-credentials: false
- name: Set up Python
uses: actions/setup-python@v6
with:
python-version: "3.13"
- name: Set up uv
uses: astral-sh/setup-uv@v6
- name: Set up Rust
uses: dtolnay/rust-toolchain@stable
with:
toolchain: 1.94.0
- name: Cache Cargo registry and target
uses: Swatinem/rust-cache@v2
- name: Build source distribution
run: uv run --no-project --with maturin maturin sdist --out dist
- name: Upload source distribution
uses: actions/upload-artifact@v4
with:
name: sdist
path: dist/*.tar.gz
if-no-files-found: error
publish-pypi:
name: publish
if: startsWith(github.ref, 'refs/tags/v')
needs:
- build-wheels
- build-sdist
runs-on: ubuntu-latest
permissions:
contents: read
id-token: write
environment:
name: pypi
url: https://pypi.org/project/rsloop/
steps:
- name: Download release artifacts
uses: actions/download-artifact@v4
with:
path: dist
merge-multiple: true
- name: Publish to PyPI
uses: pypa/gh-action-pypi-publish@release/v1