Skip to content

Commit 84041eb

Browse files
timiclaude
authored andcommitted
feat: auto-update Homebrew cask after release
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
1 parent 5081c53 commit 84041eb

1 file changed

Lines changed: 29 additions & 0 deletions

File tree

.github/workflows/build.yml

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -220,3 +220,32 @@ jobs:
220220
lumis*.deb
221221
env:
222222
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
223+
224+
- name: Checkout repository
225+
uses: actions/checkout@v4
226+
227+
- name: Update Homebrew Cask
228+
run: |
229+
# Find DMG file
230+
DMG_FILE=$(ls Lumis*.dmg)
231+
232+
# Extract version from filename (e.g., Lumis_0.3.0_aarch64.dmg -> 0.3.0)
233+
VERSION=$(echo "$DMG_FILE" | sed -E 's/Lumis_([0-9.]+)_aarch64.dmg/\1/')
234+
235+
# Calculate SHA256
236+
SHA256=$(sha256sum "$DMG_FILE" | awk '{print $1}')
237+
238+
# Update cask file
239+
sed -i "s/version \"[^\"]*\"/version \"$VERSION\"/" Casks/lumis.rb
240+
sed -i "s/sha256 \"[^\"]*\"/sha256 \"$SHA256\"/" Casks/lumis.rb
241+
242+
# Commit changes
243+
git config --local user.email "github-actions[bot]@users.noreply.github.com"
244+
git config --local user.name "github-actions[bot]"
245+
git add Casks/lumis.rb
246+
git commit -m "chore: update Homebrew cask to v$VERSION" || echo "No changes to commit"
247+
248+
- name: Push changes
249+
uses: ad-m/github-push-action@master
250+
with:
251+
github_token: ${{ secrets.GITHUB_TOKEN }}

0 commit comments

Comments
 (0)