Skip to content

trigger-homebrew-update #13

trigger-homebrew-update

trigger-homebrew-update #13

name: Update Homebrew Tap
on:
release:
types: [published]
workflow_dispatch:
inputs:
version:
description: 'Specify the version number to update (without the v prefix)'
required: true
type: string
repository_dispatch:
types: [trigger-homebrew-update]
jobs:
update-homebrew-tap:
runs-on: macos-latest
if: ${{ github.event_name != 'release' || github.event.release.prerelease != true }}
steps:
- name: Get release version
id: get_version
run: |
if [ "${{ github.event_name }}" = "workflow_dispatch" ]; then
echo "VERSION=${{ inputs.version }}" >> $GITHUB_ENV
elif [ "${{ github.event_name }}" = "repository_dispatch" ]; then
VERSION_WITH_V=${{ github.event.client_payload.version }}
echo "VERSION=${VERSION_WITH_V#v}" >> $GITHUB_ENV
else
VERSION_WITH_V=${GITHUB_REF#refs/tags/}
echo "VERSION=${VERSION_WITH_V#v}" >> $GITHUB_ENV
fi
echo "Using version: $VERSION"
- name: Checkout repository
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Install jq
run: brew install jq
- name: Update Homebrew Cask
env:
GH_PAT: ${{ secrets.GH_PAT }}
CI_BUILD: true
run: make update-homebrew