-
Notifications
You must be signed in to change notification settings - Fork 0
146 lines (126 loc) · 4.3 KB
/
Copy pathrelease-check.yml
File metadata and controls
146 lines (126 loc) · 4.3 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
name: Release Check
on:
workflow_dispatch:
push:
branches:
- main
pull_request:
concurrency:
group: release-check-${{ github.ref }}
cancel-in-progress: true
jobs:
version-check:
runs-on: ubuntu-latest
permissions:
contents: read
steps:
- name: Checkout repository
uses: actions/checkout@v6
- name: Validate lockstep package versions
run: python3 scripts/manage_versions.py check
verify-package-distributions:
needs: version-check
runs-on: ubuntu-latest
permissions:
contents: read
steps:
- name: Checkout repository
uses: actions/checkout@v6
- name: Set up uv
uses: astral-sh/setup-uv@v7
with:
enable-cache: true
python-version: "3.14"
- name: Set up Rust
uses: dtolnay/rust-toolchain@1.94.0
- name: Build pure Python distributions
run: |
uv build tstring-core --out-dir dist
uv build json-tstring --out-dir dist
uv build toml-tstring --out-dir dist
uv build yaml-tstring --out-dir dist
- name: Build bindings source distribution
run: uvx maturin sdist --manifest-path rust/python-bindings/Cargo.toml --out dist
- name: Check distribution metadata
run: uvx twine check dist/*
verify-bindings-wheels:
needs: version-check
strategy:
matrix:
include:
- os: linux
runner: ubuntu-latest
target: x86_64-unknown-linux-gnu
maturin_args: --release --manifest-path rust/python-bindings/Cargo.toml --out dist --compatibility pypi -i python3.14
- os: macos
runner: macos-14
target: aarch64-apple-darwin
maturin_args: --release --manifest-path rust/python-bindings/Cargo.toml --out dist --compatibility pypi
- os: windows
runner: windows-latest
target: x86_64-pc-windows-msvc
maturin_args: --release --manifest-path rust/python-bindings/Cargo.toml --out dist --compatibility pypi
runs-on: ${{ matrix.runner }}
permissions:
contents: read
steps:
- name: Checkout repository
uses: actions/checkout@v6
- name: Set up uv
uses: astral-sh/setup-uv@v7
with:
enable-cache: true
python-version: "3.14"
- name: Set up Rust
uses: dtolnay/rust-toolchain@1.94.0
with:
targets: ${{ matrix.target }}
- name: Build pure Python wheels
run: |
uv build tstring-core --wheel --out-dir dist
uv build json-tstring --wheel --out-dir dist
uv build toml-tstring --wheel --out-dir dist
uv build yaml-tstring --wheel --out-dir dist
- name: Build bindings wheel (Linux manylinux)
if: ${{ matrix.os == 'linux' }}
uses: PyO3/maturin-action@v1
with:
target: ${{ matrix.target }}
args: ${{ matrix.maturin_args }}
manylinux: "2_28"
sccache: "true"
- name: Build bindings wheel (host)
if: ${{ matrix.os != 'linux' }}
shell: bash
run: |
PYTHON_BIN="$(uv run --python 3.14 python - <<'PY'
import sys
print(sys.executable)
PY
)"
uvx maturin build --release --manifest-path rust/python-bindings/Cargo.toml --out dist --compatibility pypi -i "$PYTHON_BIN"
- name: Check distribution metadata
shell: bash
run: uvx twine check dist/*
- name: Smoke test installed wheels
shell: bash
run: |
uv venv --python 3.14 .smoke-venv
if [ -x .smoke-venv/bin/python ]; then
PYTHON_BIN=.smoke-venv/bin/python
else
PYTHON_BIN=.smoke-venv/Scripts/python.exe
fi
"$PYTHON_BIN" - <<'PY'
from pathlib import Path
import subprocess
import sys
wheels = sorted(str(path) for path in Path("dist").glob("*.whl"))
if not wheels:
raise SystemExit("No wheels were built.")
subprocess.run(
["uv", "pip", "install", "--python", sys.executable, "--force-reinstall", *wheels],
check=True,
)
PY
"$PYTHON_BIN" -c "import json_tstring, toml_tstring, yaml_tstring, tstring_bindings, tstring_core"