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>
This commit is contained in:
Matthew John Cheetham 2020-07-24 15:27:57 +01:00 коммит произвёл Johannes Schindelin
Родитель 820079f461
Коммит 3492d822ef
1 изменённых файлов: 31 добавлений и 0 удалений

31
.github/workflows/release-homebrew.yml поставляемый Normal file
Просмотреть файл

@ -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