chore(main): release browse 0.16.0 #276
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: CI | |
| on: | |
| push: | |
| branches: [main] | |
| pull_request: | |
| branches: [main] | |
| jobs: | |
| test: | |
| strategy: | |
| matrix: | |
| include: | |
| - os: ubuntu-latest | |
| label: linux-x64 | |
| - os: ubuntu-24.04-arm | |
| label: linux-arm64 | |
| - os: macos-15-intel | |
| label: macos-intel | |
| - os: macos-14 | |
| label: macos-arm64 | |
| runs-on: ${{ matrix.os }} | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| - name: Install Bun | |
| run: | | |
| curl -fsSL https://bun.sh/install | bash | |
| echo "$HOME/.bun/bin" >> "$GITHUB_PATH" | |
| - name: Install dependencies | |
| run: bun install | |
| - name: Install browser binaries (Linux ARM64) | |
| if: matrix.label == 'linux-arm64' | |
| run: | | |
| bun x patchright install chromium --with-deps | |
| chromium_dir=$(ls -1dt "$HOME"/.cache/ms-playwright/chromium-* | head -n 1) | |
| chromium_path="$chromium_dir/chrome-linux/chrome" | |
| [ -x "$chromium_path" ] | |
| sudo mkdir -p /opt/google/chrome /usr/local/bin | |
| sudo ln -sf "$chromium_path" /opt/google/chrome/chrome | |
| sudo ln -sf /opt/google/chrome/chrome /usr/local/bin/google-chrome | |
| sudo ln -sf /opt/google/chrome/chrome /usr/local/bin/google-chrome-stable | |
| google-chrome --version | |
| - name: Install browser binaries (Linux) | |
| if: runner.os == 'Linux' && matrix.label != 'linux-arm64' | |
| run: bun x patchright install chrome --with-deps | |
| - name: Install browser binaries (macOS) | |
| if: runner.os != 'Linux' | |
| run: bun x patchright install chrome | |
| - name: Run tests | |
| run: bun test | |
| - name: Run fuzz tests | |
| run: bun run test:fuzz | |
| - name: Compile binary | |
| run: bun build --compile ./src/cli.ts --outfile dist/browse --external electron --external chromium-bidi | |
| - name: Smoke test source CLI (Linux ARM64) | |
| if: matrix.label == 'linux-arm64' | |
| id: smoke_source_arm64 | |
| continue-on-error: true | |
| run: | | |
| rm -f /tmp/browse-daemon.pid /tmp/browse-daemon.sock "${XDG_STATE_HOME:-$HOME/.local/state}/browse/daemon.token" | |
| bun ./src/cli.ts --daemon --browser chrome >/tmp/browse-source-daemon.log 2>&1 & | |
| daemon_pid=$! | |
| cleanup() { | |
| bun ./src/cli.ts quit >/dev/null 2>&1 || true | |
| kill "$daemon_pid" >/dev/null 2>&1 || true | |
| } | |
| trap cleanup EXIT | |
| for i in $(seq 1 100); do | |
| [ -S /tmp/browse-daemon.sock ] && break | |
| sleep 0.1 | |
| done | |
| [ -S /tmp/browse-daemon.sock ] || { cat /tmp/browse-source-daemon.log; echo "Source daemon failed to start"; exit 1; } | |
| output=$(bun ./src/cli.ts --browser chrome goto 'data:text/html,<title>CI</title><h1>CI</h1>' 2>&1 || true) | |
| echo "$output" | |
| echo "$output" | grep -q "CI" || { cat /tmp/browse-source-daemon.log; echo "Source CLI smoke failed: expected 'CI' in output"; exit 1; } | |
| - name: Smoke test binary (Linux ARM64) | |
| if: matrix.label == 'linux-arm64' | |
| id: smoke_binary_arm64 | |
| continue-on-error: true | |
| run: | | |
| rm -f /tmp/browse-daemon.pid /tmp/browse-daemon.sock "${XDG_STATE_HOME:-$HOME/.local/state}/browse/daemon.token" | |
| output=$(./dist/browse --browser chrome goto 'data:text/html,<title>CI</title><h1>CI</h1>' 2>&1 || true) | |
| echo "$output" | |
| echo "$output" | grep -q "CI" || { echo "Binary smoke failed: expected 'CI' in output"; exit 1; } | |
| - name: Evaluate ARM64 smoke diagnostics | |
| if: matrix.label == 'linux-arm64' | |
| run: | | |
| echo "Source CLI smoke: ${{ steps.smoke_source_arm64.outcome }}" | |
| echo "Binary smoke: ${{ steps.smoke_binary_arm64.outcome }}" | |
| [ "${{ steps.smoke_source_arm64.outcome }}" = "success" ] && [ "${{ steps.smoke_binary_arm64.outcome }}" = "success" ] | |
| - name: Smoke test binary | |
| if: matrix.label != 'linux-arm64' | |
| run: | | |
| output=$(./dist/browse goto 'data:text/html,<title>CI</title><h1>CI</h1>' 2>&1 || true) | |
| echo "$output" | |
| echo "$output" | grep -q "CI" || { echo "Smoke test failed: expected 'CI' in output"; exit 1; } |