From 726929f891833d6bb6beedcd3c4a2ca1da37623c Mon Sep 17 00:00:00 2001 From: Delta Cloud Runner Date: Fri, 27 Nov 2026 02:18:50 +0000 Subject: [PATCH] Package Orbit with Orbit --- README.md | 28 ++++++++++++++++++++++++++++ scripts/package-orbit.sh | 25 +++++++++++++++++++++++++ 2 files changed, 53 insertions(+) create mode 100644 scripts/package-orbit.sh diff --git a/README.md b/README.md index 18ccd73..73e1a4f 100644 --- a/README.md +++ b/README.md @@ -76,6 +76,34 @@ moon test --target native # semver / manifest unit tests Linux only for now: arguments come from `/proc/self/cmdline`. It needs `oras`, `tar` and `/bin/sh` on `PATH`. +### Package Orbit with Orbit + +From the repo root, build and stage the `orbit` package. The package version +comes from `moon.mod`; publishing is a separate step. + +```sh +package_dir=$(sh scripts/package-orbit.sh) && + _build/native/release/build/main/main.exe publish "$package_dir" +``` + +This publishes to the configured registry, so run `orbit init ` (or +set `ORBIT_REGISTRY`) first and log in with `oras login ` if needed. The +package contains a native Linux binary for the build machine's architecture. +Use the same architecture on the install machine. `oras` and `tar` are still +system prerequisites; the package does not bundle them. + +To bootstrap from source, install the published package with the binary you just +built. After adding Orbit's bin directory to `PATH`, use the installed binary +for future upgrades and rollbacks: + +```sh +bootstrap=_build/native/release/build/main/main.exe +"$bootstrap" install orbit +eval "$("$bootstrap" env)" +orbit upgrade orbit +# If needed: orbit rollback orbit +``` + ## Layout ``` diff --git a/scripts/package-orbit.sh b/scripts/package-orbit.sh new file mode 100644 index 0000000..4b5010f --- /dev/null +++ b/scripts/package-orbit.sh @@ -0,0 +1,25 @@ +#!/bin/sh +# Build and stage Orbit as an Orbit package. Print the staging path on stdout. +set -eu + +cd "$(dirname "$0")/.." +version=$(sed -n 's/^version[[:space:]]*=[[:space:]]*"\([0-9A-Za-z.+-]*\)"[[:space:]]*$/\1/p' moon.mod) +if [ -z "$version" ]; then + echo "Could not read Orbit's version from moon.mod" >&2 + exit 1 +fi + +moon build --target native --release >&2 +package_dir=$(mktemp -d "$PWD/_build/orbit-package.XXXXXX") +mkdir -p "$package_dir/files/bin" +install -m 755 _build/native/release/build/main/main.exe "$package_dir/files/bin/orbit" +cat > "$package_dir/orbit.json" <