-
Notifications
You must be signed in to change notification settings - Fork 0
216 lines (185 loc) · 7.54 KB
/
release.yml
File metadata and controls
216 lines (185 loc) · 7.54 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
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
name: Release
# Triggered automatically by release-please (see release-please.yml):
# 1. Merge release PR → release-please tags the commit → this workflow publishes to PyPI.
# Tag format: v{MAJOR}.{MINOR}.{PATCH} → stable release
# v{MAJOR}.{MINOR}.{PATCH}a{N} → pre-release (published to PyPI with --pre required)
on:
push:
tags:
- "v[0-9]+.[0-9]+.[0-9]+*"
permissions:
contents: write
# ── Pure-Python packages (coordinode, langchain-coordinode, llama-index) ──────
jobs:
build:
name: Build ${{ matrix.package.name }}
runs-on: ubuntu-latest
strategy:
matrix:
package:
- name: coordinode
path: coordinode
- name: langchain-coordinode
path: langchain-coordinode
- name: llama-index-graph-stores-coordinode
path: llama-index-coordinode
steps:
- uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4
with:
submodules: recursive
fetch-depth: 0 # hatch-vcs needs full history for tag detection
- uses: astral-sh/setup-uv@38f3f104447c67c051c4a08e39b64a148898af3a # v4
with:
python-version: "3.11"
- name: Install build tools
run: uv sync
- name: Generate proto stubs (coordinode only)
if: matrix.package.name == 'coordinode'
run: uv run make proto
- name: Build wheel + sdist
working-directory: ${{ matrix.package.path }}
run: |
# Force hatch-vcs / setuptools_scm to use the tag version, not dirty-tree dev version
export SETUPTOOLS_SCM_PRETEND_VERSION="${GITHUB_REF_NAME#v}"
uv run python -m build
- name: Upload dist artifact
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4
with:
name: dist-${{ matrix.package.name }}
path: ${{ matrix.package.path }}/dist/
retention-days: 1
# ── coordinode-embedded: compiled Rust extension, one wheel per platform ──────
build-embedded:
name: Build embedded / ${{ matrix.target }} (${{ matrix.os }})
strategy:
fail-fast: false
matrix:
include:
# Linux x86_64 — most common server target
- os: ubuntu-latest
target: x86_64
manylinux: manylinux_2_28
# Linux aarch64 — AWS Graviton, Raspberry Pi, etc.
# Requires QEMU (set up below) for cross-compilation on the x86_64 runner.
- os: ubuntu-latest
target: aarch64
manylinux: manylinux_2_28
# macOS Apple Silicon (M1/M2/M3)
# Pin to Python 3.13: macos-latest ships Python 3.14 which PyO3 0.23.x
# does not yet support (max supported is 3.13).
- os: macos-latest
target: aarch64
python-version: "3.13"
# macOS Intel (macos-13 was retired December 2025; macos-15-intel is the
# current Intel label)
- os: macos-15-intel
target: x86_64
python-version: "3.13"
# Windows x86_64
- os: windows-latest
target: x86_64
python-version: "3.13"
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4
with:
submodules: recursive
fetch-depth: 0
# Pin the coordinode-rs submodule to the tag that matches this release.
# The submodule SHA in git already points to the right commit; this step
# ensures the tag annotation is present for version detection.
- name: Verify coordinode-rs submodule tag
run: git -C coordinode-rs describe --tags --exact-match HEAD || true
# Pin Python on macOS and Windows: macos-latest ships Python 3.14 which
# PyO3 0.23.x does not yet support. Remove when PyO3 >= 0.24 is adopted.
# Linux builds run inside a manylinux container that manages Python itself.
- name: Set up Python ${{ matrix.python-version || '3.13' }}
if: runner.os != 'Linux'
uses: actions/setup-python@a26af69be951a213d495a4c3e4e4022e16d87065 # v5
with:
python-version: ${{ matrix.python-version || '3.13' }}
# QEMU is required for maturin-action to cross-compile Linux aarch64 wheels
# on the x86_64 ubuntu-latest runner using the manylinux container.
- name: Set up QEMU
if: runner.os == 'Linux' && matrix.target == 'aarch64'
uses: docker/setup-qemu-action@29109295f81e9208d7d86ff9f9a89f41e8f8e6f3 # v3
- name: Install protoc (macOS / Windows)
if: runner.os != 'Linux'
uses: arduino/setup-protoc@c65c819552d16ad3c9b72d9dfd5ba5237b9c906b # v3.0.0
with:
repo-token: ${{ secrets.GITHUB_TOKEN }}
- name: Build wheels
uses: PyO3/maturin-action@32307a466a178317e8c2ae343b38e73896a047be # v1.47.0
with:
command: build
args: >-
--release
--strip
--manifest-path coordinode-embedded/Cargo.toml
--out dist
manylinux: ${{ matrix.manylinux || 'auto' }}
target: ${{ matrix.target }}
before-script-linux: |
dnf install -y protobuf-compiler
- name: Upload wheels
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4
with:
name: dist-coordinode-embedded-${{ matrix.target }}-${{ matrix.os }}
path: dist/
retention-days: 1
# ── Publish all packages to PyPI ─────────────────────────────────────────────
publish-pypi:
name: Publish to PyPI
runs-on: ubuntu-latest
needs: [build, build-embedded]
environment: pypi
permissions:
id-token: write
strategy:
matrix:
package:
- coordinode
- langchain-coordinode
- llama-index-graph-stores-coordinode
steps:
- uses: actions/download-artifact@d3f86a106a0bac45b974a628896c90dbdf5c8093 # v4
with:
name: dist-${{ matrix.package }}
path: dist/
- uses: pypa/gh-action-pypi-publish@cef221092ed1bacb1cc03d23a2d87d1d172e277b # release/v1
with:
packages-dir: dist/
publish-pypi-embedded:
name: Publish coordinode-embedded to PyPI
runs-on: ubuntu-latest
needs: build-embedded
environment: pypi
permissions:
id-token: write
steps:
- uses: actions/download-artifact@d3f86a106a0bac45b974a628896c90dbdf5c8093 # v4
with:
pattern: dist-coordinode-embedded-*
merge-multiple: true
path: dist/
- uses: pypa/gh-action-pypi-publish@cef221092ed1bacb1cc03d23a2d87d1d172e277b # release/v1
with:
packages-dir: dist/
# ── GitHub Release — attach all wheels ───────────────────────────────────────
github-release:
name: Create GitHub Release
runs-on: ubuntu-latest
needs: [build, build-embedded]
permissions:
contents: write
steps:
- uses: actions/download-artifact@d3f86a106a0bac45b974a628896c90dbdf5c8093 # v4
with:
pattern: dist-*
merge-multiple: true
path: dist/
- uses: softprops/action-gh-release@153bb8e04406b158c6c84fc1615b65b24149a1fe # v2
with:
prerelease: ${{ contains(github.ref_name, 'a') || contains(github.ref_name, 'b') || contains(github.ref_name, 'rc') }}
generate_release_notes: true
files: dist/*