From 2c0b465efe610e1f49846db98eac0552b70d8720 Mon Sep 17 00:00:00 2001 From: almogbaku Date: Thu, 12 Mar 2026 22:54:08 +0200 Subject: [PATCH 1/2] feat: add Homebrew tap support for dap CLI Add auto-updating Homebrew formula via AlmogBaku/homebrew-tap repo. Release workflow now computes SHA256s for all platform binaries and pushes updated formula on each release. Co-Authored-By: Claude Opus 4.6 --- .github/workflows/release.yml | 80 ++++++++++++++++++++++++++++++++++ README.md | 7 +++ skills/debugging-code/SKILL.md | 11 ++++- 3 files changed, 97 insertions(+), 1 deletion(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 7c86f7e..56bbd2e 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -92,3 +92,83 @@ jobs: tag_name: ${{ needs.version.outputs.tag }} generate_release_notes: true files: dap-* + + homebrew: + name: Update Homebrew Formula + needs: [version, release] + if: needs.version.outputs.tag != '' + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + with: + repository: AlmogBaku/homebrew-tap + token: ${{ secrets.HOMEBREW_TAP_TOKEN }} + + - name: Update formula + env: + VERSION: ${{ needs.version.outputs.tag }} + run: | + set -euo pipefail + VER="${VERSION#v}" + BASE="https://github.com/AlmogBaku/debug-skill/releases/download/${VERSION}" + + sha() { curl -sfL "$1" | shasum -a 256 | cut -d' ' -f1; } + SHA_DARWIN_ARM64=$(sha "${BASE}/dap-darwin-arm64") || { echo "Failed to download darwin-arm64"; exit 1; } + SHA_DARWIN_AMD64=$(sha "${BASE}/dap-darwin-amd64") || { echo "Failed to download darwin-amd64"; exit 1; } + SHA_LINUX_ARM64=$(sha "${BASE}/dap-linux-arm64") || { echo "Failed to download linux-arm64"; exit 1; } + SHA_LINUX_AMD64=$(sha "${BASE}/dap-linux-amd64") || { echo "Failed to download linux-amd64"; exit 1; } + + cat > Formula/dap.rb << 'FORMULA' + class Dap < Formula + desc "CLI debugging tool for AI agents using the Debug Adapter Protocol" + homepage "https://github.com/AlmogBaku/debug-skill" + version "VERSION_PLACEHOLDER" + license "MIT" + + on_macos do + if Hardware::CPU.arm? + url "https://github.com/AlmogBaku/debug-skill/releases/download/v#{version}/dap-darwin-arm64" + sha256 "SHA_DARWIN_ARM64_PLACEHOLDER" + else + url "https://github.com/AlmogBaku/debug-skill/releases/download/v#{version}/dap-darwin-amd64" + sha256 "SHA_DARWIN_AMD64_PLACEHOLDER" + end + end + + on_linux do + if Hardware::CPU.arm? + url "https://github.com/AlmogBaku/debug-skill/releases/download/v#{version}/dap-linux-arm64" + sha256 "SHA_LINUX_ARM64_PLACEHOLDER" + else + url "https://github.com/AlmogBaku/debug-skill/releases/download/v#{version}/dap-linux-amd64" + sha256 "SHA_LINUX_AMD64_PLACEHOLDER" + end + end + + def install + binary = Dir["dap-*"].first + bin.install binary => "dap" + end + + test do + assert_match version.to_s, shell_output("#{bin}/dap --version") + end + end + FORMULA + + sed -i "s/VERSION_PLACEHOLDER/${VER}/" Formula/dap.rb + sed -i "s/SHA_DARWIN_ARM64_PLACEHOLDER/${SHA_DARWIN_ARM64}/" Formula/dap.rb + sed -i "s/SHA_DARWIN_AMD64_PLACEHOLDER/${SHA_DARWIN_AMD64}/" Formula/dap.rb + sed -i "s/SHA_LINUX_ARM64_PLACEHOLDER/${SHA_LINUX_ARM64}/" Formula/dap.rb + sed -i "s/SHA_LINUX_AMD64_PLACEHOLDER/${SHA_LINUX_AMD64}/" Formula/dap.rb + + - name: Commit and push + env: + VERSION: ${{ needs.version.outputs.tag }} + run: | + git config user.name "github-actions[bot]" + git config user.email "github-actions[bot]@users.noreply.github.com" + git add Formula/dap.rb + git diff --cached --quiet && exit 0 + git commit -m "dap ${VERSION}" + git push diff --git a/README.md b/README.md index f2eff6d..50e365d 100644 --- a/README.md +++ b/README.md @@ -75,6 +75,7 @@ CLI sends one command and gets back the full context — no interactive terminal ### Install + ```bash # One-liner (Linux & macOS) bash <(curl -fsSL https://raw.githubusercontent.com/AlmogBaku/debug-skill/master/skills/debugging-code/scripts/install-dap.sh) @@ -83,6 +84,12 @@ bash <(curl -fsSL https://raw.githubusercontent.com/AlmogBaku/debug-skill/master
Other install methods +**From Homebrew (for macOS):** +```bash +brew install AlmogBaku/tap/dap +``` + +**From sources:** ```bash # Go install go install github.com/AlmogBaku/debug-skill/cmd/dap@latest diff --git a/skills/debugging-code/SKILL.md b/skills/debugging-code/SKILL.md index d5cbffa..0ccb362 100644 --- a/skills/debugging-code/SKILL.md +++ b/skills/debugging-code/SKILL.md @@ -22,11 +22,20 @@ the debugger state, so you can simply interact with it with multiple calls. If `dap` isn't installed (check: `command -v dap`), install it NOW. Ask/notify the user before proceeding to install it. +From Homebrew (macOS) +```bash +brew install AlmogBaku/tap/dap +``` + +Installer script: ```bash bash scripts/install-dap.sh ``` -Alternatively, install from sources `go install github.com/AlmogBaku/debug-skill/cmd/dap@latest` +Install from sources: +```bash +go install github.com/AlmogBaku/debug-skill/cmd/dap@latest +``` This tool is open-sourced and available on [GitHub](https://github.com/AlmogBaku/debug-skill), maintained and follows best practices. From e3491e8c2e440434e9fdd3d65ca61cb778a82140 Mon Sep 17 00:00:00 2001 From: almogbaku Date: Thu, 12 Mar 2026 23:11:45 +0200 Subject: [PATCH 2/2] fix: add robustness to homebrew release job - continue-on-error so tap failure doesn't fail the release - validate v-prefixed tag format before generating formula Co-Authored-By: Claude Opus 4.6 --- .github/workflows/release.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 56bbd2e..ff36433 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -97,6 +97,7 @@ jobs: name: Update Homebrew Formula needs: [version, release] if: needs.version.outputs.tag != '' + continue-on-error: true runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 @@ -109,6 +110,7 @@ jobs: VERSION: ${{ needs.version.outputs.tag }} run: | set -euo pipefail + [[ "${VERSION}" == v* ]] || { echo "Expected v-prefixed tag, got ${VERSION}"; exit 1; } VER="${VERSION#v}" BASE="https://github.com/AlmogBaku/debug-skill/releases/download/${VERSION}"