mirror of
https://github.com/ModernRelay/omnigraph.git
synced 2026-06-09 01:35:18 +02:00
Automate Homebrew tap updates on release tags
This commit is contained in:
parent
c82408ccdf
commit
ad7027c7e9
2 changed files with 141 additions and 0 deletions
38
.github/workflows/release.yml
vendored
38
.github/workflows/release.yml
vendored
|
|
@ -66,3 +66,41 @@ jobs:
|
|||
files: |
|
||||
${{ matrix.asset_name }}.tar.gz
|
||||
${{ matrix.asset_name }}.sha256
|
||||
|
||||
update_homebrew_tap:
|
||||
name: Update Homebrew tap
|
||||
needs: build_release
|
||||
if: ${{ secrets.HOMEBREW_TAP_TOKEN != '' }}
|
||||
runs-on: ubuntu-latest
|
||||
permissions:
|
||||
contents: read
|
||||
steps:
|
||||
- name: Checkout source
|
||||
uses: actions/checkout@v5.0.1
|
||||
|
||||
- name: Checkout Homebrew tap
|
||||
uses: actions/checkout@v5.0.1
|
||||
with:
|
||||
repository: ModernRelay/homebrew-tap
|
||||
token: ${{ secrets.HOMEBREW_TAP_TOKEN }}
|
||||
path: homebrew-tap
|
||||
|
||||
- name: Update formula from release assets
|
||||
env:
|
||||
GH_TOKEN: ${{ github.token }}
|
||||
run: |
|
||||
./scripts/update-homebrew-formula.sh "${GITHUB_REF_NAME}" homebrew-tap/Formula/omnigraph.rb
|
||||
|
||||
- name: Commit and push formula update
|
||||
working-directory: homebrew-tap
|
||||
run: |
|
||||
if git diff --quiet -- Formula/omnigraph.rb; then
|
||||
echo "Formula already up to date"
|
||||
exit 0
|
||||
fi
|
||||
|
||||
git config user.name "github-actions[bot]"
|
||||
git config user.email "41898282+github-actions[bot]@users.noreply.github.com"
|
||||
git add Formula/omnigraph.rb
|
||||
git commit -m "Update Omnigraph formula to ${GITHUB_REF_NAME}"
|
||||
git push origin HEAD:main
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue