File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -159,7 +159,12 @@ jobs:
159159 VERSION : ${{ steps.ver.outputs.version }}
160160 run : |
161161 chmod +x packaging/homebrew/generate_formula.sh
162- ./packaging/homebrew/generate_formula.sh > codeanalyzer-python.rb
162+ # The release job just published the sdist as a Release asset; hash the
163+ # exact bytes users will download so the formula checksum always matches.
164+ sdist="https://github.com/${REPO}/releases/download/v${VERSION}/codeanalyzer_python-${VERSION}.tar.gz"
165+ SHA256="$(curl -fLsS "$sdist" | shasum -a 256 | cut -d' ' -f1)"
166+ REPO="$REPO" VERSION="$VERSION" SHA256="$SHA256" \
167+ ./packaging/homebrew/generate_formula.sh > codeanalyzer-python.rb
163168 cat codeanalyzer-python.rb
164169
165170 - name : Push formula to codellm-devkit/homebrew-tap
Original file line number Diff line number Diff line change 1414# isolated environment on first run). This keeps `brew install` sandbox-safe (no
1515# network at build time) while pinning the exact released version.
1616#
17+ # Homebrew requires every formula to declare a source `url` + `sha256` for its
18+ # stable spec, so we point at the released sdist (byte-identical to the PyPI one).
19+ # The install method ignores the unpacked source and just writes uv wrappers, but
20+ # the url anchors the version and satisfies Homebrew's spec requirement.
21+ #
1722# Usage:
18- # REPO=codellm-devkit/codeanalyzer-python VERSION=0.2.0 \
23+ # REPO=codellm-devkit/codeanalyzer-python VERSION=0.2.0 SHA256=<sdist sha256> \
1924# ./generate_formula.sh > codeanalyzer-python.rb
2025#
2126set -euo pipefail
2227
2328REPO=" ${REPO:? set REPO, e.g. codellm-devkit/ codeanalyzer-python} "
2429VERSION=" ${VERSION:? set VERSION, e.g. 0.2.0} "
30+ SHA256=" ${SHA256:? set SHA256 of the released sdist} "
31+ SDIST_URL=" https://github.com/${REPO} /releases/download/v${VERSION} /codeanalyzer_python-${VERSION} .tar.gz"
2532
2633cat << EOF
2734# This file is auto-generated by packaging/homebrew/generate_formula.sh on release.
2835# Do not edit by hand -- changes will be overwritten on the next tag.
2936class CodeanalyzerPython < Formula
3037 desc "CLDK Python analyzer (canpy) -- emits canonical analysis.json or a Neo4j graph"
3138 homepage "https://github.com/${REPO} "
39+ url "${SDIST_URL} "
40+ sha256 "${SHA256} "
3241 version "${VERSION} "
3342 license "Apache-2.0"
3443
You can’t perform that action at this time.
0 commit comments