Skip to content

Commit 50ebd08

Browse files
dfallmanclaude
andcommitted
Add Homebrew tap automation and install docs
- release.yml: move Intel-mac build to macos-15-intel (macos-13 retired), add aarch64-linux target, add tap-update job that regenerates Formula/texttv.rb in dfallman/homebrew-tap on every tagged release - README: document brew install - gitignore .DS_Store Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01AwA2N1pJuv7acWtSoXwzex
1 parent f10ca45 commit 50ebd08

3 files changed

Lines changed: 88 additions & 1 deletion

File tree

.github/workflows/release.yml

Lines changed: 79 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,11 +22,16 @@ jobs:
2222
- target: x86_64-unknown-linux-gnu
2323
os: ubuntu-latest
2424
archive: tar.gz
25+
- target: aarch64-unknown-linux-gnu
26+
os: ubuntu-24.04-arm
27+
archive: tar.gz
2528
- target: aarch64-apple-darwin
2629
os: macos-latest
2730
archive: tar.gz
31+
# macos-13 was retired in Dec 2025; macos-15-intel is the last
32+
# Intel image (supported until Fall 2027).
2833
- target: x86_64-apple-darwin
29-
os: macos-13
34+
os: macos-15-intel
3035
archive: tar.gz
3136
- target: x86_64-pc-windows-msvc
3237
os: windows-latest
@@ -74,3 +79,76 @@ jobs:
7479
files: ${{ env.ASSET }}
7580
generate_release_notes: true
7681
fail_on_unmatched_files: true
82+
83+
homebrew:
84+
name: Update Homebrew tap
85+
needs: build
86+
runs-on: ubuntu-latest
87+
steps:
88+
- name: Regenerate formula and push to dfallman/homebrew-tap
89+
env:
90+
GH_TOKEN: ${{ github.token }}
91+
# Fine-grained PAT with contents:write on dfallman/homebrew-tap.
92+
TAP_TOKEN: ${{ secrets.TAP_GITHUB_TOKEN }}
93+
run: |
94+
if [ -z "$TAP_TOKEN" ]; then
95+
echo "TAP_GITHUB_TOKEN secret not set; skipping tap update."
96+
exit 0
97+
fi
98+
tag="${GITHUB_REF_NAME}"
99+
version="${tag#v}"
100+
mkdir artifacts
101+
gh release download "$tag" --repo "$GITHUB_REPOSITORY" \
102+
--pattern '*.tar.gz' --dir artifacts
103+
sha() { shasum -a 256 "artifacts/texttv-${tag}-$1.tar.gz" | cut -d' ' -f1; }
104+
105+
git clone "https://x-access-token:${TAP_TOKEN}@github.com/dfallman/homebrew-tap.git" tap
106+
mkdir -p tap/Formula
107+
cat > tap/Formula/texttv.rb << EOF
108+
# typed: false
109+
# frozen_string_literal: true
110+
111+
# This formula is regenerated automatically by the release workflow in
112+
# dfallman/texttv (.github/workflows/release.yml) on every tagged release.
113+
class Texttv < Formula
114+
desc "Render SVT Text-TV (Swedish teletext) pages in the terminal"
115+
homepage "https://github.com/dfallman/texttv"
116+
version "${version}"
117+
license "MIT"
118+
119+
on_macos do
120+
if Hardware::CPU.arm?
121+
url "https://github.com/dfallman/texttv/releases/download/${tag}/texttv-${tag}-aarch64-apple-darwin.tar.gz"
122+
sha256 "$(sha aarch64-apple-darwin)"
123+
else
124+
url "https://github.com/dfallman/texttv/releases/download/${tag}/texttv-${tag}-x86_64-apple-darwin.tar.gz"
125+
sha256 "$(sha x86_64-apple-darwin)"
126+
end
127+
end
128+
129+
on_linux do
130+
if Hardware::CPU.arm?
131+
url "https://github.com/dfallman/texttv/releases/download/${tag}/texttv-${tag}-aarch64-unknown-linux-gnu.tar.gz"
132+
sha256 "$(sha aarch64-unknown-linux-gnu)"
133+
else
134+
url "https://github.com/dfallman/texttv/releases/download/${tag}/texttv-${tag}-x86_64-unknown-linux-gnu.tar.gz"
135+
sha256 "$(sha x86_64-unknown-linux-gnu)"
136+
end
137+
end
138+
139+
def install
140+
bin.install "texttv"
141+
end
142+
143+
test do
144+
assert_match version.to_s, shell_output("#{bin}/texttv --version")
145+
end
146+
end
147+
EOF
148+
cd tap
149+
git config user.name "github-actions[bot]"
150+
git config user.email "41898282+github-actions[bot]@users.noreply.github.com"
151+
git add Formula/texttv.rb
152+
git diff --cached --quiet && { echo "Formula unchanged."; exit 0; }
153+
git commit -m "texttv ${tag}"
154+
git push

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,3 +2,4 @@
22
.claude/
33
doc/
44
docs/
5+
.DS_Store

README.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,14 @@ A small and fast, yet decidedly over-engineered command-line and interactive vie
1616

1717
## Installation
1818

19+
### Homebrew (macOS and Linux)
20+
21+
```bash
22+
brew install dfallman/tap/texttv
23+
```
24+
25+
### From source
26+
1927
Make sure you have the latest version of Rust installed. Use [Rustup](https://rustup.rs/) rather than your package manager to install, as this ensures you'll get the latest version.
2028

2129
```bash

0 commit comments

Comments
 (0)