diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml new file mode 100644 index 0000000..ecc6dd0 --- /dev/null +++ b/.github/workflows/release.yml @@ -0,0 +1,30 @@ +name: goreleaser + +on: + push: + tags: + - '*' + +jobs: + goreleaser: + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v3 + with: + fetch-depth: 0 + - name: Set up Go + uses: actions/setup-go@v3 + with: + go-version: 1.19 + - name: Set RELEASE_VERSION env + run: echo "RELEASE_VERSION=${GITHUB_REF#refs/*/}" >> $GITHUB_ENV + - name: Run GoReleaser + uses: goreleaser/goreleaser-action@v3 + with: + distribution: goreleaser + version: latest + args: release --rm-dist + env: + GITHUB_TOKEN: ${{ secrets.TAP_GITHUB_TOKEN }} + TAP_GITHUB_TOKEN: ${{ secrets.TAP_GITHUB_TOKEN }} diff --git a/.goreleaser.yml b/.goreleaser.yml new file mode 100644 index 0000000..33714ce --- /dev/null +++ b/.goreleaser.yml @@ -0,0 +1,34 @@ +before: + hooks: + - go mod download +builds: + - goos: + - linux + - darwin + goarch: + - amd64 + - arm64 + main: ./cmd/travelgrunt/main.go + ldflags: + - -X main.appVersion={{.Env.RELEASE_VERSION}} +brews: + - name: travelgrunt + homepage: 'https://github.com/ivanilves/travelgrunt' + description: 'Travel Terragrunt directory tree as a first class passenger!' + folder: Formula + tap: + owner: ivanilves + name: homebrew-travelgrunt +archives: + - name_template: "{{ .ProjectName }}_{{ .Version }}_{{ .Os }}_{{ .Arch }}" + format: tar.gz +checksum: + name_template: 'checksums.txt' +snapshot: + name_template: "{{ .Tag }}-next" +changelog: + sort: asc + filters: + exclude: + - '^docs:' + - '^test:' diff --git a/README.md b/README.md index add0007..b50c37f 100644 --- a/README.md +++ b/README.md @@ -39,6 +39,12 @@ curl -s -f \ | PREFIX=/somewhere/else sh ``` +Install with homebrew: +``` +brew tap ivanilves/travelgrunt +brew install ivanilves/travelgrunt +``` + ## How to build? * `make dep` - install/ensure dependencies;