-
Notifications
You must be signed in to change notification settings - Fork 8
72 lines (63 loc) · 1.76 KB
/
Copy pathpython.yml
File metadata and controls
72 lines (63 loc) · 1.76 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
name: Python
on:
push:
branches: ["main"]
pull_request:
branches: ["main"]
release:
types: [published]
workflow_dispatch:
jobs:
build:
name: Build wheel (${{ matrix.os }})
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest, macos-latest, windows-latest]
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: "3.11"
- name: Build wheel
uses: PyO3/maturin-action@v1
with:
working-directory: threecrate-python
args: --release --out dist
- name: Install and smoke-test
shell: bash
run: |
pip install numpy
pip install threecrate --no-index --find-links threecrate-python/dist/
python -c "
import threecrate as tc
import numpy as np
pts = np.random.rand(100, 3).astype(np.float32)
cloud = tc.PointCloud.from_numpy(pts)
assert len(cloud) == 100
cloud2 = tc.voxel_downsample(cloud, 0.1)
assert len(cloud2) <= len(cloud)
print('smoke test passed')
"
- uses: actions/upload-artifact@v4
with:
name: wheels-${{ matrix.os }}
path: threecrate-python/dist/
publish:
name: Publish to PyPI
runs-on: ubuntu-latest
needs: [build]
if: github.event_name == 'release' || github.event_name == 'workflow_dispatch'
environment: pypi
permissions:
id-token: write
steps:
- uses: actions/download-artifact@v4
with:
pattern: wheels-*
merge-multiple: true
path: dist/
- name: Publish to PyPI
uses: pypa/gh-action-pypi-publish@release/v1
with:
packages-dir: dist/