Fix public binary install flow

This commit is contained in:
andrew 2026-04-11 02:19:21 +03:00
parent cbb312e74f
commit 816b24d05e
8 changed files with 75 additions and 40 deletions

View file

@ -35,7 +35,7 @@ jobs:
include:
- runner: ubuntu-latest
asset_name: omnigraph-linux-x86_64
- runner: macos-13
- runner: macos-15-intel
asset_name: omnigraph-macos-x86_64
- runner: macos-14
asset_name: omnigraph-macos-arm64

View file

@ -18,7 +18,7 @@ jobs:
include:
- runner: ubuntu-latest
asset_name: omnigraph-linux-x86_64
- runner: macos-13
- runner: macos-15-intel
asset_name: omnigraph-macos-x86_64
- runner: macos-14
asset_name: omnigraph-macos-arm64

View file

@ -8,30 +8,30 @@ workflows, and storage that runs equally well on a local directory or an
## Quick Install
```bash
curl -fsSL https://raw.githubusercontent.com/ModernRelay/omnigraph-public/main/scripts/install.sh | bash
curl -fsSL https://raw.githubusercontent.com/ModernRelay/omnigraph/main/scripts/install.sh | bash
```
This installs `omnigraph` and `omnigraph-server` into `~/.local/bin` from
published release binaries. It does not compile from source.
If the stable channel is not published yet, use the `edge` channel below.
published release binaries. It does not compile from source. If no stable tag
is published yet, the installer automatically falls back to the rolling `edge`
release.
To install the rolling prerelease binaries from `main` instead:
```bash
curl -fsSL https://raw.githubusercontent.com/ModernRelay/omnigraph-public/main/scripts/install.sh | RELEASE_CHANNEL=edge bash
curl -fsSL https://raw.githubusercontent.com/ModernRelay/omnigraph/main/scripts/install.sh | RELEASE_CHANNEL=edge bash
```
If you want a source build, use:
```bash
curl -fsSL https://raw.githubusercontent.com/ModernRelay/omnigraph-public/main/scripts/install-source.sh | bash
curl -fsSL https://raw.githubusercontent.com/ModernRelay/omnigraph/main/scripts/install-source.sh | bash
```
## One-Command Local RustFS Bootstrap
```bash
curl -fsSL https://raw.githubusercontent.com/ModernRelay/omnigraph-public/main/scripts/local-rustfs-bootstrap.sh | bash
curl -fsSL https://raw.githubusercontent.com/ModernRelay/omnigraph/main/scripts/local-rustfs-bootstrap.sh | bash
```
That bootstrap:

View file

@ -40,7 +40,7 @@ omnigraph-server s3://my-bucket/repos/example/releases/2026-04-10-v0.1.0 \
The easiest local S3-backed deployment path is:
```bash
curl -fsSL https://raw.githubusercontent.com/ModernRelay/omnigraph-public/main/scripts/local-rustfs-bootstrap.sh | bash
curl -fsSL https://raw.githubusercontent.com/ModernRelay/omnigraph/main/scripts/local-rustfs-bootstrap.sh | bash
```
The bootstrap:
@ -53,7 +53,7 @@ The bootstrap:
Supported behavior:
- downloads the rolling `edge` binary when one exists for the current platform
- otherwise clones `ModernRelay/omnigraph-public` and builds from source
- otherwise clones `ModernRelay/omnigraph` and builds from source
- reuses an existing RustFS container if it is already running
Useful overrides:

View file

@ -3,7 +3,7 @@
## Quick Install
```bash
curl -fsSL https://raw.githubusercontent.com/ModernRelay/omnigraph-public/main/scripts/install.sh | bash
curl -fsSL https://raw.githubusercontent.com/ModernRelay/omnigraph/main/scripts/install.sh | bash
```
By default the installer places:
@ -15,26 +15,27 @@ in `~/.local/bin`.
The default installer is binary-only. It downloads a published release asset,
verifies the SHA256 checksum, and unpacks it. It does not build from source.
If the stable channel is not published yet, use the `edge` channel below.
If no stable tag is published yet, the installer automatically falls back to
the rolling `edge` release.
## Channels
Stable binaries:
```bash
curl -fsSL https://raw.githubusercontent.com/ModernRelay/omnigraph-public/main/scripts/install.sh | bash
curl -fsSL https://raw.githubusercontent.com/ModernRelay/omnigraph/main/scripts/install.sh | bash
```
Rolling edge binaries from `main`:
```bash
curl -fsSL https://raw.githubusercontent.com/ModernRelay/omnigraph-public/main/scripts/install.sh | RELEASE_CHANNEL=edge bash
curl -fsSL https://raw.githubusercontent.com/ModernRelay/omnigraph/main/scripts/install.sh | RELEASE_CHANNEL=edge bash
```
Install from source:
```bash
curl -fsSL https://raw.githubusercontent.com/ModernRelay/omnigraph-public/main/scripts/install-source.sh | bash
curl -fsSL https://raw.githubusercontent.com/ModernRelay/omnigraph/main/scripts/install-source.sh | bash
```
## Useful Overrides
@ -42,19 +43,19 @@ curl -fsSL https://raw.githubusercontent.com/ModernRelay/omnigraph-public/main/s
Install to a different directory:
```bash
curl -fsSL https://raw.githubusercontent.com/ModernRelay/omnigraph-public/main/scripts/install.sh | INSTALL_DIR="$HOME/bin" bash
curl -fsSL https://raw.githubusercontent.com/ModernRelay/omnigraph/main/scripts/install.sh | INSTALL_DIR="$HOME/bin" bash
```
Install a specific tag:
```bash
curl -fsSL https://raw.githubusercontent.com/ModernRelay/omnigraph-public/main/scripts/install.sh | VERSION=v0.1.0 bash
curl -fsSL https://raw.githubusercontent.com/ModernRelay/omnigraph/main/scripts/install.sh | VERSION=v0.1.0 bash
```
Build from a specific git ref:
```bash
curl -fsSL https://raw.githubusercontent.com/ModernRelay/omnigraph-public/main/scripts/install-source.sh | SOURCE_REF=main bash
curl -fsSL https://raw.githubusercontent.com/ModernRelay/omnigraph/main/scripts/install-source.sh | SOURCE_REF=main bash
```
## Manual Source Build

View file

@ -1,7 +1,7 @@
#!/usr/bin/env bash
set -euo pipefail
REPO_SLUG="${REPO_SLUG:-ModernRelay/omnigraph-public}"
REPO_SLUG="${REPO_SLUG:-ModernRelay/omnigraph}"
SOURCE_REF="${SOURCE_REF:-main}"
INSTALL_DIR="${INSTALL_DIR:-$HOME/.local/bin}"
TMP_ROOT="${TMPDIR:-/tmp}"

View file

@ -1,12 +1,13 @@
#!/usr/bin/env bash
set -euo pipefail
REPO_SLUG="${REPO_SLUG:-ModernRelay/omnigraph-public}"
REPO_SLUG="${REPO_SLUG:-ModernRelay/omnigraph}"
INSTALL_DIR="${INSTALL_DIR:-$HOME/.local/bin}"
RELEASE_CHANNEL="${RELEASE_CHANNEL:-stable}"
VERSION="${VERSION:-}"
TMP_ROOT="${TMPDIR:-/tmp}"
WORKDIR=""
SELECTED_CHANNEL=""
log() {
printf '==> %s\n' "$*"
@ -61,12 +62,14 @@ checksum_command() {
}
release_base_url() {
local channel="${1:-$RELEASE_CHANNEL}"
if [ -n "$VERSION" ]; then
printf 'https://github.com/%s/releases/download/%s\n' "$REPO_SLUG" "$VERSION"
return
fi
case "$RELEASE_CHANNEL" in
case "$channel" in
stable)
printf 'https://github.com/%s/releases/latest/download\n' "$REPO_SLUG"
;;
@ -74,7 +77,7 @@ release_base_url() {
printf 'https://github.com/%s/releases/download/edge\n' "$REPO_SLUG"
;;
*)
die "unsupported RELEASE_CHANNEL '$RELEASE_CHANNEL' (expected stable or edge)"
die "unsupported RELEASE_CHANNEL '$channel' (expected stable or edge)"
;;
esac
}
@ -99,22 +102,46 @@ verify_checksum() {
[ "$actual" = "$expected" ] || die "checksum verification failed for $(basename "$archive")"
}
download_release_files() {
local base_url="$1"
local asset_name="$2"
local checksum_name="$3"
local archive="$4"
local checksum="$5"
curl -fsSL "$base_url/$asset_name" -o "$archive" || return 1
curl -fsSL "$base_url/$checksum_name" -o "$checksum" || return 1
}
install_from_release() {
local asset archive checksum base_url
local asset asset_stem archive checksum base_url
asset="$(platform_asset_name)" || die "no prebuilt binary is available for $(uname -s)/$(uname -m)"
asset_stem="${asset%.tar.gz}"
WORKDIR="$(mktemp -d "$TMP_ROOT/omnigraph-install.XXXXXX")"
archive="$WORKDIR/$asset"
checksum="$WORKDIR/$asset.sha256"
base_url="$(release_base_url)"
checksum="$WORKDIR/$asset_stem.sha256"
log "Downloading $asset"
curl -fsSL \
"$base_url/$asset" \
-o "$archive" || die "no published binary found for $asset; use scripts/install-source.sh or build from source"
curl -fsSL \
"$base_url/$asset.sha256" \
-o "$checksum" || die "checksum file for $asset was not found"
if [ -n "$VERSION" ]; then
SELECTED_CHANNEL="$VERSION"
base_url="$(release_base_url)"
log "Downloading $asset from $VERSION"
download_release_files "$base_url" "$asset" "$asset_stem.sha256" "$archive" "$checksum" || die "no published binary found for $asset at release $VERSION"
else
SELECTED_CHANNEL="$RELEASE_CHANNEL"
base_url="$(release_base_url "$SELECTED_CHANNEL")"
log "Downloading $asset from $SELECTED_CHANNEL"
if ! download_release_files "$base_url" "$asset" "$asset_stem.sha256" "$archive" "$checksum"; then
if [ "$RELEASE_CHANNEL" != "stable" ]; then
die "no published binary found for $asset on channel $RELEASE_CHANNEL"
fi
log "Stable release binaries are not published yet; falling back to edge"
SELECTED_CHANNEL="edge"
base_url="$(release_base_url "$SELECTED_CHANNEL")"
download_release_files "$base_url" "$asset" "$asset_stem.sha256" "$archive" "$checksum" || die "no published binary found for $asset on stable or edge; use scripts/install-source.sh or build from source"
fi
fi
verify_checksum "$archive" "$checksum"
tar -C "$WORKDIR" -xzf "$archive" || die "failed to unpack $asset"
@ -134,6 +161,10 @@ Verify:
EOF
if [ -n "$SELECTED_CHANNEL" ]; then
printf 'Installed from release channel: %s\n' "$SELECTED_CHANNEL"
fi
case ":$PATH:" in
*":$INSTALL_DIR:"*)
;;

View file

@ -1,7 +1,7 @@
#!/usr/bin/env bash
set -euo pipefail
REPO_SLUG="${REPO_SLUG:-ModernRelay/omnigraph-public}"
REPO_SLUG="${REPO_SLUG:-ModernRelay/omnigraph}"
SOURCE_REF="${SOURCE_REF:-main}"
RELEASE_CHANNEL="${RELEASE_CHANNEL:-edge}"
WORKDIR="${WORKDIR:-$PWD/.omnigraph-rustfs-demo}"
@ -162,14 +162,15 @@ download_fixture_files() {
}
download_release_binaries() {
local asset archive_dir archive_path checksum_path base_url
local asset asset_stem archive_dir archive_path checksum_path base_url
[ "$FORCE_BUILD" = "1" ] && return 1
asset="$(platform_asset_name)" || return 1
asset_stem="${asset%.tar.gz}"
archive_dir="$WORKDIR/release"
archive_path="$archive_dir/$asset"
checksum_path="$archive_dir/$asset.sha256"
checksum_path="$archive_dir/$asset_stem.sha256"
mkdir -p "$archive_dir" "$WORKDIR/bin"
base_url="$(release_base_url)"
@ -178,7 +179,7 @@ download_release_binaries() {
"$base_url/$asset" \
-o "$archive_path" || return 1
curl -fsSL \
"$base_url/$asset.sha256" \
"$base_url/$asset_stem.sha256" \
-o "$checksum_path" || return 1
verify_checksum "$archive_path" "$checksum_path" || return 1
tar -C "$WORKDIR/bin" -xzf "$archive_path" || return 1
@ -231,10 +232,12 @@ setup_binaries() {
elif [ -n "$repo_root" ]; then
FIXTURE_DIR="$repo_root/crates/omnigraph/tests/fixtures"
fi
elif [ -n "$repo_root" ]; then
build_from_source "$repo_root"
elif ! download_release_binaries; then
build_from_source
if [ -n "$repo_root" ]; then
build_from_source "$repo_root"
else
build_from_source
fi
fi
[ -x "$BIN_DIR/omnigraph" ] || die "omnigraph binary not found in $BIN_DIR"