Skip to content

Commit

Permalink
chore: update goreleaser
Browse files Browse the repository at this point in the history
  • Loading branch information
katallaxie authored Aug 6, 2024
1 parent b60a359 commit 80d2af1
Show file tree
Hide file tree
Showing 2 changed files with 49 additions and 10 deletions.
44 changes: 41 additions & 3 deletions .goreleaser.yml
Original file line number Diff line number Diff line change
@@ -1,13 +1,42 @@
project_name: terraform-provider-openfga

env:
- GO111MODULE=on
- CGO_ENABLED=0

before:
hooks:
- go mod tidy
- go mod download
builds:
- skip: true
- id: main
binary: terraform-provider-openfga
main: ./main.go
goos:
- windows
- darwin
- linux
goarch:
- 386
- amd64
- arm
- arm64
ldflags:
- -s -w
no_unique_dist_dir: true

archives:
- id: main
builds:
- main
name_template: "terraform_provider_openfga_{{ .Version }}_{{ .Os }}_{{ .Arch }}"

release:
header: |
## Changelog ({{ .Date }})
Welcome to this new release! We hope you enjoy the changes we've made.
changelog:
groups:
- title: Features
Expand All @@ -23,4 +52,13 @@ changelog:
exclude:
- "^docs:"
- typo
- (?i)foo
- (?i)foo

gomod:
proxy: true

checksum:
name_template: "{{ .ProjectName }}_checksums.txt"

snapshot:
name_template: SNAPSHOT-{{.ShortCommit}}
15 changes: 8 additions & 7 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,18 +1,19 @@
.DEFAULT_GOAL := build

GO ?= go
GO ?= go
GO_RUN_TOOLS ?= $(GO) run -modfile ./tools/go.mod
GO_TEST ?= $(GO_RUN_TOOLS) gotest.tools/gotestsum --format pkgname
GO_TEST ?= $(GO_RUN_TOOLS) gotest.tools/gotestsum --format pkgname
GO_RELEASER ?= $(GO_RUN_TOOLS) github.com/goreleaser/goreleaser
GO_MOD ?= $(shell ${GO} list -m)

# Module name
MODULE_NAME ?= github.com/katallaxie/template-go
GO_MOD ?= $(shell ${GO} list -m)

.PHONY: build
build: ## Build the binary file.
$(GO_RELEASER) build --snapshot --clean

.PHONY: release
release: ## Create a release
$(GO_RELEASER) release --clean

.PHONY: generate
generate: ## Generate code.
$(GO) generate ./...
Expand Down Expand Up @@ -42,4 +43,4 @@ clean: ## Remove previous build.

.PHONY: help
help: ## Display this help screen.
@grep -E '^[a-z.A-Z_-]+:.*?## .*$$' $(MAKEFILE_LIST) | sort | awk 'BEGIN {FS = ":.*?## "}; {printf "\033[36m%-30s\033[0m %s\n", $$1, $$2}'
@grep -E '^[a-z.A-Z_-]+:.*?## .*$$' $(MAKEFILE_LIST) | sort | awk 'BEGIN {FS = ":.*?## "}; {printf "\033[36m%-30s\033[0m %s\n", $$1, $$2}'

0 comments on commit 80d2af1

Please sign in to comment.