-
Notifications
You must be signed in to change notification settings - Fork 40
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
51a9e87
commit d0f44c3
Showing
1 changed file
with
50 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |