From 1ac894481d099d919320b5f07c890ee6f1cfeaaa Mon Sep 17 00:00:00 2001 From: Daniel Norman Date: Mon, 9 Nov 2026 14:09:27 +0100 Subject: [PATCH] httpd: Register the bundle in its own step - Move the explorer bundle build and registration to register-bundle - Keep register to the archives and their checksums - Add register-bundle as its own step in RELEASE.md - Drop -w explorer, which failed with "No workspaces found" --- explorer/RELEASE.md | 17 ++++--- explorer/crates/radicle-httpd/build/register | 29 +----------- .../radicle-httpd/build/register-bundle | 45 +++++++++++++++++++ 3 files changed, 59 insertions(+), 32 deletions(-) create mode 100755 explorer/crates/radicle-httpd/build/register-bundle diff --git a/explorer/RELEASE.md b/explorer/RELEASE.md index 7dd9a0d16..f2657d4dd 100644 --- a/explorer/RELEASE.md +++ b/explorer/RELEASE.md @@ -169,16 +169,23 @@ the archives. 3. Register the archives with radicle-artifact, in the release of the tag. This records each archive's files.radicle.dev URL and `sha256`. If you publish the archives that `fetch` downloaded into `artifacts/`, it also records their - Buildkite build. It also builds the explorer frontend bundle from the checked - out tag with `config/default.json`, registers it as the collection - `radicle-explorer` and seeds it from your local artifact node. This needs - `node` and `npm`, in the version of `.nvmrc`, and no untracked files in - `config/`, such as `local.json`. Running it again changes nothing: + Buildkite build. Running it again changes nothing: ```sh crates/radicle-httpd/build/register ``` +4. Register the explorer frontend bundle. This builds it from the checked out + tag with `config/default.json`, registers it as the collection + `radicle-explorer` in the release of the tag and seeds it from your local + artifact node. This needs `node` and `npm`, in the version of `.nvmrc`, and + no untracked files in `config/`, such as `local.json`. Running it again + changes nothing: + + ```sh + crates/radicle-httpd/build/register-bundle + ``` + ## Attest (recommended) Other delegates check the release by building it themselves. `attest` compares diff --git a/explorer/crates/radicle-httpd/build/register b/explorer/crates/radicle-httpd/build/register index ab8c416f3..bcdb42f0d 100755 --- a/explorer/crates/radicle-httpd/build/register +++ b/explorer/crates/radicle-httpd/build/register @@ -3,28 +3,19 @@ set -e # Registers the archives in `artifacts/` with radicle-artifact, in the release # of the tag `releases/httpd/`, with their files.radicle.dev URLs and -# checksums. It also builds the explorer bundle from the checked out tag with -# config/default.json, registers it as a collection and seeds it from the local -# artifact node. Run it after `upload`. Running it again changes nothing. +# checksums. Run it after `upload`. Running it again changes nothing. outdir="$(dirname "$0")/artifacts" -explorer="$(cd "$(dirname "$0")/../../.." && pwd)" version="$("$(dirname "$0")/version")" tag="releases/httpd/$version" -for tool in git npm rad rad-artifact jq; do +for tool in rad rad-artifact jq sha256sum; do if ! command -v "$tool" >/dev/null; then echo "fatal: $tool is not installed" >&2 exit 1 fi done -# node-config also loads untracked files such as config/local.json. -if [ -n "$(git -C "$explorer" ls-files --others config)" ]; then - echo "fatal: $explorer/config has untracked files, remove them" >&2 - exit 1 -fi - rad auth artifact() { @@ -54,21 +45,5 @@ for target in $(cat "$(dirname "$0")/TARGETS"); do done done -echo "Building the explorer bundle.." -( - cd "$explorer" - unset NODE_CONFIG NODE_CONFIG_ENV NODE_CONFIG_DIR VITE_RUNTIME_CONFIG - npm ci -w explorer --no-audit --no-fund - npm run build -) - -if ! rad-artifact node status >/dev/null 2>&1; then - rad-artifact node start -fi - -echo "Registering the explorer bundle.." -artifact register "$explorer/build" --collection -n radicle-explorer \ - --revision "$tag" --seed >/dev/null - rad sync --announce echo "Registration successful." diff --git a/explorer/crates/radicle-httpd/build/register-bundle b/explorer/crates/radicle-httpd/build/register-bundle new file mode 100755 index 000000000..7616ea92b --- /dev/null +++ b/explorer/crates/radicle-httpd/build/register-bundle @@ -0,0 +1,45 @@ +#!/bin/sh +set -e + +# Builds the explorer bundle from the checked out tag `releases/httpd/` +# with config/default.json, registers it as the collection `radicle-explorer` in +# the release of the tag and seeds it from the local artifact node. Run it after +# `register`. Running it again changes nothing. + +explorer="$(cd "$(dirname "$0")/../../.." && pwd)" +version="$("$(dirname "$0")/version")" +tag="releases/httpd/$version" + +for tool in git npm rad rad-artifact; do + if ! command -v "$tool" >/dev/null; then + echo "fatal: $tool is not installed" >&2 + exit 1 + fi +done + +# node-config also loads untracked files such as config/local.json. +if [ -n "$(git -C "$explorer" ls-files --others config)" ]; then + echo "fatal: $explorer/config has untracked files, remove them" >&2 + exit 1 +fi + +rad auth + +echo "Building the explorer bundle.." +( + cd "$explorer" + unset NODE_CONFIG NODE_CONFIG_ENV NODE_CONFIG_DIR VITE_RUNTIME_CONFIG + npm ci --no-audit --no-fund + npm run build +) + +if ! rad-artifact node status >/dev/null 2>&1; then + rad-artifact node start +fi + +echo "Registering the explorer bundle.." +rad-artifact --no-announce --no-input register "$explorer/build" --collection \ + -n radicle-explorer --revision "$tag" --seed >/dev/null + +rad sync --announce +echo "Registration successful."