-
Notifications
You must be signed in to change notification settings - Fork 0
186 lines (156 loc) · 5.9 KB
/
Copy pathrelease.yaml
File metadata and controls
186 lines (156 loc) · 5.9 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
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
name: Release to PyPI
on:
workflow_dispatch:
jobs:
build-macos:
name: Build ${{ matrix.platform }} wheel
strategy:
matrix:
include:
- platform: macos-arm64
runner: macos-15
- platform: macos-x86_64
runner: macos-15-intel
runs-on: ${{ matrix.runner }}
steps:
- uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5
- name: Install uv
uses: astral-sh/setup-uv@d0d8abe699bfb85fec6de9f7adb5ae17292296ff
- name: Install tree-sitter CLI
run: npm install -g tree-sitter-cli@0.26.11
- name: Build grammar bundle for ${{ matrix.platform }}
run: uv run python scripts/build_grammars.py
- name: Build platform wheel
run: uv run python scripts/build_wheels.py
- name: Smoke test built wheel
run: uv run --with $(ls dist/*.whl) --no-project python tests/verify_installed_wheel.py
- name: Upload dist
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02
with:
name: dist-${{ matrix.platform }}
path: dist/*.whl
build-linux-x86_64:
name: Build linux-x86_64 wheel
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5
- name: Install uv
uses: astral-sh/setup-uv@d0d8abe699bfb85fec6de9f7adb5ae17292296ff
- name: Build grammar bundle for linux-x86_64
run: |
uv run python -c "
import sys
sys.path.insert(0, 'scripts')
import build_grammars as bg
target = next(t for t in bg.DOCKER_TARGETS if t[0] == 'linux-x86_64')
bg.build_via_docker(*target)
"
- name: Build platform wheel
run: uv run python scripts/build_wheels.py
- name: Smoke test linux-x86_64 wheel on manylinux2014
run: |
docker run --rm --platform linux/amd64 \
-v "$PWD:/repo" -w /repo \
quay.io/pypa/manylinux2014_x86_64 \
bash -c '
set -euo pipefail
curl -LsSf https://astral.sh/uv/0.11.30/install.sh \
| env UV_UNMANAGED_INSTALL=/usr/local/bin sh
uv run --python /opt/python/cp311-cp311/bin/python \
--with /repo/dist/*manylinux2014_x86_64.whl \
--no-project python /repo/tests/verify_installed_wheel.py
'
- name: Upload dist
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02
with:
name: dist-linux-x86_64
path: dist/*.whl
build-linux-arm64:
name: Build linux-arm64 wheel
runs-on: ubuntu-24.04-arm
steps:
- uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5
- name: Install uv
uses: astral-sh/setup-uv@d0d8abe699bfb85fec6de9f7adb5ae17292296ff
- name: Build grammar bundle for linux-arm64
run: |
uv run python -c "
import sys
sys.path.insert(0, 'scripts')
import build_grammars as bg
target = next(t for t in bg.DOCKER_TARGETS if t[0] == 'linux-arm64')
bg.build_via_docker(*target)
"
- name: Build platform wheel
run: uv run python scripts/build_wheels.py
- name: Smoke test linux-arm64 wheel on manylinux2014
run: |
docker run --rm --platform linux/arm64 \
-v "$PWD:/repo" -w /repo \
quay.io/pypa/manylinux2014_aarch64 \
bash -c '
set -euo pipefail
curl -LsSf https://astral.sh/uv/0.11.30/install.sh \
| env UV_UNMANAGED_INSTALL=/usr/local/bin sh
uv run --python /opt/python/cp311-cp311/bin/python \
--with /repo/dist/*manylinux2014_aarch64.whl \
--no-project python /repo/tests/verify_installed_wheel.py
'
- name: Upload dist
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02
with:
name: dist-linux-arm64
path: dist/*.whl
build-windows:
name: Build ${{ matrix.platform }} wheel
strategy:
matrix:
include:
- platform: windows-x86_64
runner: windows-latest
msvc_arch: amd64
- platform: windows-arm64
runner: windows-11-arm
msvc_arch: amd64_arm64
runs-on: ${{ matrix.runner }}
steps:
- uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5
- name: Install uv
uses: astral-sh/setup-uv@d0d8abe699bfb85fec6de9f7adb5ae17292296ff
- name: Install tree-sitter CLI
shell: bash
run: npm install -g tree-sitter-cli@0.26.11
- name: Setup MSVC (${{ matrix.msvc_arch }})
uses: ilammy/msvc-dev-cmd@7defe9254715b088f12dddd9942945a3d75cdad5 # v1.9.0
with:
arch: ${{ matrix.msvc_arch }}
- name: Build grammar bundle for ${{ matrix.platform }}
shell: pwsh
run: uv run python scripts/build_grammars.py
- name: Build platform wheel
shell: bash
run: uv run python scripts/build_wheels.py
- name: Smoke test built wheel
shell: bash
run: uv run --with $(ls dist/*.whl) --no-project python tests/verify_installed_wheel.py
- name: Upload dist
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02
with:
name: dist-${{ matrix.platform }}
path: dist/*.whl
publish:
name: Publish to PyPI
needs: [build-macos, build-linux-x86_64, build-linux-arm64, build-windows]
runs-on: ubuntu-latest
environment: release
permissions:
id-token: write
steps:
- name: Download dist
uses: actions/download-artifact@d3f86a106a0bac45b974a628896c90dbdf5c8093
with:
pattern: dist-*
path: dist/
merge-multiple: true
- name: Publish to PyPI
uses: pypa/gh-action-pypi-publish@cef221092ed1bacb1cc03d23a2d87d1d172e277b