From 0b676df02c909d67c9401b3a16d1144c14d06b0a Mon Sep 17 00:00:00 2001 From: Tw93 Date: Tue, 23 Sep 2025 14:53:31 +0800 Subject: [PATCH] Improve Homebrew installation and automation - Simplify Homebrew install to single command: brew install tw93/tap/clean-mac - Add GitHub Action for automatic formula updates on release - Remove need for separate tap command Features: - One-command Homebrew installation - Automatic formula updates on new releases - Streamlined user experience --- .github/workflows/homebrew.yml | 21 +++++++++++++++++++++ README.md | 3 +-- install.sh | 10 ++-------- 3 files changed, 24 insertions(+), 10 deletions(-) create mode 100644 .github/workflows/homebrew.yml diff --git a/.github/workflows/homebrew.yml b/.github/workflows/homebrew.yml new file mode 100644 index 0000000..b0a26fe --- /dev/null +++ b/.github/workflows/homebrew.yml @@ -0,0 +1,21 @@ +name: Update Homebrew Formula + +on: + release: + types: [published] + +jobs: + homebrew: + runs-on: ubuntu-latest + steps: + - name: Update Homebrew formula + uses: dawidd6/action-homebrew-bump-formula@v3 + with: + token: ${{ secrets.HOMEBREW_GITHUB_API_TOKEN }} + formula: clean-mac + tap: tw93/homebrew-tap + create_pullrequest: true + commit_message: | + Update clean-mac to {{version}} + + Created by action-homebrew-bump-formula \ No newline at end of file diff --git a/README.md b/README.md index 6201934..39c0df9 100644 --- a/README.md +++ b/README.md @@ -26,8 +26,7 @@ curl -fsSL https://raw.githubusercontent.com/tw93/clean-mac/main/install.sh | ba ### Homebrew ```bash -brew tap tw93/tap -brew install clean-mac +brew install tw93/tap/clean-mac ``` ### Development diff --git a/install.sh b/install.sh index e0f9aae..9920127 100755 --- a/install.sh +++ b/install.sh @@ -87,14 +87,8 @@ install_via_homebrew() { return 1 fi - # Add tap if not already added - if ! brew tap | grep -q "tw93/tap"; then - log_info "Adding tap: tw93/tap" - brew tap tw93/tap - fi - - # Install clean-mac - brew install clean-mac + # Install with automatic tap addition + brew install tw93/tap/clean-mac return $? }