Skip to content

Commit

Permalink
Use awk instead of homebrew for formulae upgrades.
Browse files Browse the repository at this point in the history
  • Loading branch information
lnsp committed Dec 8, 2024
1 parent 5cdbe86 commit 2f4075b
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions .github/workflows/go.yml
Original file line number Diff line number Diff line change
Expand Up @@ -146,11 +146,13 @@ jobs:
env:
SSH_AUTH_SOCK: /tmp/ssh_agent.sock
run: |
brew tap valar/tap [email protected]:valar/homebrew-tap.git
cd $(brew --repo valar/tap)
brew bump-formula-pr --write-only \
--url=https://github.com/valar/cli/archive/refs/tags/${{ steps.get_version.outputs.version }}.tar.gz \
valar/tap/valar
git clone [email protected]:valar/homebrew-tap.git ~/valar-tap && cd ~/valar-tap
NEW_URL="https://github.com/valar/cli/archive/refs/tags/${{ steps.get_version.outputs.version}.tar.gz"
NEW_SHA256="$(curl -sSL $NEW_URL | sha256sum -)"
awk -v new_url="$NEW_URL" '{gsub(/url ".*"/, "url \""new_url"\"")} 1' Formula/valar.rb > Formula/valar.rb
awk -v new_sha256="$NEW_SHA256" '{gsub(/sha256 ".*"/, "sha256 \""new_sha256"\"")} 1' Formula/valar.rb > Formula/valar.rb
git commit -a -m "Bump version to ${{ steps.get_version.outputs.version }}"
git push -u

0 comments on commit 2f4075b

Please sign in to comment.