Skip to content

Commit 3a32964

Browse files
committed
fix: update README PyPI install instructions and add release workflow
1 parent e9a9c39 commit 3a32964

2 files changed

Lines changed: 86 additions & 4 deletions

File tree

.github/workflows/release.yml

Lines changed: 82 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,82 @@
1+
name: Release
2+
3+
on:
4+
push:
5+
tags:
6+
- 'v*'
7+
8+
permissions:
9+
contents: read
10+
11+
jobs:
12+
build_wheels:
13+
name: Build wheels on ${{ matrix.os }}
14+
runs-on: ${{ matrix.os }}
15+
strategy:
16+
matrix:
17+
os: [ubuntu-latest, windows-latest, macos-latest]
18+
19+
steps:
20+
- uses: actions/checkout@v4
21+
22+
# Host Rust installation (for Windows/macOS)
23+
- name: Install Rust
24+
if: runner.os != 'Linux'
25+
run: |
26+
rustup update stable
27+
28+
- name: Build wheels
29+
uses: pypa/cibuildwheel@v2.16.5
30+
env:
31+
# Only build for Python 3.10+ as per pyproject.toml
32+
CIBW_BUILD: "cp310-* cp311-* cp312-* cp313-*"
33+
34+
# Target platforms
35+
CIBW_ARCHS_LINUX: x86_64
36+
CIBW_ARCHS_MACOS: x86_64 arm64
37+
CIBW_ARCHS_WINDOWS: AMD64
38+
39+
# Linux: Install Rust in the manylinux/musllinux container
40+
CIBW_BEFORE_ALL_LINUX: "curl https://sh.rustup.rs -sSf | sh -s -- -y --default-toolchain stable --profile minimal"
41+
CIBW_ENVIRONMENT_LINUX: 'PATH="$PATH:$HOME/.cargo/bin"'
42+
43+
# Build backend verification
44+
CIBW_BUILD_FRONTEND: build
45+
46+
- uses: actions/upload-artifact@v4
47+
with:
48+
name: cibw-wheels-${{ matrix.os }}-${{ strategy.job-index }}
49+
path: ./wheelhouse/*.whl
50+
51+
build_sdist:
52+
name: Build source distribution
53+
runs-on: ubuntu-latest
54+
steps:
55+
- uses: actions/checkout@v4
56+
57+
- name: Build sdist
58+
run: pipx run build --sdist
59+
60+
- uses: actions/upload-artifact@v4
61+
with:
62+
name: cibw-sdist
63+
path: dist/*.tar.gz
64+
65+
publish_to_pypi:
66+
needs: [build_wheels, build_sdist]
67+
runs-on: ubuntu-latest
68+
environment:
69+
name: pypi
70+
url: https://pypi.org/p/binary-semantic-cache
71+
permissions:
72+
id-token: write # IMPORTANT: Mandatory for trusted publishing
73+
steps:
74+
- uses: actions/download-artifact@v4
75+
with:
76+
pattern: cibw-*
77+
path: dist
78+
merge-multiple: true
79+
80+
- name: Publish to PyPI
81+
uses: pypa/gh-action-pypi-publish@release/v1
82+

README.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -31,13 +31,13 @@ Most semantic caches are slow (Python-only), heavy (require VectorDB), or comple
3131

3232
### 1. Installation
3333

34-
**Prerequisites:** Python 3.10+ and Rust (for source build).
34+
**Prerequisites:** Python 3.10+. Rust is only needed for source builds.
3535

3636
```bash
37-
# Option A: From PyPI (Coming Soon)
38-
# pip install "binary-semantic-cache[openai]"
37+
# Option A: From PyPI (Recommended)
38+
pip install "binary-semantic-cache[openai]"
3939

40-
# Option B: From Source (Recommended for Beta)
40+
# Option B: From Source (Development)
4141
git clone https://github.com/matte1782/binary_semantic_cache.git
4242
cd binary_semantic_cache
4343
pip install maturin

0 commit comments

Comments
 (0)