Skip to content

Commit

Permalink
ci(release): use popular brew bump action
Browse files Browse the repository at this point in the history
mhanberg committed Mar 27, 2024

Verified

This commit was signed with the committer’s verified signature.
mhanberg Mitchell Hanberg
1 parent 64fe2b3 commit 74d33a2
Showing 2 changed files with 18 additions and 45 deletions.
18 changes: 18 additions & 0 deletions .github/workflows/brew.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
name: Homebrew

on:
push:
tags:
- 'v*'

jobs:
homebrew:
runs-on: ubuntu-latest
steps:
- name: Bump Homebrew formula
uses: dawidd6/action-homebrew-bump-formula@v3
with:
token: ${{secrets.GH_API_TOKEN}}
no_fork: true
tap: elixir-tools/tap
formula: next-ls
45 changes: 0 additions & 45 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
@@ -86,48 +86,3 @@ jobs:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
steps:
- run: gh release edit ${{ needs.release.outputs.tag_name }} --draft=false --repo='elixir-tools/next-ls'

homebrew:
name: homebrew
needs: [publish, release]
runs-on: macos-14
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
steps:
- name: Set up Homebrew
id: set-up-homebrew
uses: Homebrew/actions/setup-homebrew@master

- name: Cache Homebrew Bundler RubyGems
id: cache
uses: actions/cache@v4
with:
path: ${{ steps.set-up-homebrew.outputs.gems-path }}
key: ${{ runner.os }}-rubygems-${{ steps.set-up-homebrew.outputs.gems-hash }}
restore-keys: ${{ runner.os }}-rubygems-

- name: Tap formula
run: brew tap elixir-tools/tap
- name: Configure git
run: |
git config --unset-all http.https://github.com/.extraheader
git config --global user.name github-actions[bot]
git config --global user.email github-actions[bot]@users.noreply.github.com
- name: Bump formula
env:
HOMEBREW_GITHUB_API_TOKEN: ${{ secrets.GITHUB_TOKEN }}
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
formula="next-ls"
version="${{ needs.release.outputs.tag_name }}"
url="https://github.com/elixir-tools/$formula/archive/refs/tags/$version.tar.gz"
sha="$(curl --silent -L "$url" | shasum -a 256 | cut -f 1 -d ' ' -)"
(
cd "$(brew --repository elixir-tools/homebrew-tap)"
git checkout main && git pull
)
brew bump-formula-pr "$formula" --url="$url" --sha256="$sha" --no-fork --no-browse

0 comments on commit 74d33a2

Please sign in to comment.