-
Notifications
You must be signed in to change notification settings - Fork 1
94 lines (88 loc) · 4.02 KB
/
Copy pathrelease.yml
File metadata and controls
94 lines (88 loc) · 4.02 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
name: Release
# Builds the Windows pyturso wheels (no win_amd64 on PyPI, so we compile them on
# a GitHub runner that already has Rust + MSVC + Windows SDK), builds the Neuron
# package, and publishes a GitHub Release with all artifacts attached.
#
# Python matrix includes 3.14: a team member runs Neuron on 3.14 and the wheel
# pyturso-0.6.1-cp314-cp314-win_amd64.whl is vendored manually — this job keeps
# it regenerated automatically on every release / pyturso bump.
on:
push:
tags: ["v*"]
permissions:
contents: write
jobs:
# --- 0. The gate ---------------------------------------------------------
# ci.yml already runs this suite on every push, but a TAG could still publish
# with it red: nothing connected the two. Now it does. Compiling five pyturso
# wheels before knowing whether the code works was the wrong order anyway.
test:
runs-on: windows-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: "3.12"
- uses: actions/cache@v4
with:
path: ~/.cache/fastembed
key: fastembed-all-MiniLM-L6-v2-v1
- run: pip install -e .[dev]
- run: python -m pytest tests/ -q
# The bootstrap in install.ps1/install.sh clones `v$GM_VERSION` of a
# DIFFERENT repo when no local Gray Matter is found. Nothing kept that
# constant in sync: it sat at 1.1.2 while GM shipped 1.4.0, so a user
# without a local GM got a three-releases-old gateway paired with a
# current Neuron — exactly the venv skew the pip check in GM's installer
# now reports. A release cannot ship that silently any more.
- name: GM_VERSION matches Gray Matter's latest release
shell: bash
run: |
set -eu
ps1=$(sed -n 's/^\$GmVersion = .*else { "\(.*\)" }.*/\1/p' install.ps1)
sh=$(sed -n 's/^GM_VERSION="\${GM_VERSION:-\(.*\)}"/\1/p' install.sh)
latest=$(git ls-remote --tags --refs https://github.com/recla93/gray-matter.git 'v*' \
| sed 's#.*refs/tags/v##' | sort -V | tail -1)
echo "install.ps1=$ps1 install.sh=$sh gray-matter latest=$latest"
[ "$ps1" = "$sh" ] || { echo "::error::install.ps1 ($ps1) and install.sh ($sh) disagree on GM_VERSION"; exit 1; }
[ -n "$latest" ] || { echo "::error::could not read gray-matter tags"; exit 1; }
[ "$ps1" = "$latest" ] || { echo "::error::GM_VERSION is $ps1 but Gray Matter's latest release is $latest — bump it in install.ps1 and install.sh"; exit 1; }
# --- 1. Compile pyturso for Windows (no win_amd64 on PyPI → we build it) ---
build-pyturso-win:
needs: test # red tests, no release
runs-on: windows-latest # already has Rust + MSVC + Windows SDK
strategy:
fail-fast: false
matrix:
python: ["3.10", "3.11", "3.12", "3.13", "3.14"]
steps:
- uses: actions/setup-python@v5
with:
python-version: "${{ matrix.python }}"
allow-prereleases: true # 3.14 may still be pre-release on the runner
- run: pip wheel "pyturso==0.6.1" --no-deps -w wheelhouse
- uses: actions/upload-artifact@v4
with:
name: pyturso-win-${{ matrix.python }}
path: wheelhouse/*.whl
# --- 2. Build the Neuron package + 3. Publish the Release ---
build-release:
needs: build-pyturso-win
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: "3.12"
- run: pip install build
- run: python -m build # dist/*.whl + dist/*.tar.gz
- run: python -m pip install dist/*.whl && python -c "import neuron; print(neuron.__version__)"
- uses: actions/download-artifact@v4
with:
pattern: pyturso-win-*
path: dist
merge-multiple: true
- uses: softprops/action-gh-release@v2
with:
files: dist/* # neuron wheel + sdist + pyturso win wheels
generate_release_notes: true