Skip to content

Commit aac49f9

Browse files
mjcheethamdscho
authored andcommitted
homebrew: add GitHub workflow to release Cask
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>
1 parent 8075b2b commit aac49f9

File tree

1 file changed

+31
-0
lines changed

1 file changed

+31
-0
lines changed
Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
name: Update Homebrew Tap
2+
on:
3+
release:
4+
types: [released]
5+
6+
jobs:
7+
release:
8+
runs-on: ubuntu-latest
9+
environment: release
10+
steps:
11+
- id: version
12+
name: Compute version number
13+
run: |
14+
echo "result=$(echo $GITHUB_REF | sed -e "s/^refs\/tags\/v//")" >>$GITHUB_OUTPUT
15+
- id: hash
16+
name: Compute release asset hash
17+
uses: mjcheetham/asset-hash@v1.1
18+
with:
19+
asset: /git-(.*)\.pkg/
20+
hash: sha256
21+
token: ${{ secrets.GITHUB_TOKEN }}
22+
- name: Update scalar Cask
23+
uses: mjcheetham/update-homebrew@v1.3
24+
with:
25+
token: ${{ secrets.HOMEBREW_TOKEN }}
26+
tap: microsoft/git
27+
name: microsoft-git
28+
type: cask
29+
version: ${{ steps.version.outputs.result }}
30+
sha256: ${{ steps.hash.outputs.result }}
31+
alwaysUsePullRequest: false

0 commit comments

Comments
 (0)