Skip to content

Commit f63be0f

Browse files
committed
ci(release): auto-update homebrew tap after releases
1 parent 7427e85 commit f63be0f

1 file changed

Lines changed: 31 additions & 0 deletions

File tree

.github/workflows/release.yml

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -123,3 +123,34 @@ jobs:
123123
generate_release_notes: true
124124
tag_name: ${{ env.RELEASE_TAG }}
125125
files: dist/*
126+
127+
update-homebrew-tap:
128+
name: Update Homebrew tap
129+
runs-on: ubuntu-24.04
130+
needs: release
131+
if: ${{ secrets.HOMEBREW_TAP_TOKEN != '' }}
132+
133+
steps:
134+
- name: Check out tap repository
135+
uses: actions/checkout@v4
136+
with:
137+
repository: oops-rs/homebrew-tap
138+
ref: main
139+
token: ${{ secrets.HOMEBREW_TAP_TOKEN }}
140+
path: tap
141+
142+
- name: Update langcodec-cli formula
143+
run: bash tap/scripts/update-formula.sh langcodec-cli "${RELEASE_TAG}"
144+
145+
- name: Commit updated formula
146+
run: |
147+
if git -C tap diff --quiet -- Formula; then
148+
echo "langcodec-cli formula already up to date"
149+
exit 0
150+
fi
151+
152+
git -C tap config user.name "github-actions[bot]"
153+
git -C tap config user.email "41898282+github-actions[bot]@users.noreply.github.com"
154+
git -C tap add Formula
155+
git -C tap commit -m "langcodec-cli ${RELEASE_TAG}"
156+
git -C tap push origin HEAD:main

0 commit comments

Comments
 (0)