Files
DeepSeek-Reasonix/scripts/render-brew-cask.sh
T
esengine 7ac19b90c5 feat(release): npm and Homebrew follow the Studio line
The CLI had no install channel on the 2.x line: release-studio.yml builds the
CLI archives for Studio's remote installs, and npm's `reasonix` and the
Homebrew tap were published only by the retired 1.x release machinery. The
2.x line now takes both over, and 1.x no longer publishes the CLI.

A cli-channels job runs after the release is published:
- npm: the existing npm/build.mjs builds the per-platform packages and the
  launcher and publishes them through publish.mjs's staged dist-tag flow. A
  2.x version outranks every 1.x one, so `latest` moves to it; a candidate
  goes to `next`.
- Homebrew: scripts/render-brew-cask.sh writes the cask from the digests in
  the release's own SHA256SUMS — a missing digest fails the render rather
  than shipping an empty one — and the job pushes it to
  esengine/homebrew-reasonix. Candidates leave the tap alone, since brew has
  no prerelease channel.
2026-09-24 22:20:04 -07:00

68 lines
1.7 KiB
Bash
Executable File

#!/usr/bin/env bash
# Renders the Homebrew cask for one CLI release from the digest list the
# release published, so the cask can only name archives that list vouches for.
# usage: render-brew-cask.sh <version> <tag> <SHA256SUMS>
set -euo pipefail
version="$1" tag="$2" sums="$3"
base="https://github.com/esengine/DeepSeek-Reasonix/releases/download/${tag}"
digest() {
local d
d="$(awk -v f="$1" '$2 == f || $2 == "*" f { print $1 }' "$sums")"
if [[ ! "$d" =~ ^[0-9a-f]{64}$ ]]; then
echo "render-brew-cask: no digest for $1 in $sums" >&2
exit 1
fi
printf '%s' "$d"
}
darwin_arm64="$(digest reasonix-darwin-arm64.tar.gz)"
darwin_amd64="$(digest reasonix-darwin-amd64.tar.gz)"
linux_arm64="$(digest reasonix-linux-arm64.tar.gz)"
linux_amd64="$(digest reasonix-linux-amd64.tar.gz)"
cat <<EOF
# Generated by release-studio.yml from ${tag}'s SHA256SUMS. DO NOT EDIT.
cask "reasonix" do
postflight_steps do
if OS.mac?
system_command "/usr/bin/xattr", args: ["-dr", "com.apple.quarantine", "#{staged_path}/reasonix"]
end
end
version "${version}"
on_macos do
on_arm do
sha256 "${darwin_arm64}"
url "${base}/reasonix-darwin-arm64.tar.gz"
end
on_intel do
sha256 "${darwin_amd64}"
url "${base}/reasonix-darwin-amd64.tar.gz"
end
end
on_linux do
on_arm do
sha256 "${linux_arm64}"
url "${base}/reasonix-linux-arm64.tar.gz"
end
on_intel do
sha256 "${linux_amd64}"
url "${base}/reasonix-linux-amd64.tar.gz"
end
end
name "reasonix"
desc "Cache-first DeepSeek coding agent for the terminal."
homepage "https://github.com/esengine/DeepSeek-Reasonix"
livecheck do
skip "Auto-generated on release."
end
binary "reasonix"
end
EOF