Skip to content

Commit 06d01ce

Browse files
timiclaude
authored andcommitted
feat: add Homebrew Cask support
- Add Casks/lumis.rb for Homebrew installation - Add update-cask workflow to auto-update on release Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
1 parent 9916f47 commit 06d01ce

2 files changed

Lines changed: 133 additions & 0 deletions

File tree

.github/workflows/update-cask.yml

Lines changed: 91 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,91 @@
1+
name: Update Homebrew Cask
2+
3+
on:
4+
release:
5+
types: [published]
6+
workflow_dispatch:
7+
inputs:
8+
version:
9+
description: "Version to update (e.g., 0.3.0)"
10+
required: true
11+
type: string
12+
13+
jobs:
14+
update-cask:
15+
runs-on: ubuntu-latest
16+
permissions:
17+
contents: read
18+
19+
steps:
20+
- name: Get version
21+
id: version
22+
run: |
23+
if [ "${{ github.event_name }}" = "release" ]; then
24+
VERSION="${{ github.event.release.tag_name }}"
25+
VERSION="${VERSION#v}"
26+
else
27+
VERSION="${{ github.event.inputs.version }}"
28+
fi
29+
echo "version=$VERSION" >> $GITHUB_OUTPUT
30+
echo "Version: $VERSION"
31+
32+
- name: Calculate SHA256 for ARM64 DMG
33+
id: sha_arm
34+
run: |
35+
URL="https://github.com/melandlabs/release/releases/download/v${{ steps.version.outputs.version }}/Lumis_${{ steps.version.outputs.version }}_aarch64.dmg"
36+
echo "Downloading from: $URL"
37+
SHA=$(curl -sfL "$URL" | shasum -a 256 | cut -d ' ' -f 1)
38+
if [ -z "$SHA" ]; then
39+
echo "Error: Failed to download ARM64 DMG"
40+
exit 1
41+
fi
42+
echo "sha=$SHA" >> $GITHUB_OUTPUT
43+
echo "ARM64 SHA256: $SHA"
44+
45+
- name: Calculate SHA256 for Intel DMG
46+
id: sha_intel
47+
run: |
48+
URL="https://github.com/melandlabs/release/releases/download/v${{ steps.version.outputs.version }}/Lumis_${{ steps.version.outputs.version }}_x64.dmg"
49+
echo "Downloading from: $URL"
50+
SHA=$(curl -sfL "$URL" | shasum -a 256 | cut -d ' ' -f 1)
51+
if [ -z "$SHA" ]; then
52+
echo "Error: Failed to download Intel DMG"
53+
exit 1
54+
fi
55+
echo "sha=$SHA" >> $GITHUB_OUTPUT
56+
echo "Intel SHA256: $SHA"
57+
58+
- name: Checkout repository
59+
uses: actions/checkout@v4
60+
with:
61+
ref: main
62+
path: homebrew-lumis
63+
64+
- name: Update Cask file
65+
run: |
66+
cd homebrew-lumis
67+
CASK_FILE="Casks/lumis.rb"
68+
VERSION="${{ steps.version.outputs.version }}"
69+
ARM_SHA="${{ steps.sha_arm.outputs.sha }}"
70+
INTEL_SHA="${{ steps.sha_intel.outputs.sha }}"
71+
72+
echo "Updating $CASK_FILE"
73+
echo " Version: $VERSION"
74+
echo " ARM64 SHA: $ARM_SHA"
75+
echo " Intel SHA: $INTEL_SHA"
76+
77+
sed -i "s/version \"[^\"]*\"/version \"$VERSION\"/" "$CASK_FILE"
78+
sed -i "s/sha256 arm: \"[^\"]*\"/sha256 arm: \"$ARM_SHA\"/" "$CASK_FILE"
79+
sed -i "s/intel: \"[^\"]*\"/intel: \"$INTEL_SHA\"/" "$CASK_FILE"
80+
81+
echo "Updated content:"
82+
head -15 "$CASK_FILE"
83+
84+
- name: Commit and push
85+
run: |
86+
cd homebrew-lumis
87+
git config user.name "github-actions[bot]"
88+
git config user.email "github-actions[bot]@users.noreply.github.com"
89+
git add Casks/lumis.rb
90+
git commit -m "chore: update homebrew cask to v${{ steps.version.outputs.version }}"
91+
git push

Casks/lumis.rb

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
# typed: false
2+
# frozen_string_literal: true
3+
4+
cask "lumis" do
5+
arch arm: "aarch64", intel: "x64"
6+
7+
version "0.3.0"
8+
sha256 arm: "REPLACE_WITH_ARM64_SHA256",
9+
intel: "REPLACE_WITH_X64_SHA256"
10+
11+
url "https://github.com/melandlabs/release/releases/download/v#{version}/Lumis_#{version}_#{arch}.dmg",
12+
verified: "github.com/melandlabs/release/"
13+
14+
name "Lumis"
15+
desc "AI-powered IM router and chat agent with multi-platform integration"
16+
homepage "https://github.com/melandlabs/release"
17+
18+
livecheck do
19+
url :url
20+
strategy :github_latest
21+
end
22+
23+
auto_updates true
24+
depends_on macos: ">= :monterey"
25+
26+
app "Lumis.app"
27+
28+
postflight do
29+
# Remove quarantine attribute to prevent Gatekeeper issues
30+
system_command "/usr/bin/xattr",
31+
args: ["-r", "-d", "com.apple.quarantine", "#{appdir}/Lumis.app"],
32+
sudo: false
33+
end
34+
35+
zap trash: [
36+
"~/Library/Application Support/com.lumis.app",
37+
"~/Library/Caches/com.lumis.app",
38+
"~/Library/Logs/com.lumis.app",
39+
"~/Library/Preferences/com.lumis.app.plist",
40+
"~/Library/Saved Application State/com.lumis.app.savedState",
41+
]
42+
end

0 commit comments

Comments
 (0)