From 95a6bd51e190275527b387e5dad69dd3b8a83dd7 Mon Sep 17 00:00:00 2001 From: Aaron Schlesinger <70865+arschles@users.noreply.github.com> Date: Sun, 19 Jul 2026 17:47:44 -0700 Subject: [PATCH] Adding upload-beta-install-script logic --- cli/mise.toml | 13 +++++++++++-- cli/scripts/upload-install-beta-script-r2.sh | 20 ++++++++++++++++++++ 2 files changed, 31 insertions(+), 2 deletions(-) create mode 100644 cli/scripts/upload-install-beta-script-r2.sh diff --git a/cli/mise.toml b/cli/mise.toml index 80a1f28..9ed7f92 100644 --- a/cli/mise.toml +++ b/cli/mise.toml @@ -45,11 +45,20 @@ run="cargo run --example http_client" [tasks.publish-cli-r2] run="gh workflow run cli-release.yml" -# upload only the install script to R2; use this when installer logic changes -# but the already-published CLI release artifact does not need to be rebuilt +# Upload only the install script to R2. +# +# Use this when installer logic changes, but the already-published CLI release +# artifact does not need to be rebuilt. [tasks.upload-install-script-r2] run="bash scripts/upload-install-script-r2.sh" +# Upload only the beta install script to R2. +# +# Use this when beta installer logic changes but the already-published beta CLI +# artifacts do not need to be rebuilt. +[tasks.upload-install-beta-script-r2] +run="bash scripts/upload-install-beta-script-r2.sh" + # lint shell scripts [tasks.shellcheck] run="shellcheck scripts/*.sh" diff --git a/cli/scripts/upload-install-beta-script-r2.sh b/cli/scripts/upload-install-beta-script-r2.sh new file mode 100644 index 0000000..e30ca97 --- /dev/null +++ b/cli/scripts/upload-install-beta-script-r2.sh @@ -0,0 +1,20 @@ +#!/usr/bin/env bash +set -euo pipefail + +bucket="${QT_R2_BUCKET:-quantiles-cli}" +dist_dir="${QT_DIST_DIR:-dist}" + +if ! command -v wrangler >/dev/null 2>&1; then + echo "wrangler is required to publish to Cloudflare R2" >&2 + exit 1 +fi + +mkdir -p "$dist_dir" +install_script="${dist_dir}/install-beta.sh" + +cp scripts/install-beta.sh "$install_script" +chmod +x "$install_script" + +wrangler r2 object put "${bucket}/install-beta.sh" --file "$install_script" --remote --cache-control "no-store" + +echo "published beta installer to r2://${bucket}/install-beta.sh"