fix(brew-release): pass brew audit (desc from repo metadata, no version line)
b712d71d66d5f758108300e240c727b90e8c428d
humdrum-tiv <45084903+humdrum-tiv@users.noreply.github.com> · 2026-06-17 21:43
parent a49070a4
fix(brew-release): pass brew audit (desc from repo metadata, no version line) - desc sourced from the repo's Soft Serve description, capitalized, name-stripped, trailing-period removed, shortened to <80 chars (drop parenthetical/em-dash clause, then word-boundary truncate) - drop redundant 'version' line (brew scans it from the URL) - tap docs use the 'humdrum' namespace Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2 files changed
- → Phase-4-Homebrew-tap-release-pipeline.md +2 −2
@@ -1,10 +1,10 @@
---
id: TASK-004
title: 'Phase 4: Homebrew tap + release pipeline'
-status: "\U0001F7E2 In progress"
+status: "\U0001F3C1 Done"
assignee: []
created_date: '2026-06-17 23:44'
-updated_date: '2026-06-18 04:18'
+updated_date: '2026-06-18 04:29'
labels:
- feature
dependencies: []
scripts/brew-release.sh +20 −3
@@ -31,6 +31,23 @@ URL="https://${DOMAIN}/dl/${TARBALL}"
HOMEPAGE="https://${DOMAIN}/r/${REPO}"
CLASS="$(echo "$REPO" | perl -pe 's/(^|[-_])(\w)/\U$2/g')" # sportsball → Sportsball, foo-bar → FooBar
+# Description from the repo's Soft Serve metadata (brew audit: must be capitalized
+# and not start with the formula name).
+DESC="$(ssh soft repo description "$REPO" 2>/dev/null | head -1)"
+[ -z "$DESC" ] && DESC="Command-line application"
+DESC="${DESC//\"/}" # no double quotes inside the ruby string
+shopt -s nocasematch
+if [[ "$DESC" == "$REPO"* ]]; then DESC="${DESC#"$REPO"}"; DESC="${DESC#"${DESC%%[![:punct:][:space:]]*}"}"; fi
+shopt -u nocasematch
+DESC="$(printf '%s' "$DESC" | perl -pe 's/^\s*(\w)/\U$1/')"
+# brew audit: no trailing period, < 80 chars. Trim a parenthetical / em-dash
+# clause to fit before hard-truncating at a word boundary.
+DESC="${DESC%.}"
+[ ${#DESC} -gt 78 ] && DESC="$(printf '%s' "$DESC" | perl -pe 's/\s*\([^)]*\)\s*$//')"
+[ ${#DESC} -gt 78 ] && DESC="${DESC%% — *}"
+if [ ${#DESC} -gt 78 ]; then DESC="${DESC:0:78}"; DESC="${DESC% *}"; fi
+DESC="$(printf '%s' "$DESC" | perl -pe 's/[[:punct:][:space:]]+$//')"
+
echo "==> archiving ${REPO}@${VERSION} from the server"
# Run as the repo owner so git doesn't reject "dubious ownership".
ssh "$REMOTE" "sudo -u ${RUN_USER} git -C '${REPOS_PATH}/${REPO}.git' archive --format=tar.gz --prefix='${REPO}-${VER}/' '${VERSION}'" > "/tmp/${TARBALL}"
@@ -48,11 +65,10 @@ mkdir -p "$TAP/Formula"
cat > "$TAP/Formula/${REPO}.rb" <<EOF
# Generated by custard brew-release.sh — do not edit by hand.
class ${CLASS} < Formula
- desc "${REPO}"
+ desc "${DESC}"
homepage "${HOMEPAGE}"
url "${URL}"
sha256 "${SHA}"
- version "${VER}"
license "AGPL-3.0-or-later"
depends_on "go" => :build
@@ -73,5 +89,6 @@ git -C "$TAP" push -q origin HEAD
rm -rf "$TAP"
echo "==> done"
-echo " brew tap you/tap https://${DOMAIN}/git/homebrew-tap.git"
+echo " brew tap humdrum/tap https://${DOMAIN}/git/homebrew-tap.git"
+echo " brew trust humdrum/tap"
echo " brew install ${REPO}"