From 47788c7c4af06183a8be40df70bb42ae355b5f86 Mon Sep 17 00:00:00 2001 From: nikhilsbhat Date: Wed, 3 Apr 2024 22:11:08 +0530 Subject: [PATCH] Update goreleaser config file and modify the command used in makefile as per the updated goreleaser --- .goreleaser.yml | 18 ++++++++++-------- Makefile | 6 +++--- 2 files changed, 13 insertions(+), 11 deletions(-) diff --git a/.goreleaser.yml b/.goreleaser.yml index 52845e6..ce7c935 100644 --- a/.goreleaser.yml +++ b/.goreleaser.yml @@ -44,12 +44,16 @@ dockers: archives: - format: 'tar.gz' - replacements: - darwin: Darwin - linux: Linux - 386: i386 - amd64: x86_64 - name_template: '{{ .ProjectName }}_{{ .Version }}_{{ .Os }}_{{ .Arch }}' + name_template: >- + {{- .ProjectName }}_ + {{- .Version }}_ + {{- .Os }}_ + {{- if eq .Arch "amd64" }}x86_64 + {{- else if eq .Arch "386" }}i386 + {{- else }}{{ .Arch }}{{ end }} + +snapshot: + name_template: "{{ .ProjectName }}_{{ .Version }}_{{ .Runtime.Goos }}_{{ .Runtime.Goarch }}" checksum: name_template: '{{ .ProjectName }}_{{ .Version }}_SHA256SUMS' @@ -58,8 +62,6 @@ checksum: signs: - artifacts: checksum args: - # if you are using this in a GitHub action or some other automated pipeline, you - # need to pass the batch flag to indicate its not interactive. - "--batch" - "--local-user" - "{{ .Env.GPG_FINGERPRINT }}" # set this environment variable for your signing key diff --git a/Makefile b/Makefile index 2a37ed7..4717a01 100644 --- a/Makefile +++ b/Makefile @@ -34,7 +34,7 @@ local.check: local.fmt ## Loads all the dependencies to vendor directory @go mod tidy local.build: local.check ## Generates the artifact with the help of 'go build' - GOVERSION=${GOVERSION} BUILD_ENVIRONMENT=${BUILD_ENVIRONMENT} goreleaser build --rm-dist + GOVERSION=${GOVERSION} BUILD_ENVIRONMENT=${BUILD_ENVIRONMENT} goreleaser build --clean local.push: local.build ## Pushes built artifact to the specified location @@ -42,10 +42,10 @@ local.run: local.build ## Generates the artifact and start the service in the cu ./${APP_NAME} publish: local.check ## Builds and publishes the app - GOVERSION=${GOVERSION} BUILD_ENVIRONMENT=${BUILD_ENVIRONMENT} PLUGIN_PATH=${APP_DIR} goreleaser release --rm-dist + GOVERSION=${GOVERSION} BUILD_ENVIRONMENT=${BUILD_ENVIRONMENT} PLUGIN_PATH=${APP_DIR} goreleaser release --clean mock.publish: local.check ## Builds and mocks app release - GOVERSION=${GOVERSION} BUILD_ENVIRONMENT=${BUILD_ENVIRONMENT} PLUGIN_PATH=${APP_DIR} goreleaser release --skip-publish --rm-dist + GOVERSION=${GOVERSION} BUILD_ENVIRONMENT=${BUILD_ENVIRONMENT} PLUGIN_PATH=${APP_DIR} goreleaser release --skip=publish --clean lint: ## Lint's application for errors, it is a linters aggregator (https://github.com/golangci/golangci-lint). if [ -z "${DEV}" ]; then golangci-lint run --color always ; else docker run --rm -v $(APP_DIR):/app -w /app golangci/golangci-lint:v1.46.2-alpine golangci-lint run --color always ; fi