-
Notifications
You must be signed in to change notification settings - Fork 1
114 lines (90 loc) · 3.41 KB
/
publish.yml
File metadata and controls
114 lines (90 loc) · 3.41 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
name: Publish Python SDK
on:
push:
tags:
- "v*"
permissions:
contents: read
jobs:
# Build all Python packages on Linux (pure + backend wheels).
build-linux:
if: ${{ !github.event.act }}
name: Build Linux packages
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
- uses: actions-rust-lang/setup-rust-toolchain@150fca883cd4034361b621bd4e6a9d34e5143606 # v1.15.4
with:
cache-key: release
rustflags: ""
- uses: astral-sh/setup-uv@cec208311dfd045dd5311c1add060b2062131d57 # v8.0.0
- name: Install Python
run: uv python install 3.10 3.11 3.12 3.13
- uses: actions/setup-node@53b83947a5a98c8d113130e565377fae1a50d02f # v6.3.0
with:
node-version: "latest"
cache: npm
cache-dependency-path: src/wasm_sandbox/guests/javascript/package-lock.json
- name: Install just
run: cargo install --locked just
- name: Install clang
run: sudo apt-get update && sudo apt-get install -y clang
- name: Build all Python packages
run: |
export INTERPRETERS="--interpreter $(uv python find 3.10) $(uv python find 3.11) $(uv python find 3.12) $(uv python find 3.13)"
just python-dist
- uses: actions/upload-artifact@bbbca2ddaa5d8feaa63e36b76fdaad77386f024f # v7.0.0
with:
name: python-wheels-linux
path: dist/pythonsdk/
# Build Windows-specific maturin backend wheels only.
build-windows:
if: ${{ !github.event.act }}
name: Build Windows backend wheels
runs-on: windows-latest
steps:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
- uses: actions-rust-lang/setup-rust-toolchain@150fca883cd4034361b621bd4e6a9d34e5143606 # v1.15.4
with:
cache-key: release
rustflags: ""
- uses: astral-sh/setup-uv@cec208311dfd045dd5311c1add060b2062131d57 # v8.0.0
- name: Install Python
run: uv python install 3.10 3.11 3.12 3.13
- name: Install just
run: cargo install --locked just
- name: Install LLVM
run: choco install llvm -y
- name: Build backend wheels
shell: pwsh
run: |
$interps = "3.10", "3.11", "3.12", "3.13" | ForEach-Object { & uv python find $_ }
$env:INTERPRETERS = "--interpreter $($interps -join ' ')"
just python-dist-backends
- uses: actions/upload-artifact@bbbca2ddaa5d8feaa63e36b76fdaad77386f024f # v7.0.0
with:
name: python-wheels-windows
path: dist/pythonsdk/
# Merge artifacts from both platforms and publish to PyPI.
publish:
if: ${{ !github.event.act }}
name: Publish to PyPI
needs: [build-linux, build-windows]
runs-on: ubuntu-latest
environment:
name: pypi
permissions:
id-token: write
contents: read
steps:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
- uses: astral-sh/setup-uv@cec208311dfd045dd5311c1add060b2062131d57 # v8.0.0
- name: Install just
run: cargo install --locked just
- uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1
with:
path: dist/pythonsdk/
merge-multiple: true
pattern: python-wheels-*
- name: Publish to PyPI
run: just python python-publish