Skip to content

Commit

Permalink
Merge pull request #21 from hazelops/feature/add_go_releaser_homebrew…
Browse files Browse the repository at this point in the history
…_version

Add Homebrew to GoReleaser and version to ize binary (TOOLS-85, TOOLS-93)
  • Loading branch information
kobrikx authored Nov 3, 2021
2 parents 10ac338 + b699f4c commit fb25cda
Show file tree
Hide file tree
Showing 3 changed files with 47 additions and 1 deletion.
13 changes: 12 additions & 1 deletion .github/workflows/build_on_release.yml
Original file line number Diff line number Diff line change
@@ -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:
Expand All @@ -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 }}
29 changes: 29 additions & 0 deletions .goreleaser.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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: [email protected]
# 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"
6 changes: 6 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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`

0 comments on commit fb25cda

Please sign in to comment.