Skip to content

Commit e84b670

Browse files
ci: test brew release script
1 parent 9a5c338 commit e84b670

File tree

1 file changed

+23
-3
lines changed

1 file changed

+23
-3
lines changed

Diff for: .github/workflows/release.yml

+23-3
Original file line numberDiff line numberDiff line change
@@ -54,8 +54,28 @@ jobs:
5454
goarch: ${{ matrix.goarch }}
5555
goversion: ${{ steps.set_goversion.outputs.goversion }}
5656

57-
# homebrew:
58-
# runs-on: ubuntu-latest
59-
# run: |
57+
homebrew:
58+
runs-on: ubuntu-latest
59+
steps:
60+
- name: clone tap
61+
run: |
62+
# Clone the repository
63+
git clone https://github.com/jesses-code-adventures/homebrew-tap
64+
cd homebrew-tap
65+
66+
# Use sed to replace version number in-place without creating a backup file
67+
sed -i -E "s/v[0-9]+\.[0-9]+\.[0-9]+(-lw)?/${{ env.TAG_NAME }}/g" Formula/excavator.rb
68+
69+
# Extract the new URL from the file
70+
URL=$(grep "url \"" Formula/excavator.rb | sed 's/.*url "\(.*\)".*/\1/')
71+
72+
# Fetch the tarball and compute its SHA256 hash
73+
SHA=$(curl -Ls "$URL" | shasum -a 256 | cut -d ' ' -f 1)
6074
75+
# Use sed to replace the sha256 line in-place
76+
sed -i "s/sha256 .*/sha256 \"$SHA\"/" Formula/excavator.rb
6177
78+
# Add changes, commit, and push back to the repository
79+
git add Formula/excavator.rb
80+
git commit -m "Update excavator to ${{ env.TAG_NAME }}"
81+
git push origin main # Adjust as needed to your branch name

0 commit comments

Comments
 (0)