cmux/.github/workflows/update-homebrew.yml
2026-01-29 04:31:39 -08:00

92 lines
2.8 KiB
YAML

name: Update Homebrew Cask
on:
release:
types: [published]
workflow_dispatch:
inputs:
version:
description: 'Version tag (e.g., v1.9.0)'
required: true
permissions:
contents: read
jobs:
update-cask:
runs-on: ubuntu-latest
steps:
- name: Get version
id: version
run: |
if [ -n "${{ github.event.inputs.version }}" ]; then
VERSION="${{ github.event.inputs.version }}"
else
VERSION="${{ github.event.release.tag_name }}"
fi
VERSION="${VERSION#v}"
echo "version=$VERSION" >> $GITHUB_OUTPUT
- name: Download DMG and get SHA256
id: sha
run: |
VERSION="${{ steps.version.outputs.version }}"
curl -sL "https://github.com/manaflow-ai/cmuxterm/releases/download/v${VERSION}/cmuxterm-macos.dmg" -o cmuxterm.dmg
SHA256=$(shasum -a 256 cmuxterm.dmg | cut -d' ' -f1)
echo "sha256=$SHA256" >> $GITHUB_OUTPUT
- name: Checkout homebrew-cmuxterm
uses: actions/checkout@v4
with:
repository: manaflow-ai/homebrew-cmuxterm
token: ${{ secrets.HOMEBREW_TAP_TOKEN }}
path: homebrew-cmuxterm
- name: Update cask formula
env:
VERSION: ${{ steps.version.outputs.version }}
SHA256: ${{ steps.sha.outputs.sha256 }}
run: |
cat > homebrew-cmuxterm/Casks/cmuxterm.rb << CASKEOF
cask "cmuxterm" do
version "${VERSION}"
sha256 "${SHA256}"
url "https://github.com/manaflow-ai/cmuxterm/releases/download/v#{version}/cmuxterm-macos.dmg"
name "cmuxterm"
desc "Lightweight native macOS terminal with vertical tabs for AI coding agents"
homepage "https://github.com/manaflow-ai/cmuxterm"
livecheck do
url :url
strategy :github_latest
end
depends_on macos: ">= :ventura"
app "cmuxterm.app"
zap trash: [
"~/Library/Application Support/cmuxterm",
"~/Library/Caches/cmuxterm",
"~/Library/Preferences/ai.manaflow.cmuxterm.plist",
]
end
CASKEOF
# Remove leading whitespace from heredoc
sed -i 's/^ //' homebrew-cmuxterm/Casks/cmuxterm.rb
- name: Commit and push
env:
VERSION: ${{ steps.version.outputs.version }}
run: |
cd homebrew-cmuxterm
git config user.name "github-actions[bot]"
git config user.email "github-actions[bot]@users.noreply.github.com"
git add Casks/cmuxterm.rb
if git diff --staged --quiet; then
echo "No changes - cask already up to date"
else
git commit -m "Update cmuxterm to ${VERSION}"
git push
fi