Skip to content

Commit f9b3598

Browse files
authored
Merge pull request #2 from libi/fix/support_iframe
try brew
2 parents 3b10f47 + 190a207 commit f9b3598

3 files changed

Lines changed: 20 additions & 2 deletions

File tree

.github/workflows/brew.yml

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,8 @@ permissions:
1212
jobs:
1313
brew:
1414
runs-on: ubuntu-latest
15+
env:
16+
HOMEBREW_TAP_REPOSITORY: ${{ vars.HOMEBREW_TAP_REPOSITORY }}
1517
steps:
1618
- uses: actions/checkout@v4
1719

@@ -21,7 +23,16 @@ jobs:
2123
run: |
2224
if [ -z "${HOMEBREW_TAP_GITHUB_TOKEN}" ]; then
2325
echo "HOMEBREW_TAP_GITHUB_TOKEN is not configured for this repository." >&2
24-
echo "Add a token with write access to libi/homebrew-tap in Settings > Secrets and variables > Actions." >&2
26+
echo "Add a token with write access to your Homebrew tap repository in Settings > Secrets and variables > Actions." >&2
27+
exit 1
28+
fi
29+
30+
- name: Validate tap repository
31+
run: |
32+
TAP_REPOSITORY="${HOMEBREW_TAP_REPOSITORY:-libi/homebrew-tap}"
33+
if ! git ls-remote "https://github.com/${TAP_REPOSITORY}.git" >/dev/null 2>&1; then
34+
echo "Homebrew tap repository not found: ${TAP_REPOSITORY}" >&2
35+
echo "Create the repository first, then set Actions variable HOMEBREW_TAP_REPOSITORY if you are not using libi/homebrew-tap." >&2
2536
exit 1
2637
fi
2738
@@ -30,10 +41,11 @@ jobs:
3041
TAG: ${{ github.ref_name }}
3142
HOMEBREW_TAP_GITHUB_TOKEN: ${{ secrets.HOMEBREW_TAP_GITHUB_TOKEN }}
3243
run: |
44+
TAP_REPOSITORY="${HOMEBREW_TAP_REPOSITORY:-libi/homebrew-tap}"
3345
curl -fsSL -o /tmp/ko-browser-src.tar.gz "https://github.com/libi/ko-browser/archive/refs/tags/${TAG}.tar.gz"
3446
SHA256=$(shasum -a 256 /tmp/ko-browser-src.tar.gz | awk '{print $1}')
3547
36-
git clone "https://x-access-token:${HOMEBREW_TAP_GITHUB_TOKEN}@github.com/libi/homebrew-tap.git" /tmp/homebrew-tap
48+
git clone "https://x-access-token:${HOMEBREW_TAP_GITHUB_TOKEN}@github.com/${TAP_REPOSITORY}.git" /tmp/homebrew-tap
3749
mkdir -p /tmp/homebrew-tap/Formula
3850
3951
./scripts/render-homebrew-formula.sh "${TAG}" "${SHA256}" > /tmp/homebrew-tap/Formula/ko-browser.rb

README-CN.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,10 +58,13 @@
5858
```bash
5959
brew tap libi/tap
6060
brew install ko-browser
61+
# 或者不先 tap,直接安装:
62+
brew install libi/tap/ko-browser
6163
```
6264

6365
> Homebrew 安装的是带 OCR 的 `kbr`
6466
> 它会自动安装 `tesseract`,并通过源码编译。
67+
> Tap 仓库是 [libi/homebrew-tap](https://github.com/libi/homebrew-tap)
6568
6669
### 预编译二进制
6770

README.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -69,10 +69,13 @@ Its custom accessibility-tree snapshot format reduces prompt footprint by **46%+
6969
```bash
7070
brew tap libi/tap
7171
brew install ko-browser
72+
# or without tapping first:
73+
brew install libi/tap/ko-browser
7274
```
7375

7476
> Homebrew installs `kbr` with OCR enabled.
7577
> It pulls in `tesseract` automatically and builds from source.
78+
> The tap repository is [libi/homebrew-tap](https://github.com/libi/homebrew-tap).
7679
7780
### Pre-built binaries
7881

0 commit comments

Comments
 (0)