diff --git a/.github/workflows/release-homebrew.yml b/.github/workflows/release-homebrew.yml new file mode 100644 index 0000000000..03fcb8be7d --- /dev/null +++ b/.github/workflows/release-homebrew.yml @@ -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 }} diff --git a/.github/workflows/snapcraft.yml b/.github/workflows/release-snapcraft.yml similarity index 96% rename from .github/workflows/snapcraft.yml rename to .github/workflows/release-snapcraft.yml index 5b50921d19..84eb9b185a 100644 --- a/.github/workflows/snapcraft.yml +++ b/.github/workflows/release-snapcraft.yml @@ -1,4 +1,4 @@ -name: Publish snap package +name: Publish Ignite to Snapcraft on: release: diff --git a/.gitpod/readme.md b/.gitpod/readme.md index 6fd0bce6e4..c56fe5dcf7 100644 --- a/.gitpod/readme.md +++ b/.gitpod/readme.md @@ -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 ``` diff --git a/docs/docs/01-welcome/02-install.md b/docs/docs/01-welcome/02-install.md index e073bb5d00..b810b73b85 100644 --- a/docs/docs/01-welcome/02-install.md +++ b/docs/docs/01-welcome/02-install.md @@ -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: @@ -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. diff --git a/packaging/brew/ignite.rb b/packaging/brew/ignite.rb new file mode 100644 index 0000000000..c00a6b47bd --- /dev/null +++ b/packaging/brew/ignite.rb @@ -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 diff --git a/packaging/readme.md b/packaging/readme.md index 2edc911c15..77b25a7b9b 100644 --- a/packaging/readme.md +++ b/packaging/readme.md @@ -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. + +* +* + +```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: diff --git a/readme.md b/readme.md index a1e15bd662..bc42f12b4c 100644 --- a/readme.md +++ b/readme.md @@ -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 ``` -
Troubleshoot