返回 CodeWhale
update-homebrew-tap.test.sh
根目录 / .github / scripts / update-homebrew-tap.test.sh
1 #!/usr/bin/env bash
2 set -euo pipefail
3
4 repo_root="$(cd "$(dirname "${BASH_SOURCE[0]}")/../.." && pwd)"
5 tmp_dir="$(mktemp -d)"
6 trap 'rm -rf "${tmp_dir}"' EXIT
7
8 manifest="${tmp_dir}/codewhale-artifacts-sha256.txt"
9 formula="${tmp_dir}/deepseek-tui.rb"
10
11 assets=(
12 codewhale-macos-arm64
13 codew-macos-arm64
14 codewhale-tui-macos-arm64
15 codewhale-macos-x64
16 codew-macos-x64
17 codewhale-tui-macos-x64
18 codewhale-linux-arm64
19 codew-linux-arm64
20 codewhale-tui-linux-arm64
21 codewhale-linux-x64
22 codew-linux-x64
23 codewhale-tui-linux-x64
24 )
25
26 for asset in "${assets[@]}"; do
27 printf '%064d %s\n' 0 "${asset}" >> "${manifest}"
28 done
29
30 TAG=v1.2.3 \
31 MANIFEST="${manifest}" \
32 TAP_REPO=Hmbown/homebrew-deepseek-tui \
33 FORMULA_OUTPUT="${formula}" \
34 bash "${repo_root}/.github/scripts/update-homebrew-tap.sh"
35
36 ruby -c "${formula}" >/dev/null
37 grep -Fq 'desc "Agentic terminal for open-source and open-weight coding models"' "${formula}"
38 test "$(grep -Fc 'resource "codew" do' "${formula}")" -eq 4
39 grep -Fq 'bin.install Dir["*"].first => "codew"' "${formula}"
40 grep -Fq 'system "#{bin}/codew", "--version"' "${formula}"
41 grep -Fq 'system "#{bin}/codewhale-tui", "--version"' "${formula}"
42
43 echo "update-homebrew-tap tests passed"
44
44 lines BASH