Skip to content

Commit

Permalink
chore: add homebrew formula (#3950)
Browse files Browse the repository at this point in the history
  • Loading branch information
julienrbrt committed Feb 15, 2024
1 parent 55ad250 commit 17f1a76
Show file tree
Hide file tree
Showing 7 changed files with 98 additions and 22 deletions.
31 changes: 31 additions & 0 deletions .github/workflows/release-homebrew.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
name: Publish Ignite to HomeBrew

on:
release:
types: [published]

concurrency:
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
cancel-in-progress: true

jobs:
homebrew:
name: Bump Homebrew formula
runs-on: ubuntu-latest
steps:
- name: Extract version
id: extract-version
# Strip a string prefix from the git tag name:
run: |
echo "tag-name=${GITHUB_REF#refs/tags/}" >> $GITHUB_OUTPUT
- uses: mislav/bump-homebrew-formula-action@v3
with:
formula-name: ignite
formula-path: Formula/i/ignite.rb
homebrew-tap: Homebrew/homebrew-core
base-branch: master
download-url: https://github.com/ignite/cli/archive/refs/tags/${{ steps.extract-version.outputs.tag-name }}.tar.gz
env:
# the personal access token should have "repo" & "workflow" scopes
COMMITTER_TOKEN: ${{ secrets.COMMITTER_TOKEN }}
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Publish snap package
name: Publish Ignite to Snapcraft

on:
release:
Expand Down
14 changes: 14 additions & 0 deletions .gitpod/readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,20 @@ ignite chain serve

## Install Ignite CLI locally

You can install Ignite using [HomeBrew](https://formulae.brew.sh/formula/ignite) on macOS and GNU/Linux:

```sh
brew install ignite
```

Or using Snap on GNU/Linux:

```sh
snap install ignite --classic
```

Or manually using the following command:

```sh
curl https://get.ignite.com/cli | bash
```
Expand Down
29 changes: 16 additions & 13 deletions docs/docs/01-welcome/02-install.md
Original file line number Diff line number Diff line change
Expand Up @@ -37,28 +37,28 @@ ignite version

## Installing Ignite CLI

To install the latest version of the `ignite` binary use the following command.
To install the latest version of Ignite use [HomeBrew](https://formulae.brew.sh/formula/ignite) on macOS and GNU/Linux:

```bash
curl https://get.ignite.com/cli! | bash
```sh
brew install ignite
```

This command invokes `curl` to download the installation script and pipes the output to `bash` to perform the
installation. The `ignite` binary is installed in `/usr/local/bin`.
Or use Snap on GNU/Linux:

To learn more or customize the installation process, see the [installer docs](https://github.com/ignite/installer) on
GitHub.
```sh
snap install ignite --classic
```

### Install manually

:::tip
Alternatively, you can install Ignite CLI using a package manager on GNU/Linux:
Alternatively, you can install the latest version of the `ignite` binary use the following command:

```bash
snap install ignite --classic
curl https://get.ignite.com/cli! | bash
```

:::

### Write permission
This command invokes `curl` to download the installation script and pipes the output to `bash` to perform the
installation. The `ignite` binary is installed in `/usr/local/bin`.

Ignite CLI installation requires write permission to the `/usr/local/bin/` directory. If the installation fails because
you do not have write permission to `/usr/local/bin/`, run the following command:
Expand Down Expand Up @@ -87,6 +87,9 @@ In this case, use sudo before `curl` and before `bash`:
sudo curl https://get.ignite.com/cli | sudo bash
```

To learn more or customize the installation process, see the [installer docs](https://github.com/ignite/installer) on
GitHub.

## Upgrading your Ignite CLI installation {#upgrade}

Before you install a new version of Ignite CLI, remove all existing Ignite CLI installations.
Expand Down
20 changes: 20 additions & 0 deletions packaging/brew/ignite.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
class Ignite < Formula
desc "Build, launch, and maintain any crypto application with Ignite CLI"
homepage "https://github.com/ignite/cli"
url "https://github.com/ignite/cli/archive/refs/tags/v28.2.0.tar.gz"
sha256 "556f953fd7f922354dea64e7b3dade5dd75b3f62ece93167e2ba126cac27602e"
license "Apache-2.0"

depends_on "go"
depends_on "node"

def install
system "go", "build", "-mod=readonly", *std_go_args(output: bin/"ignite"), "./ignite/cmd/ignite"
end

test do
ENV["DO_NOT_TRACK"] = "1"
system bin/"ignite", "s", "chain", "mars"
assert_predicate testpath/"mars/go.mod", :exist?
end
end
12 changes: 11 additions & 1 deletion packaging/readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -42,4 +42,14 @@ A [github action](../.github/workflows/release-binary.yml) is used to build and

## HomeBrew

TBD.
Read the following resources to understand HomeBrew.

* <https://docs.brew.sh/>
* <https://docs.brew.sh/Formula-Cookbook>

```bash
HOMEBREW_NO_INSTALL_FROM_API=1 brew install --interactive ignite
brew audit --new-formula ignite
```

The formula is published in the [homebrew-core](https://github.com/homebrew/homebrew-core) repository: <https://github.com/Homebrew/homebrew-core/pull/161938>
12 changes: 5 additions & 7 deletions readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -39,25 +39,23 @@ so you can focus on writing business logic.

### Installation

You can install Ignite with one simple command:
You can install Ignite using [HomeBrew](https://formulae.brew.sh/formula/ignite) on macOS and GNU/Linux:

```sh
curl https://get.ignite.com/cli! | bash
brew install ignite
```

Or using a package manager on GNU/Linux:
Or using Snap on GNU/Linux:

```sh
snap install ignite --classic
```

<!--
or macOS:
Or manually using the following command:

```sh
brew install ignite
curl https://get.ignite.com/cli! | bash
```
-->

<details>
<summary>Troubleshoot</summary>
Expand Down

0 comments on commit 17f1a76

Please sign in to comment.