diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 93844c1..c2a0351 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -122,3 +122,20 @@ jobs: git commit -m "Update Homebrew cask to v${{ steps.meta.outputs.version }} [skip ci]" git remote set-url origin "https://execsumo:${GH_PAT}@github.com/execsumo/Heard.git" git push origin HEAD:refs/heads/master + + # Clone the Homebrew tap repo, copy the updated cask, and push so that + # `brew upgrade --cask heard` picks up the new version automatically. + - name: Push cask to Homebrew tap + env: + GH_PAT: ${{ secrets.GH_PAT }} + run: | + VERSION="${{ steps.meta.outputs.version }}" + git clone "https://execsumo:${GH_PAT}@github.com/execsumo/homebrew-heard.git" homebrew-tap + mkdir -p homebrew-tap/Casks + cp Casks/heard.rb homebrew-tap/Casks/heard.rb + cd homebrew-tap + git config user.name "github-actions[bot]" + git config user.email "github-actions[bot]@users.noreply.github.com" + git add Casks/heard.rb + git commit -m "Update heard to v${VERSION}" + git push origin HEAD:refs/heads/master