-
Notifications
You must be signed in to change notification settings - Fork 1
144 lines (120 loc) · 3.9 KB
/
Copy pathrelease.yml
File metadata and controls
144 lines (120 loc) · 3.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
# Release — push a version tag (v*)
#
# Pipeline:
# 1. publish-rust — crates.io (core → backtest/plugins → polars → quantwave)
# 2. build-python-* — wheels (linux x64/arm, macOS, windows)
# 3. verify-python-wheel — import + RSI smoke on 3.9/3.11/3.12/3.13
# 4. publish-python — PyPI via OIDC trusted publisher (no API token)
#
# PyPI trusted publisher must match THIS filename exactly: release.yml
# Repository: lavs9/quantwave
# Environment: (Any) — or set `environment: pypi` on the job + PyPI env name
#
# Day-to-day CI is .github/workflows/ci.yml (no publish).
name: Release
on:
push:
tags:
- 'v*'
jobs:
publish-rust:
name: Publish Rust crates
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v7
- uses: dtolnay/rust-toolchain@stable
- uses: actions/cache@v6
with:
path: |
~/.cargo/registry
~/.cargo/git
target
key: ${{ runner.os }}-cargo-release-${{ hashFiles('**/Cargo.lock') }}
- name: Publish Rust crates (ordered + idempotent)
run: |
chmod +x scripts/publish_crates.sh
./scripts/publish_crates.sh
env:
CARGO_REGISTRY_TOKEN: ${{ secrets.CRATES_IO_TOKEN }}
build-python-wheels:
name: Python wheels (${{ matrix.platform }})
needs: [publish-rust]
runs-on: ${{ matrix.platform }}
strategy:
matrix:
platform: [ubuntu-latest, ubuntu-22.04-arm, macos-latest, windows-latest]
steps:
- uses: actions/checkout@v7
- uses: actions/setup-python@v7
with:
python-version: "3.12"
- uses: dtolnay/rust-toolchain@stable
- name: Install build tools
run: pip install maturin wheel
- name: Build unified wheel (core + backtest + plugins)
run: maturin build --release --manifest-path quantwave-py/Cargo.toml --out dist
env:
MACOSX_DEPLOYMENT_TARGET: "11.0"
- name: Verify wheel tags match native extensions
run: python scripts/verify_wheel_tags.py dist/
- uses: actions/upload-artifact@v7
with:
name: wheels-${{ matrix.platform }}
path: dist/*.whl
verify-python-wheel:
name: Wheel smoke (${{ matrix.python-version }})
needs: [build-python-wheels]
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
python-version: ["3.9", "3.11", "3.12", "3.13"]
steps:
- uses: actions/checkout@v7
- uses: actions/download-artifact@v8
with:
name: wheels-ubuntu-latest
path: dist
- uses: actions/setup-python@v7
with:
python-version: ${{ matrix.python-version }}
- name: Install unified wheel and smoke test
run: |
pip install polars
pip install dist/quantwave-*.whl
python scripts/wheel_smoke_test.py
env:
PYTHONIOENCODING: utf-8
publish-python:
name: Publish Python (PyPI)
needs: [build-python-wheels, verify-python-wheel]
runs-on: ubuntu-latest
permissions:
# Required for PyPI OIDC trusted publishing (no PYPI_API_TOKEN).
id-token: write
steps:
- uses: actions/checkout@v7
- uses: actions/download-artifact@v8
with:
name: wheels-ubuntu-latest
path: dist
- uses: actions/download-artifact@v8
with:
name: wheels-ubuntu-22.04-arm
path: dist
- uses: actions/download-artifact@v8
with:
name: wheels-macos-latest
path: dist
- uses: actions/download-artifact@v8
with:
name: wheels-windows-latest
path: dist
- name: List wheels to publish
run: ls -la dist/
- name: Publish to PyPI (trusted publisher / OIDC)
uses: pypa/gh-action-pypi-publish@release/v1
with:
packages-dir: dist/
skip-existing: true
verbose: true