mirror of
https://github.com/ModernRelay/omnigraph.git
synced 2026-06-27 02:39:38 +02:00
fix(release): generate audit-clean Homebrew formula (#134)
The generated formula failed `brew audit --strict` with 5 problems: `version` declared after `license`, and `url`/`sha256` placed directly inside `on_macos`/`on_linux` (forbidden by FormulaAudit/ComponentsOrder). Order `version` before `license`, hoist `head`/`livecheck` above the platform blocks, and nest `url`/`sha256` in `on_arm`/`on_intel`. Add a `brew audit --strict --online` gate to the release workflow so a malformed formula can never be published again. Verified clean against v0.6.0. Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
parent
353c0c876a
commit
fab105bcce
2 changed files with 27 additions and 13 deletions
11
.github/workflows/release.yml
vendored
11
.github/workflows/release.yml
vendored
|
|
@ -121,6 +121,17 @@ jobs:
|
||||||
run: |
|
run: |
|
||||||
./scripts/update-homebrew-formula.sh "${GITHUB_REF_NAME}" homebrew-tap/Formula/omnigraph.rb
|
./scripts/update-homebrew-formula.sh "${GITHUB_REF_NAME}" homebrew-tap/Formula/omnigraph.rb
|
||||||
|
|
||||||
|
- name: Audit generated formula
|
||||||
|
if: env.HOMEBREW_TAP_SKIP != '1'
|
||||||
|
run: |
|
||||||
|
# Audit the checked-out tap by name (brew audit rejects bare paths
|
||||||
|
# and needs tap context). Symlink the checkout into Homebrew's Taps
|
||||||
|
# tree so `modernrelay/tap/omnigraph` resolves to it.
|
||||||
|
tap_dir="$(brew --repository)/Library/Taps/modernrelay/homebrew-tap"
|
||||||
|
mkdir -p "$(dirname "$tap_dir")"
|
||||||
|
ln -sfn "$PWD/homebrew-tap" "$tap_dir"
|
||||||
|
brew audit --strict --online modernrelay/tap/omnigraph
|
||||||
|
|
||||||
- name: Commit and push formula update
|
- name: Commit and push formula update
|
||||||
if: env.HOMEBREW_TAP_SKIP != '1'
|
if: env.HOMEBREW_TAP_SKIP != '1'
|
||||||
working-directory: homebrew-tap
|
working-directory: homebrew-tap
|
||||||
|
|
|
||||||
|
|
@ -64,20 +64,8 @@ cat >"$FORMULA_PATH" <<EOF
|
||||||
class Omnigraph < Formula
|
class Omnigraph < Formula
|
||||||
desc "Typed property graph database with Git-style workflows"
|
desc "Typed property graph database with Git-style workflows"
|
||||||
homepage "https://github.com/${REPO_SLUG}"
|
homepage "https://github.com/${REPO_SLUG}"
|
||||||
license "MIT"
|
|
||||||
version "${VERSION}"
|
version "${VERSION}"
|
||||||
|
license "MIT"
|
||||||
on_macos do
|
|
||||||
depends_on arch: :arm64
|
|
||||||
url "${MACOS_ARM_URL}"
|
|
||||||
sha256 "${MACOS_ARM_SHA}"
|
|
||||||
end
|
|
||||||
|
|
||||||
on_linux do
|
|
||||||
url "${LINUX_X86_URL}"
|
|
||||||
sha256 "${LINUX_X86_SHA}"
|
|
||||||
end
|
|
||||||
|
|
||||||
head "https://github.com/${REPO_SLUG}.git", branch: "main"
|
head "https://github.com/${REPO_SLUG}.git", branch: "main"
|
||||||
|
|
||||||
livecheck do
|
livecheck do
|
||||||
|
|
@ -85,6 +73,21 @@ class Omnigraph < Formula
|
||||||
regex(/^v?(\\d+(?:\\.\\d+)+)$/i)
|
regex(/^v?(\\d+(?:\\.\\d+)+)$/i)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
on_macos do
|
||||||
|
depends_on arch: :arm64
|
||||||
|
on_arm do
|
||||||
|
url "${MACOS_ARM_URL}"
|
||||||
|
sha256 "${MACOS_ARM_SHA}"
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
on_linux do
|
||||||
|
on_intel do
|
||||||
|
url "${LINUX_X86_URL}"
|
||||||
|
sha256 "${LINUX_X86_SHA}"
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
def install
|
def install
|
||||||
bin.install "omnigraph", "omnigraph-server"
|
bin.install "omnigraph", "omnigraph-server"
|
||||||
end
|
end
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue