From 7abc627b3d4f60cecefff1a5b8e844e80a862a91 Mon Sep 17 00:00:00 2001 From: Dmitry Borisov Date: Wed, 3 Nov 2021 17:20:39 +0300 Subject: [PATCH 1/3] Add Homebrew and version to binaries --- .github/workflows/build_on_release.yml | 13 +++++++++++- .goreleaser.yml | 29 ++++++++++++++++++++++++++ README.md | 6 ++++++ 3 files changed, 47 insertions(+), 1 deletion(-) diff --git a/.github/workflows/build_on_release.yml b/.github/workflows/build_on_release.yml index 69a078d5..79b9e956 100644 --- a/.github/workflows/build_on_release.yml +++ b/.github/workflows/build_on_release.yml @@ -1,19 +1,28 @@ name: "Build IZE on release" + on: release: types: [created] + jobs: Build: runs-on: ubuntu-latest + steps: - name: Install Go uses: actions/setup-go@v2 with: - go-version: 1.16.x + go-version: 1.17.x + - name: Checkout code uses: actions/checkout@v2 with: fetch-depth: 0 + + - name: Set env + run: | + echo "RELEASE_VERSION=${GITHUB_REF#refs/*/}" >> $GITHUB_ENV + - name: Run GoReleaser uses: goreleaser/goreleaser-action@v2 with: @@ -23,3 +32,5 @@ jobs: args: release -f .goreleaser.yml --rm-dist env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + HOMEBREW_TAP_GITHUB_TOKEN: ${{ secrets.HOMEBREW_TAP_GITHUB_TOKEN }} + RELEASE_VERSION: ${{ env.RELEASE_VERSION }} diff --git a/.goreleaser.yml b/.goreleaser.yml index 6689270f..d9fc506d 100644 --- a/.goreleaser.yml +++ b/.goreleaser.yml @@ -8,6 +8,35 @@ builds: goarch: - amd64 - arm64 + ignore: + - goos: windows + goarch: arm64 id: "ize" dir: . main: ./cmd + ldflags: + - -s -w -X 'github.com/hazelops/ize/internal/commands.Version={{.Env.RELEASE_VERSION}}' + +brews: + - name: ize + tap: + owner: hazelops + name: homebrew-ize + branch: main + # Optionally a token can be provided, if it differs from the token provided to GoReleaser + token: "{{ .Env.HOMEBREW_TAP_GITHUB_TOKEN }}" + download_strategy: CurlDownloadStrategy + commit_author: + name: ize + email: ize@hazelops.com + # The project name and current git tag are used in the format string. + commit_msg_template: "Brew formula update for {{ .ProjectName }} version {{ .Tag }}" + homepage: "https://ize.sh/" + description: "IZE is an opinionated infrastructure wrapper that allows to use multiple tools in one infra" + license: "MIT" + skip_upload: auto + test: | + system "#{bin}/ize" + # Custom install script for brew. + install: | + bin.install "ize" diff --git a/README.md b/README.md index 321ed835..2eeaa472 100644 --- a/README.md +++ b/README.md @@ -53,3 +53,9 @@ ize destroy infra 2.2 `brew install ize` #### 3. Now you can run `ize` from command shell by typing `ize` in console. + +#### 4. To update `ize`: + 4.1 Uninstall previous version (`brew uninstall ize`) + 4.2 Update version in brew repo: `brew tap hazelops/ize` + 4.3 Install `ize`: `brew install ize` + \ No newline at end of file From f0d40991878cc64d2e3a8f35b0680bc0b1db357d Mon Sep 17 00:00:00 2001 From: Dmitry Borisov Date: Wed, 3 Nov 2021 17:21:16 +0300 Subject: [PATCH 2/3] Add Homebrew and version to binaries 2 --- README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/README.md b/README.md index 2eeaa472..692fa09b 100644 --- a/README.md +++ b/README.md @@ -58,4 +58,5 @@ ize destroy infra 4.1 Uninstall previous version (`brew uninstall ize`) 4.2 Update version in brew repo: `brew tap hazelops/ize` 4.3 Install `ize`: `brew install ize` + \ No newline at end of file From b699f4c685adf8aa845ebf155335ac41574f2d83 Mon Sep 17 00:00:00 2001 From: Dmitry Borisov Date: Wed, 3 Nov 2021 17:21:56 +0300 Subject: [PATCH 3/3] Add Homebrew and version to binaries 3 --- README.md | 1 - 1 file changed, 1 deletion(-) diff --git a/README.md b/README.md index 692fa09b..5f3a4706 100644 --- a/README.md +++ b/README.md @@ -59,4 +59,3 @@ ize destroy infra 4.2 Update version in brew repo: `brew tap hazelops/ize` 4.3 Install `ize`: `brew install ize` - \ No newline at end of file