Self-contained binary · diffbot/diffbot-python@fc3dfde · GitHub
Skip to content

Commit fc3dfde

Browse files
committed
Self-contained binary
1 parent 6fba298 commit fc3dfde

7 files changed

Lines changed: 458 additions & 1 deletion

File tree

.github/workflows/release.yml

Lines changed: 97 additions & 0 deletions

.github/workflows/tests.yml

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,3 +45,26 @@ jobs:
4545

4646
- name: Run tests
4747
run: uv run pytest
48+
49+
# Smoke-test the standalone binary build so scripts/build_binary.sh can't
50+
# silently break between releases. The release workflow builds the full
51+
# cross-platform matrix; here we just prove the x86_64 Linux build works.
52+
build-binary:
53+
runs-on: ubuntu-latest
54+
steps:
55+
- uses: actions/checkout@v4
56+
57+
- name: Install uv
58+
uses: astral-sh/setup-uv@v5
59+
with:
60+
python-version: "3.12"
61+
62+
- name: Build standalone db binary
63+
run: ./scripts/build_binary.sh
64+
65+
- name: Verify checksum
66+
working-directory: dist
67+
run: sha256sum -c db-linux-x86_64.sha256
68+
69+
- name: Smoke-test binary
70+
run: ./dist/db-linux-x86_64 --version

README.md

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -202,6 +202,20 @@ uv tool install .
202202

203203
This drops a `db` executable into `~/.local/bin` (ensure it is on your `PATH`). Use `--force` to reinstall or upgrade after changes, or `--editable` to have source edits take effect immediately. Alternatively, a plain `pip install .` (or `pip install -e .`) also installs the `db` entry point into the active environment.
204204

205+
### Standalone binary (no Python required)
206+
207+
Every release also ships a self-contained `db` binary for Linux and macOS (x86_64 and aarch64/arm64) — no Python install needed. The installer detects your platform, verifies the SHA256 checksum, and installs (or upgrades) `db` into `~/.local/bin`:
208+
209+
```bash
210+
curl -fsSL https://raw.githubusercontent.com/diffbot/diffbot-python/main/install.sh | sh
211+
```
212+
213+
Pin a specific release or install location with flags (or the `DB_VERSION` / `DB_INSTALL_DIR` environment variables); re-running the installer upgrades an existing install in place:
214+
215+
```bash
216+
curl -fsSL https://raw.githubusercontent.com/diffbot/diffbot-python/main/install.sh | sh -s -- --version v0.2.1 --bin-dir ~/bin
217+
```
218+
205219
```bash
206220
export DIFFBOT_API_TOKEN=your-token-here
207221

install.sh

Lines changed: 171 additions & 0 deletions

0 commit comments

Comments
 (0)