diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 771fcde..a24bf86 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -61,3 +61,22 @@ jobs: token: ${{ secrets.ECOSYSTEM_READ_TOKEN }} skip: lean-axioms - run: git diff --check + + formula: + runs-on: macos-latest + env: + HOMEBREW_NO_AUTO_UPDATE: 1 + steps: + - uses: actions/checkout@v5 + with: + persist-credentials: false + - name: Audit the formula as committed + run: | + brew tap-new --no-git ci/local + tap=$(brew --repository ci/local) + cp Formula/oatp.rb "$tap/Formula/oatp.rb" + brew audit --strict ci/local/oatp + - name: Install and test the prebuilt binary + run: | + brew install ci/local/oatp + brew test ci/local/oatp diff --git a/Formula/oatp.rb b/Formula/oatp.rb new file mode 100644 index 0000000..40fa725 --- /dev/null +++ b/Formula/oatp.rb @@ -0,0 +1,32 @@ +class Oatp < Formula + desc "Orchestrate automated theorem provers from Lean 4 and the CLI" + homepage "https://github.com/jonaprieto/oatp" + license "Apache-2.0" + + on_macos do + if Hardware::CPU.arm? + url "https://github.com/jonaprieto/oatp/releases/download/v0.7.11/oatp-0.7.11-macos-arm64.tar.gz" + sha256 "50c195457ade0e94a23d056d0c36c6ba2708e5c3a5ab983649a7ab501b413017" + else + url "https://github.com/jonaprieto/oatp/releases/download/v0.7.11/oatp-0.7.11-macos-x86_64.tar.gz" + sha256 "bceb134d9cd9b154fe9cc42f16455807f3a8e8ae8b5788b27a11158ab43453c8" + end + end + + on_linux do + if Hardware::CPU.intel? + url "https://github.com/jonaprieto/oatp/releases/download/v0.7.11/oatp-0.7.11-linux-x86_64.tar.gz" + sha256 "eca67e908a30d43e917c66301212616adfa7fc2b3117564171e391e6a0271df7" + else + odie "oatp currently publishes Linux x86_64 binaries only" + end + end + + def install + bin.install "oatp" + end + + test do + assert_match "oatp version #{version}", shell_output("#{bin}/oatp --version") + end +end diff --git a/README.md b/README.md index 164a78a..46b66ca 100644 --- a/README.md +++ b/README.md @@ -29,7 +29,16 @@ Changes are reviewed, tested, and remain the maintainer's responsibility. ## Install the binary -Install the latest release binary with [`jpillora/installer`](https://github.com/jpillora/installer): +With Homebrew (macOS arm64 and x86_64, Linux x86_64): + +```sh +brew tap jonaprieto/oatp https://github.com/jonaprieto/oatp +brew trust --formula jonaprieto/oatp/oatp +brew install oatp +oatp --version +``` + +Or, on any platform, install the latest release binary with [`jpillora/installer`](https://github.com/jpillora/installer): ```sh curl https://i.jpillora.com/jonaprieto/oatp! | bash