From 66215404097135432785ba9f339de7735b91c1e2 Mon Sep 17 00:00:00 2001 From: sweexordious Date: Thu, 27 Jun 2024 16:39:53 +0100 Subject: [PATCH] chore: add golangi cli and release config files --- .golangci.yml | 11 +++++++++ .goreleaser.yaml | 63 ++++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 74 insertions(+) create mode 100644 .golangci.yml create mode 100644 .goreleaser.yaml diff --git a/.golangci.yml b/.golangci.yml new file mode 100644 index 0000000..5ea7614 --- /dev/null +++ b/.golangci.yml @@ -0,0 +1,11 @@ +run: + timeout: 5m + modules-download-mode: readonly + +linters: + enable: + - exportloopref + - gofumpt + - misspell + - revive + - prealloc diff --git a/.goreleaser.yaml b/.goreleaser.yaml new file mode 100644 index 0000000..3ae9d09 --- /dev/null +++ b/.goreleaser.yaml @@ -0,0 +1,63 @@ +# This is an example .goreleaser.yml file with some sensible defaults. +# Make sure to check the documentation at https://goreleaser.com + +before: + hooks: + - go mod tidy +builds: + - main: ./cmd/blobstreamx-monitor + binary: blobstreamx-monitor + env: + - VersioningPath={{ "github.com/celestiaorg/blobstreamx-monitor/cmd/blobstreamx-monitor/version" }} + goarch: + - amd64 + - arm64 + goos: + - darwin + - linux + ldflags: + # Ref: https://goreleaser.com/customization/templates/#common-fields + # + # .CommitDate is used to help with reproducible builds, ensuring that the + # same date is always used + # + # .FullCommit is git commit hash goreleaser is using for the release + # + # .Version is the version being released + - -X "{{ .Env.VersioningPath }}.buildTime={{ .CommitDate }}" + - -X "{{ .Env.VersioningPath }}.lastCommit={{ .FullCommit }}" + - -X "{{ .Env.VersioningPath }}.semanticVersion={{ .Version }}" +dist: ./build/goreleaser +archives: + - format: tar.gz + # this name template makes the OS and Arch compatible with the results of + # uname. + name_template: >- + {{ .ProjectName }}_ + {{- title .Os }}_ + {{- if eq .Arch "amd64" }}x86_64 + {{- else if eq .Arch "386" }}i386 + {{- else }}{{ .Arch }}{{ end }} + {{- if .Arm }}v{{ .Arm }}{{ end }} +checksum: + name_template: "checksums.txt" +signs: + - artifacts: checksum + args: + [ + "--batch", + "-u", + "{{ .Env.GPG_FINGERPRINT }}", + "--output", + "${signature}", + "--detach-sign", + "${artifact}", + ] +snapshot: + name_template: "{{ incpatch .Version }}-next" +changelog: + sort: asc + filters: + exclude: + - "^docs:" + - "^test:"