Commit af94b80

Eric Bower  ·  2026-06-13 10:33:07 -0400 EDT
parent 609f4e3
chore(ci): generate homebrew file
3 files changed,  +66, -0
+37, -0
 1@@ -0,0 +1,37 @@
 2+class Zmx < Formula
 3+  desc "Session attach/detach for the terminal"
 4+  homepage "https://github.com/neurosnap/zmx"
 5+  version "{ver}"
 6+  license "MIT"
 7+
 8+  on_macos do
 9+    on_arm do
10+      url "https://zmx.sh/a/zmx-{ver}-macos-aarch64.tar.gz"
11+      sha256 "{shasum_macos-aarch64}"
12+    end
13+    on_intel do
14+      url "https://zmx.sh/a/zmx-{ver}-macos-x86_64.tar.gz"
15+      sha256 "{shasum_macos-x86_64}"
16+    end
17+  end
18+
19+  on_linux do
20+    on_arm do
21+      url "https://zmx.sh/a/zmx-{ver}-linux-aarch64.tar.gz"
22+      sha256 "{shasum_linux-aarch64}"
23+    end
24+    on_intel do
25+      url "https://zmx.sh/a/zmx-{ver}-linux-x86_64.tar.gz"
26+      sha256 "{shasum_linux-x86_64}"
27+    end
28+  end
29+
30+  def install
31+    bin.install "zmx"
32+    generate_completions_from_executable(bin/"zmx", "completions")
33+  end
34+
35+  test do
36+    assert_match "Usage: zmx", shell_output("#{bin}/zmx help")
37+  end
38+end
+28, -0
 1@@ -0,0 +1,28 @@
 2+#!/usr/bin/env bash
 3+set -euo pipefail
 4+
 5+VERSION="${1:?usage: generate-brew.sh <version>}"
 6+DIST="${2:-zig-out/dist}"
 7+
 8+if [[ ! -f brew.tmpl ]]; then
 9+  echo "error: brew.tmpl not found" >&2
10+  exit 1
11+fi
12+
13+shasum() {
14+  local platform="$1"
15+  local file="${DIST}/zmx-${VERSION}-${platform}.tar.gz.sha256"
16+  if [[ ! -f "$file" ]]; then
17+    echo "error: missing $file" >&2
18+    exit 1
19+  fi
20+  cut -d ' ' -f1 < "$file"
21+}
22+
23+sed \
24+  -e "s/{ver}/${VERSION}/g" \
25+  -e "s/{shasum_macos-aarch64}/$(shasum macos-aarch64)/" \
26+  -e "s/{shasum_macos-x86_64}/$(shasum macos-x86_64)/" \
27+  -e "s/{shasum_linux-aarch64}/$(shasum linux-aarch64)/" \
28+  -e "s/{shasum_linux-x86_64}/$(shasum linux-x86_64)/" \
29+  brew.tmpl
+1, -0
1@@ -23,6 +23,7 @@ NEW_VERSION="${PICO_CI_TAG_NAME#v}"
2 zmx run semver sed -i "s/\.version = \"[^\"]*\"/.version = \"$NEW_VERSION\"/" build.zig.zon && cat build.zig.zon
3 zmx run update-readme sed -i "s/zmx-[0-9][0-9]*\.[0-9][0-9]*\.[0-9][0-9]*/zmx-$NEW_VERSION/g" README.md
4 zmx run build-release -d docker run --rm -t zig-zmx:latest zig build release
5+zmx run brew -d bash gen-brew.sh "$NEW_VERSION"
6 
7 echo "distributing bins"
8 zmx run upload-build docker build -t zmx-upload -f Dockerfile.upload .