Skip to content

Commit 5300bfc

Browse files
committed
fix: replace mislav/bump-homebrew-formula-action with custom multi-platform formula generator
The action only supports single-URL formulas. Our formula has 3 platform-specific URLs (aarch64-mac, x86_64-mac, x86_64-linux), so the tap was never updated correctly.
1 parent f2258c4 commit 5300bfc

1 file changed

Lines changed: 63 additions & 7 deletions

File tree

.github/workflows/release.yml

Lines changed: 63 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -67,11 +67,67 @@ jobs:
6767
needs: release
6868
runs-on: ubuntu-latest
6969
steps:
70-
- name: Update Homebrew tap
71-
uses: mislav/bump-homebrew-formula-action@v3
72-
with:
73-
formula-name: melina
74-
homebrew-tap: vinhnxv/homebrew-tap
75-
download-url: https://github.com/vinhnxv/melina/releases/download/${{ github.ref_name }}/melina-${{ github.ref_name }}-aarch64-apple-darwin.tar.gz
70+
- name: Download tarballs and compute SHA256
71+
env:
72+
TAG: ${{ github.ref_name }}
73+
run: |
74+
BASE="https://github.com/vinhnxv/melina/releases/download/${TAG}"
75+
for target in aarch64-apple-darwin x86_64-apple-darwin x86_64-unknown-linux-gnu; do
76+
curl -sL "${BASE}/melina-${TAG}-${target}.tar.gz" -o "${target}.tar.gz"
77+
done
78+
echo "SHA_AARCH64_MAC=$(sha256sum aarch64-apple-darwin.tar.gz | cut -d' ' -f1)" >> "$GITHUB_ENV"
79+
echo "SHA_X86_64_MAC=$(sha256sum x86_64-apple-darwin.tar.gz | cut -d' ' -f1)" >> "$GITHUB_ENV"
80+
echo "SHA_X86_64_LINUX=$(sha256sum x86_64-unknown-linux-gnu.tar.gz | cut -d' ' -f1)" >> "$GITHUB_ENV"
81+
echo "VERSION=${TAG#v}" >> "$GITHUB_ENV"
82+
83+
- name: Generate and push Homebrew formula
7684
env:
77-
COMMITTER_TOKEN: ${{ secrets.HOMEBREW_TAP_TOKEN }}
85+
GH_TOKEN: ${{ secrets.HOMEBREW_TAP_TOKEN }}
86+
TAG: ${{ github.ref_name }}
87+
run: |
88+
cat > formula.rb <<FORMULA
89+
class Melina < Formula
90+
desc "Claude Code process monitor — track sessions, teammates, MCP servers, and orphans"
91+
homepage "https://github.com/vinhnxv/melina"
92+
version "${VERSION}"
93+
license "MIT"
94+
95+
on_macos do
96+
on_arm do
97+
url "https://github.com/vinhnxv/melina/releases/download/${TAG}/melina-${TAG}-aarch64-apple-darwin.tar.gz"
98+
sha256 "${SHA_AARCH64_MAC}"
99+
end
100+
on_intel do
101+
url "https://github.com/vinhnxv/melina/releases/download/${TAG}/melina-${TAG}-x86_64-apple-darwin.tar.gz"
102+
sha256 "${SHA_X86_64_MAC}"
103+
end
104+
end
105+
106+
on_linux do
107+
on_intel do
108+
url "https://github.com/vinhnxv/melina/releases/download/${TAG}/melina-${TAG}-x86_64-unknown-linux-gnu.tar.gz"
109+
sha256 "${SHA_X86_64_LINUX}"
110+
end
111+
end
112+
113+
def install
114+
bin.install "melina"
115+
bin.install "melina-cli"
116+
end
117+
118+
test do
119+
system bin/"melina-cli", "--help"
120+
end
121+
end
122+
FORMULA
123+
124+
# Remove leading whitespace from heredoc
125+
sed -i 's/^ //' formula.rb
126+
127+
FILE_SHA=$(gh api repos/vinhnxv/homebrew-tap/contents/Formula/melina.rb --jq '.sha')
128+
129+
gh api repos/vinhnxv/homebrew-tap/contents/Formula/melina.rb \
130+
-X PUT \
131+
-f message="melina ${VERSION}" \
132+
-f content="$(base64 -w0 < formula.rb)" \
133+
-f sha="$FILE_SHA"

0 commit comments

Comments
 (0)