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
# ═══════════════════════════════════════════════════════════════════════════════
# MASTER: Unified Python Wheel Build + Publish (ix / sniper / llmosafe)
# ═══════════════════════════════════════════════════════════════════════════════
# This is the CANONICAL workflow. All three projects use identical copies.
# Only the PROJECT env var below differs. Do NOT diverge from this template.
#
# Canonical source: /workspace/.github/workflows/wheels.yml
# Local build: /workspace/.github/scripts/build-wheels.sh
# Reference: /workspace/PUBLISHING.md
#
# To adopt for a new project:
# 1. Copy this file to .github/workflows/wheels.yml
# 2. Change PROJECT below
# 3. Set up Trusted Publishing on pypi.org and test.pypi.org for the repo
# 4. Add a "pypi" environment in repo Settings > Environments
# ═══════════════════════════════════════════════════════════════════════════════
name: Wheels
on:
push:
tags:
workflow_dispatch:
# ── Project identity (ONLY line that differs between projects) ──────────────
env:
PROJECT: ix # ← CHANGE THIS: ix | sniper | llmosafe
PYTHON_VERSION: "3.12"
# ── Concurrency: cancel in-progress on re-push ──────────────────────────────
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
# ═══════════════════════════════════════════════════════════════════════════
# Linux wheels — all projects
# ═══════════════════════════════════════════════════════════════════════════
build-linux:
name: linux (${{ matrix.target }})
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
include:
- os: ubuntu-latest
target: x86_64
container: quay.io/pypa/manylinux_2_28_x86_64
- os: ubuntu-24.04-arm
target: aarch64
container: ${{ matrix.container || null }}
steps:
- uses: actions/checkout@v4
- name: Build wheel
uses: PyO3/maturin-action@v1
with:
working-directory: ${{ env.PROJECT }}-py
args: --release --out dist -i python${{ env.PYTHON_VERSION }}
manylinux: auto
before-script-linux: |
yum install -y openssl-devel || true
- name: Upload wheel
uses: actions/upload-artifact@v4
with:
name: wheels-linux-${{ matrix.target }}
path: ${{ env.PROJECT }}-py/dist/
# ═══════════════════════════════════════════════════════════════════════════
# macOS wheels — ix only (skipped for sniper/llmosafe)
# ═══════════════════════════════════════════════════════════════════════════
build-macos:
name: macos (${{ matrix.target }})
if: env.PROJECT == 'ix'
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
include:
- os: macos-latest
target: aarch64
- os: macos-latest
target: x86_64
steps:
- uses: actions/checkout@v4
- name: Build wheel
uses: PyO3/maturin-action@v1
with:
working-directory: ${{ env.PROJECT }}-py
args: --release --out dist -i python${{ env.PYTHON_VERSION }}
manylinux: auto
- name: Upload wheel
uses: actions/upload-artifact@v4
with:
name: wheels-macos-${{ matrix.target }}
path: ${{ env.PROJECT }}-py/dist/
# ═══════════════════════════════════════════════════════════════════════════
# Windows wheels — ix only (skipped for sniper/llmosafe)
# ═══════════════════════════════════════════════════════════════════════════
build-windows:
name: windows (${{ matrix.target }})
if: env.PROJECT == 'ix'
runs-on: windows-latest
strategy:
fail-fast: false
matrix:
target:
steps:
- uses: actions/checkout@v4
- name: Build wheel
uses: PyO3/maturin-action@v1
with:
working-directory: ${{ env.PROJECT }}-py
args: --release --out dist -i python${{ env.PYTHON_VERSION }}
manylinux: auto
- name: Upload wheel
uses: actions/upload-artifact@v4
with:
name: wheels-windows-${{ matrix.target }}
path: ${{ env.PROJECT }}-py/dist/
# ═══════════════════════════════════════════════════════════════════════════
# Publish to TestPyPI — on every tag push and manual dispatch
# ═══════════════════════════════════════════════════════════════════════════
publish-testpypi:
name: Publish → TestPyPI
needs:
if: always() && !cancelled() && !failure()
runs-on: ubuntu-latest
permissions:
id-token: write
steps:
- uses: actions/download-artifact@v4
with:
pattern: wheels-*
path: dist
merge-multiple: true
- name: Publish to TestPyPI
uses: pypa/gh-action-pypi-publish@release/v1
with:
repository-url: https://test.pypi.org/legacy/
packages-dir: dist
skip-existing: true
# ═══════════════════════════════════════════════════════════════════════════
# Publish to PyPI — on tag push only (not manual dispatch by default)
# ═══════════════════════════════════════════════════════════════════════════
publish-pypi:
name: Publish → PyPI
needs:
if: |
always() &&
!cancelled() &&
!failure() &&
startsWith(github.ref, 'refs/tags/v')
runs-on: ubuntu-latest
environment:
name: pypi
url: https://pypi.org/p/${{ env.PROJECT == 'ix' && 'moeix' || env.PROJECT == 'sniper' && 'moesniper' || 'llmosafe' }}
permissions:
id-token: write
steps:
- uses: actions/download-artifact@v4
with:
pattern: wheels-*
path: dist
merge-multiple: true
- name: Publish to PyPI
uses: pypa/gh-action-pypi-publish@release/v1
with:
packages-dir: dist
skip-existing: true