From 816b24d05ed1aa4e33435f62e7ec993aba6e0572 Mon Sep 17 00:00:00 2001 From: andrew Date: Sat, 11 Apr 2026 02:19:21 +0300 Subject: [PATCH] Fix public binary install flow --- .github/workflows/release-edge.yml | 2 +- .github/workflows/release.yml | 2 +- README.md | 14 ++++---- docs/deployment.md | 4 +-- docs/install.md | 17 ++++----- scripts/install-source.sh | 2 +- scripts/install.sh | 57 +++++++++++++++++++++++------- scripts/local-rustfs-bootstrap.sh | 17 +++++---- 8 files changed, 75 insertions(+), 40 deletions(-) diff --git a/.github/workflows/release-edge.yml b/.github/workflows/release-edge.yml index 6c6a57e..ec01abc 100644 --- a/.github/workflows/release-edge.yml +++ b/.github/workflows/release-edge.yml @@ -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 diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index ec2e3f6..d535ba8 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -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 diff --git a/README.md b/README.md index ae184c2..6dd757f 100644 --- a/README.md +++ b/README.md @@ -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: diff --git a/docs/deployment.md b/docs/deployment.md index 4f01295..1c834f1 100644 --- a/docs/deployment.md +++ b/docs/deployment.md @@ -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: diff --git a/docs/install.md b/docs/install.md index c8b2b72..2be6c3e 100644 --- a/docs/install.md +++ b/docs/install.md @@ -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 diff --git a/scripts/install-source.sh b/scripts/install-source.sh index 7390587..567e9a2 100755 --- a/scripts/install-source.sh +++ b/scripts/install-source.sh @@ -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}" diff --git a/scripts/install.sh b/scripts/install.sh index 456934c..0269767 100755 --- a/scripts/install.sh +++ b/scripts/install.sh @@ -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:"*) ;; diff --git a/scripts/local-rustfs-bootstrap.sh b/scripts/local-rustfs-bootstrap.sh index 4858d98..bb495a2 100755 --- a/scripts/local-rustfs-bootstrap.sh +++ b/scripts/local-rustfs-bootstrap.sh @@ -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"