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