From 80d2af147e3704a8d70e412a939d4560b5f60c14 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sebastian=20D=C3=B6ll?= Date: Tue, 6 Aug 2024 19:36:27 +0000 Subject: [PATCH] chore: update goreleaser --- .goreleaser.yml | 44 +++++++++++++++++++++++++++++++++++++++++--- Makefile | 15 ++++++++------- 2 files changed, 49 insertions(+), 10 deletions(-) diff --git a/.goreleaser.yml b/.goreleaser.yml index e87390e..89e1f99 100644 --- a/.goreleaser.yml +++ b/.goreleaser.yml @@ -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 @@ -23,4 +52,13 @@ changelog: exclude: - "^docs:" - typo - - (?i)foo \ No newline at end of file + - (?i)foo + +gomod: + proxy: true + +checksum: + name_template: "{{ .ProjectName }}_checksums.txt" + +snapshot: + name_template: SNAPSHOT-{{.ShortCommit}} diff --git a/Makefile b/Makefile index 433c1e5..246191a 100644 --- a/Makefile +++ b/Makefile @@ -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 ./... @@ -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}' \ No newline at end of file + @grep -E '^[a-z.A-Z_-]+:.*?## .*$$' $(MAKEFILE_LIST) | sort | awk 'BEGIN {FS = ":.*?## "}; {printf "\033[36m%-30s\033[0m %s\n", $$1, $$2}'