-
Notifications
You must be signed in to change notification settings - Fork 7
142 lines (123 loc) · 3.39 KB
/
Copy pathpython.yml
File metadata and controls
142 lines (123 loc) · 3.39 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
132
133
134
135
136
137
138
139
140
141
142
name: Build Python Package
on:
pull_request:
types: [opened, synchronize, reopened, ready_for_review]
push:
branches:
- main
jobs:
build-wheels:
name: Build wheels on ${{ matrix.os }}
runs-on: ${{ matrix.os }}
strategy:
matrix:
include:
# Linux
- os: ubuntu-latest
target: x86_64
manylinux: auto
# - os: ubuntu-latest
# target: aarch64
# manylinux: auto
# # Windows
# - os: windows-latest
# target: x64
# manylinux: false
# - os: windows-latest
# target: x86
# manylinux: false
# macOS
- os: macos-latest
target: x86_64
manylinux: false
# - os: macos-14
# target: aarch64
# manylinux: false
steps:
- uses: actions/checkout@v4
- name: Setup Python
uses: actions/setup-python@v5
with:
python-version: '3.11'
- name: Build wheels (CPython only)
uses: PyO3/maturin-action@v1
env:
# Ensure PyO3 doesn't try to use PyPy
PYO3_CROSS_PYTHON_VERSION: "3.11"
with:
target: ${{ matrix.target }}
args: --release --out dist --features python --interpreter python3.11
sccache: 'true'
manylinux: ${{ matrix.manylinux }}
rust-toolchain: stable
- name: Upload wheels
uses: actions/upload-artifact@v4
with:
name: wheels-${{ matrix.os }}-${{ matrix.target }}
path: dist
build-sdist:
name: Build source distribution
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Setup Python
uses: actions/setup-python@v5
with:
python-version: '3.11'
- name: Build sdist
uses: PyO3/maturin-action@v1
with:
command: sdist
args: --out dist
rust-toolchain: stable
- name: Upload sdist
uses: actions/upload-artifact@v4
with:
name: wheels-sdist
path: dist
test-wheel:
name: Test built wheel
runs-on: ubuntu-latest
needs: [build-wheels]
steps:
- uses: actions/checkout@v4
- name: Setup Python
uses: actions/setup-python@v5
with:
python-version: '3.11'
- name: Download Linux wheel
uses: actions/download-artifact@v4
with:
name: wheels-ubuntu-latest-x86_64
path: dist
- name: Install and test wheel
run: |
pip install dist/*.whl
python -c "from prollytree import ProllyTree; tree = ProllyTree(); tree.insert(b'test', b'value'); assert tree.find(b'test') == b'value'"
echo "✅ Wheel test passed!"
collect-artifacts:
name: Collect all artifacts
runs-on: ubuntu-latest
needs: [build-wheels, build-sdist, test-wheel]
steps:
- name: Download all artifacts
uses: actions/download-artifact@v4
with:
pattern: wheels-*
path: dist
merge-multiple: true
- name: List all built artifacts
run: |
echo "📦 Built artifacts:"
ls -la dist/
echo ""
echo "Total artifacts: $(ls -1 dist/ | wc -l)"
echo ""
echo "Artifact details:"
du -h dist/*
- name: Upload combined artifacts
uses: actions/upload-artifact@v4
with:
name: all-python-artifacts
path: dist/
retention-days: 90