-
Notifications
You must be signed in to change notification settings - Fork 22
add homebrew taps #292
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
add homebrew taps #292
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,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) | ||
|
Comment on lines
+29
to
+32
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. We also do LLVM releases from this repo. So we need to detect this here and skip if it is a LLVM release. |
||
|
|
||
| # 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 | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,28 @@ | ||
| # Revive Homebrew Tap | ||
|
|
||
| This repository contains the Homebrew formula for the Revive Solidity Compiler (resolc). | ||
|
|
||
| ## Installation | ||
|
|
||
| To install resolc using Homebrew: | ||
|
|
||
| ```bash | ||
| brew tap paritytech/revive | ||
| brew install resolc | ||
| ``` | ||
|
|
||
| ## Updating | ||
|
|
||
| To update the formula: | ||
|
|
||
| 1. Create a new release on GitHub | ||
| 2. Update the `url` and `sha256` in `Formula/resolc.rb` | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Stale comment? This should be handled by the github workflow? |
||
| 3. Commit and push the changes | ||
|
|
||
| ## Development | ||
|
|
||
| To install the development version: | ||
|
|
||
| ```bash | ||
| brew install --HEAD resolc | ||
| ``` | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,33 @@ | ||
| class Resolc < Formula | ||
| desc "Revive Solidity Compiler" | ||
| homepage "https://github.com/paritytech/revive" | ||
| url "https://github.com/paritytech/revive/releases/download/v0.1.0-dev.14/resolc-universal-apple-darwin" | ||
| sha256 "7d5b3cd4233e60e8bfaade398062f1b609166dcb251424cd9d402e51126d8b4f" | ||
| license "MIT/Apache-2.0" | ||
|
|
||
| # If someone wants to build from latest source: | ||
| head "https://github.com/paritytech/revive.git", branch: "master" | ||
| depends_on "llvm@18" => :build if build.head? # only needed when building from source | ||
|
Comment on lines
+8
to
+10
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This won't work because we need our custom LLVM in order to build resolc. So either remove or add a second Formula for our LLVM build. We also do binary releases of those in our repo. |
||
|
|
||
| def install | ||
| if build.head? | ||
| # ensure they have a working rust toolchain via rustup | ||
| odie "rustup is required to build Resolc from source; please install it from https://rustup.rs/" \ | ||
| unless Utils.which("rustup") | ||
|
|
||
| # use rustup's stable toolchain to build in release mode | ||
| system "rustup", "run", "stable", "cargo", "install", | ||
| "--locked", # lock Cargo.lock for reproducible builds | ||
| "--root", prefix, # install into Homebrew prefix | ||
| "--path", "." # current repo | ||
| else | ||
| # just strip any quarantine attribute and install the universal binary | ||
| system "xattr", "-c", "resolc-universal-apple-darwin" | ||
| bin.install "resolc-universal-apple-darwin" => "resolc" | ||
| end | ||
| end | ||
|
|
||
| test do | ||
| assert_match version.to_s, shell_output("#{bin}/resolc --version") | ||
| end | ||
| end | ||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We use fixed version by convention.