diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 9b71827..8b19b3c 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -34,6 +34,7 @@ jobs: args: release --rm-dist env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + HOMEBREW_TAP_GITHUB_TOKEN: ${{ secrets.HOMEBREW_TAP_GITHUB_TOKEN }} - name: Update krew-index uses: rajatjindal/krew-release-bot@v0.0.43 with: diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index d3ed7b5..2032800 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -21,3 +21,12 @@ jobs: go-version-file: go.mod cache: true - run: go test -v ./... + - name: Run GoReleaser + uses: goreleaser/goreleaser-action@v4 + with: + distribution: goreleaser + version: latest + args: release --rm-dist --snapshot + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + HOMEBREW_TAP_GITHUB_TOKEN: ${{ secrets.HOMEBREW_TAP_GITHUB_TOKEN }} diff --git a/.goreleaser.yml b/.goreleaser.yml index a227786..2750ba2 100644 --- a/.goreleaser.yml +++ b/.goreleaser.yml @@ -21,29 +21,32 @@ builds: env: - CGO_ENABLED=0 ldflags: - - -s -w - - -X github.com/boz/tail/version.Version={{.Tag}} - - -X github.com/boz/tail/version.Commit={{.ShortCommit}} - - -X github.com/boz/tail/version.Date={{.Date}} + - -s -w + - -X github.com/boz/tail/version.Version={{.Tag}} + - -X github.com/boz/tail/version.Commit={{.ShortCommit}} + - -X github.com/boz/tail/version.Date={{.Date}} - -X github.com/boz/tail/version.BuiltBy=GoReleaser - -X github.com/boz/tail/version.OsName={{.Os}} - -X github.com/boz/tail/version.PlatformName={{.Arch}} + - -X main.version={{.Tag}} + - -X main.commit={{.ShortCommit}} archives: - - - name_template: '{{ .ProjectName }}_{{ .Tag }}_{{ .Os }}_{{ .Arch }}{{ with .Arm }}v{{ . }}{{ end }}{{ with .Mips }}_{{ . }}{{ end }}{{ if not (eq .Amd64 "v1") }}{{ .Amd64 }}{{ end }}' + - name_template: '{{ .ProjectName }}_{{ .Tag }}_{{ .Os }}_{{ .Arch }}{{ with .Arm }}v{{ . }}{{ end }}{{ with .Mips }}_{{ . }}{{ end }}{{ if not (eq .Amd64 "v1") }}{{ .Amd64 }}{{ end }}' brews: - tap: owner: boz name: homebrew-repo branch: master + token: "{{ .Env.HOMEBREW_TAP_GITHUB_TOKEN }}" commit_author: name: boz email: adam.boz@gmail.com goamd64: v2 homepage: "https://github.com/boz/kail" description: "kubernetes tail - pod log viewer" + skip_upload: true checksum: name_template: "checksums.txt"