-
Notifications
You must be signed in to change notification settings - Fork 25
43 lines (36 loc) · 1.35 KB
/
update-formula.yml
File metadata and controls
43 lines (36 loc) · 1.35 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
name: Update Homebrew Formula
on:
release:
types: [published]
jobs:
update-formula:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Set up Ruby
uses: ruby/setup-ruby@v1
with:
ruby-version: '3.2'
- name: Install dependencies
run: |
gem install bundler
bundle install
- name: Update Formula
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
# Get the release version and SHA256
VERSION=$(echo ${{ github.ref }} | sed 's/refs\/tags\/v//')
SHA256=$(curl -sL https://github.com/paritytech/revive/archive/refs/tags/v${VERSION}.tar.gz | shasum -a 256 | cut -d' ' -f1)
# Update the Formula file
sed -i "s/url .*/url \"https:\/\/github.com\/paritytech\/revive\/archive\/refs\/tags\/v${VERSION}.tar.gz\"/" Formula/resolc.rb
sed -i "s/sha256 .*/sha256 \"${SHA256}\"/" Formula/resolc.rb
# Commit and push changes
git config --global user.name "github-actions[bot]"
git config --global user.email "41898282+github-actions[bot]@users.noreply.github.com"
git add Formula/resolc.rb
git commit -m "Update resolc to v${VERSION}"
git push