Skip to content

Commit 6e0f84a

Browse files
mashclaude
authored andcommitted
chore(ci): handle missing Intel DMG in homebrew cask update
The macOS Intel build (x86_64-apple-darwin cross-compiled on ARM runner) does not produce a DMG. Make the x64 DMG optional: if present, generate a dual-arch cask; if absent, generate an ARM-only cask with depends_on arch: :arm64. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> Signed-off-by: mash <mash@mashs-MacBook-Pro.local>
1 parent 4efefb0 commit 6e0f84a

1 file changed

Lines changed: 28 additions & 9 deletions

File tree

.github/workflows/release.yml

Lines changed: 28 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -286,34 +286,53 @@ jobs:
286286
# Download DMGs and compute SHA256
287287
echo "Downloading macOS DMGs..."
288288
curl -fSL "${BASE_URL}/McpMux_${VERSION}_aarch64.dmg" -o arm64.dmg || { echo "ARM64 DMG not found — skipping Homebrew update"; exit 0; }
289-
curl -fSL "${BASE_URL}/McpMux_${VERSION}_x64.dmg" -o x64.dmg || { echo "x64 DMG not found — skipping Homebrew update"; exit 0; }
290-
291289
SHA_ARM64=$(shasum -a 256 arm64.dmg | cut -d' ' -f1)
292-
SHA_X64=$(shasum -a 256 x64.dmg | cut -d' ' -f1)
293290
echo "ARM64 SHA256: $SHA_ARM64"
294-
echo "x64 SHA256: $SHA_X64"
291+
292+
# x64 DMG is optional (macos-latest runs on ARM; cross-compiled targets don't produce DMGs)
293+
HAS_X64=false
294+
if curl -fSL "${BASE_URL}/McpMux_${VERSION}_x64.dmg" -o x64.dmg 2>/dev/null; then
295+
SHA_X64=$(shasum -a 256 x64.dmg | cut -d' ' -f1)
296+
echo "x64 SHA256: $SHA_X64"
297+
HAS_X64=true
298+
else
299+
echo "x64 DMG not found — generating ARM-only cask"
300+
fi
295301
296302
# Clone the tap repo and update the cask
297303
git clone https://x-access-token:${GH_TOKEN}@github.com/mcpmux/homebrew-tap.git tap
298304
299-
# Generate cask file (Ruby heredoc content with shell variable expansion)
305+
# Generate cask file
300306
CASK_FILE="tap/Casks/mcpmux.rb"
301307
{
302308
echo 'cask "mcpmux" do'
303-
echo ' arch arm: "aarch64", intel: "x64"'
309+
if [ "$HAS_X64" = true ]; then
310+
echo ' arch arm: "aarch64", intel: "x64"'
311+
fi
304312
echo ''
305313
echo " version \"${VERSION}\""
306-
echo " sha256 arm: \"${SHA_ARM64}\","
307-
echo " intel: \"${SHA_X64}\""
314+
if [ "$HAS_X64" = true ]; then
315+
echo " sha256 arm: \"${SHA_ARM64}\","
316+
echo " intel: \"${SHA_X64}\""
317+
else
318+
echo " sha256 \"${SHA_ARM64}\""
319+
fi
308320
echo ''
309-
echo ' url "https://github.com/mcpmux/mcp-mux/releases/download/v#{version}/McpMux_#{version}_#{arch}.dmg",'
321+
if [ "$HAS_X64" = true ]; then
322+
echo ' url "https://github.com/mcpmux/mcp-mux/releases/download/v#{version}/McpMux_#{version}_#{arch}.dmg",'
323+
else
324+
echo ' url "https://github.com/mcpmux/mcp-mux/releases/download/v#{version}/McpMux_#{version}_aarch64.dmg",'
325+
fi
310326
echo ' verified: "github.com/mcpmux/mcp-mux/"'
311327
echo ''
312328
echo ' name "McpMux"'
313329
echo ' desc "Unified MCP gateway and manager for AI clients"'
314330
echo ' homepage "https://mcpmux.com"'
315331
echo ''
316332
echo ' depends_on macos: ">= :high_sierra"'
333+
if [ "$HAS_X64" != true ]; then
334+
echo ' depends_on arch: :arm64'
335+
fi
317336
echo ''
318337
echo ' livecheck do'
319338
echo ' url "https://github.com/mcpmux/mcp-mux/releases/latest"'

0 commit comments

Comments
 (0)