Skip to content

Commit 74d33a2

Browse files
committed
ci(release): use popular brew bump action
1 parent 64fe2b3 commit 74d33a2

File tree

2 files changed

+18
-45
lines changed

2 files changed

+18
-45
lines changed

.github/workflows/brew.yaml

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
name: Homebrew
2+
3+
on:
4+
push:
5+
tags:
6+
- 'v*'
7+
8+
jobs:
9+
homebrew:
10+
runs-on: ubuntu-latest
11+
steps:
12+
- name: Bump Homebrew formula
13+
uses: dawidd6/action-homebrew-bump-formula@v3
14+
with:
15+
token: ${{secrets.GH_API_TOKEN}}
16+
no_fork: true
17+
tap: elixir-tools/tap
18+
formula: next-ls

.github/workflows/release.yaml

Lines changed: 0 additions & 45 deletions
Original file line numberDiff line numberDiff line change
@@ -86,48 +86,3 @@ jobs:
8686
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
8787
steps:
8888
- run: gh release edit ${{ needs.release.outputs.tag_name }} --draft=false --repo='elixir-tools/next-ls'
89-
90-
homebrew:
91-
name: homebrew
92-
needs: [publish, release]
93-
runs-on: macos-14
94-
env:
95-
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
96-
steps:
97-
- name: Set up Homebrew
98-
id: set-up-homebrew
99-
uses: Homebrew/actions/setup-homebrew@master
100-
101-
- name: Cache Homebrew Bundler RubyGems
102-
id: cache
103-
uses: actions/cache@v4
104-
with:
105-
path: ${{ steps.set-up-homebrew.outputs.gems-path }}
106-
key: ${{ runner.os }}-rubygems-${{ steps.set-up-homebrew.outputs.gems-hash }}
107-
restore-keys: ${{ runner.os }}-rubygems-
108-
109-
- name: Tap formula
110-
run: brew tap elixir-tools/tap
111-
- name: Configure git
112-
run: |
113-
git config --unset-all http.https://github.com/.extraheader
114-
git config --global user.name github-actions[bot]
115-
git config --global user.email github-actions[bot]@users.noreply.github.com
116-
117-
- name: Bump formula
118-
env:
119-
HOMEBREW_GITHUB_API_TOKEN: ${{ secrets.GITHUB_TOKEN }}
120-
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
121-
run: |
122-
formula="next-ls"
123-
version="${{ needs.release.outputs.tag_name }}"
124-
url="https://github.com/elixir-tools/$formula/archive/refs/tags/$version.tar.gz"
125-
126-
sha="$(curl --silent -L "$url" | shasum -a 256 | cut -f 1 -d ' ' -)"
127-
(
128-
cd "$(brew --repository elixir-tools/homebrew-tap)"
129-
130-
git checkout main && git pull
131-
)
132-
133-
brew bump-formula-pr "$formula" --url="$url" --sha256="$sha" --no-fork --no-browse

0 commit comments

Comments
 (0)