Skip to content

Commit

Permalink
homebrew: add GitHub workflow to release Cask
Browse files Browse the repository at this point in the history
Add a GitHub workflow that is triggered on the `release` event to
automatically update the `microsoft-git` Homebrew Cask on the
`microsoft/git` Tap.

A secret `HOMEBREW_TOKEN` with push permissions to the
`microsoft/homebrew-git` repository must exist. A pull request will be
created at the moment to allow for last minute manual verification.

Signed-off-by: Matthew John Cheetham <mjcheetham@outlook.com>
  • Loading branch information
mjcheetham authored and dscho committed Aug 16, 2023
1 parent 8316e7e commit 226ddca
Showing 1 changed file with 31 additions and 0 deletions.
31 changes: 31 additions & 0 deletions .github/workflows/release-homebrew.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
name: Update Homebrew Tap
on:
release:
types: [released]

jobs:
release:
runs-on: ubuntu-latest
environment: release
steps:
- id: version
name: Compute version number
run: |
echo "result=$(echo $GITHUB_REF | sed -e "s/^refs\/tags\/v//")" >>$GITHUB_OUTPUT
- id: hash
name: Compute release asset hash
uses: mjcheetham/asset-hash@v1.1
with:
asset: /git-(.*)\.pkg/
hash: sha256
token: ${{ secrets.GITHUB_TOKEN }}
- name: Update scalar Cask
uses: mjcheetham/update-homebrew@v1.3
with:
token: ${{ secrets.HOMEBREW_TOKEN }}
tap: microsoft/git
name: microsoft-git
type: cask
version: ${{ steps.version.outputs.result }}
sha256: ${{ steps.hash.outputs.result }}
alwaysUsePullRequest: false

0 comments on commit 226ddca

Please sign in to comment.