Skip to content

Commit

Permalink
release: update homebrew deployment (#1386)
Browse files Browse the repository at this point in the history
Update `release-homebrew` workflow to use the `brew bump-cask-pr` command [1].
This aligns with the Homebrew project's official recommendations for creating
PRs in the `Homebrew/homebrew-cask` tap and removes GCM's dependency on the
`mjcheetham/update-homebrew` task [2].

1: https://docs.brew.sh/How-To-Open-a-Homebrew-Pull-Request#submit-a-new-version-of-an-existing-cask
2: https://github.com/mjcheetham/update-homebrew
  • Loading branch information
ldennington authored Aug 21, 2023
2 parents 488aa48 + 3fb216d commit e076f58
Showing 1 changed file with 16 additions and 12 deletions.
28 changes: 16 additions & 12 deletions .github/workflows/release-homebrew.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,17 +5,21 @@ on:

jobs:
release:
runs-on: ubuntu-latest
runs-on: macos-latest
environment: release
env:
HOMEBREW_GITHUB_API_TOKEN: ${{ secrets.HOMEBREW_TOKEN }}
steps:
- name: Update Homebrew tap
uses: mjcheetham/[email protected]
with:
token: ${{ secrets.HOMEBREW_TOKEN }}
tap: Homebrew/homebrew-cask
name: git-credential-manager
type: cask
alwaysUsePullRequest: true
releaseAsset: |
gcm-osx-x64-(.*)\.pkg
gcm-osx-arm64-(.*)\.pkg
- name: Open PR against homebrew/homebrew-cask
run: |
# Get latest version
version=$(curl --silent "https://api.github.com/repos/git-ecosystem/git-credential-manager/releases/latest" |
grep '"tag_name":' |
sed -E 's/.*"v([0-9\.]+).*/\1/')
# Ensure local Homebrew repository is up to date
cd "$(brew --repository homebrew/cask)"
git pull
# Open PR to update to latest version
brew bump-cask-pr git-credential-manager --version $version --no-audit --no-browse

0 comments on commit e076f58

Please sign in to comment.