@@ -78,55 +78,15 @@ jobs:
7878 env :
7979 NODE_AUTH_TOKEN : ${{ secrets.NPM_TOKEN }}
8080
81- update -homebrew :
82- name : Update Homebrew tap
81+ trigger -homebrew :
82+ name : Trigger Homebrew update
8383 needs : [release, verify-version]
8484 runs-on : ubuntu-latest
8585 steps :
86- - name : Checkout homebrew-tap
87- uses : actions/checkout@v4
88- with :
89- repository : dean0x/homebrew-tap
90- token : ${{ secrets.HOMEBREW_TAP_TOKEN }}
91- path : homebrew-tap
92-
93- - name : Download release tarball and calculate checksum
94- id : checksum
95- run : |
96- VERSION="${{ needs.verify-version.outputs.version }}"
97- curl -sL "https://github.com/dean0x/mars/archive/refs/tags/v${VERSION}.tar.gz" -o mars.tar.gz
98- SHA256=$(sha256sum mars.tar.gz | cut -d' ' -f1)
99- echo "sha256=$SHA256" >> "$GITHUB_OUTPUT"
100-
101- - name : Update formula
102- run : |
103- VERSION="${{ needs.verify-version.outputs.version }}"
104- SHA256="${{ steps.checksum.outputs.sha256 }}"
105-
106- cat > homebrew-tap/Formula/mars.rb << EOF
107- class Mars < Formula
108- desc "Multi Agentic Repo workspace manager for Git repositories"
109- homepage "https://github.com/dean0x/mars"
110- url "https://github.com/dean0x/mars/archive/refs/tags/v${VERSION}.tar.gz"
111- sha256 "${SHA256}"
112- license "MIT"
113-
114- def install
115- bin.install "dist/mars" => "mars"
116- end
117-
118- test do
119- system "#{bin}/mars", "--version"
120- end
121- end
122- EOF
123- sed -i 's/^ //' homebrew-tap/Formula/mars.rb
124-
125- - name : Commit and push
86+ - name : Trigger formula update
12687 run : |
127- cd homebrew-tap
128- git config user.name "github-actions[bot]"
129- git config user.email "github-actions[bot]@users.noreply.github.com"
130- git add Formula/mars.rb
131- git diff --staged --quiet || git commit -m "Update mars to ${{ needs.verify-version.outputs.version }}"
132- git push
88+ curl -X POST \
89+ -H "Authorization: Bearer ${{ secrets.HOMEBREW_TAP_TOKEN }}" \
90+ -H "Accept: application/vnd.github+json" \
91+ https://api.github.com/repos/dean0x/homebrew-tap/dispatches \
92+ -d '{"event_type":"update-formula","client_payload":{"formula":"mars","version":"${{ needs.verify-version.outputs.version }}"}}'
0 commit comments