Skip to content

Commit

Permalink
ci: Add Homebrew update
Browse files Browse the repository at this point in the history
  • Loading branch information
danielbayley authored and ingydotnet committed Jan 17, 2025
1 parent 51a9e87 commit d0f44c3
Showing 1 changed file with 50 additions and 0 deletions.
50 changes: 50 additions & 0 deletions .github/workflows/brew-update.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
name: Update Homebrew Formulae
on:
release:
types: [released]

workflow_dispatch:
push:
branches: [main]
paths:
- .github/workflows/brew-update.yaml

jobs:
Update:
runs-on: macos-latest
steps:
- name: Tap
run: |
brew tap ${{ github.repository_owner }}/yamlscript
brew install ys
- name: Livecheck
id: livecheck
env:
HOMEBREW_GITHUB_API_TOKEN: ${{ github.token }}
run: |
brew livecheck --newer-only --quiet --json ys |
jq --raw-output '"version=\(.[].version.latest)"' >> $GITHUB_OUTPUT
- name: Checkout
if: steps.livecheck.outputs.version != ''
uses: actions/checkout@v4

- name: Configure Git
if: steps.livecheck.outputs.version != ''
run: |
git config --global user.name ${{ github.repository_owner }}
git config --global user.email ${{ github.event.pusher.email }}
- name: Bump Version
if: steps.livecheck.outputs.version != ''
env:
version: ${{ steps.livecheck.outputs.version }}
GH_TOKEN: ${{ secrets.ACCESS_TOKEN }}
run: |
util/brew-update $version
cd homebrew-yamlscript
gh auth setup-git
git add --all
git commit --message "Update $version"
git push

0 comments on commit d0f44c3

Please sign in to comment.