refactor: goreleaser config

pull/7/head
sundowndev 2021-07-07 15:47:05 +02:00
parent 0861890120
commit bc93c09571
2 changed files with 28 additions and 25 deletions

View File

@ -10,9 +10,9 @@ before:
- go mod tidy - go mod tidy
- go generate ./... - go generate ./...
signs: signs:
- signature: "{{ .ProjectName }}_SHA256SUMS.gpg" - signature: "myproject_SHA256SUMS.gpg"
artifacts: all artifacts: checksum
args: ["-u", "{{ .Env.GPG_FINGERPRINT }}", "--output", "${signature}", "--detach-sign", "${artifact}"] args: [ "--batch", "-u", "{{ .Env.GPG_FINGERPRINT }}", "--output", "${signature}", "--detach-sign", "${artifact}" ]
builds: builds:
- id: "myproject-build" - id: "myproject-build"
binary: myproject binary: myproject
@ -29,9 +29,9 @@ builds:
- arm - arm
- arm64 - arm64
- 386 - 386
ldflags: -s -w -X github.com/sundowndev/goreleaser-template.version={{.Version}} ldflags: "-X github.com/sundowndev/goreleaser-template.version={{.Version}}"
archives: archives:
- name_template: '{{ .ProjectName }}_{{ .Os }}_{{ .Arch }}{{ if .Arm }}v{{ .Arm }}{{ end }}' - name_template: '{{ .ProjectName }}_{{ .Os }}_{{ .Arch }}'
format: binary format: binary
replacements: replacements:
armv6: arm armv6: arm
@ -43,7 +43,9 @@ checksum:
snapshot: snapshot:
name_template: "{{ .Tag }}-next" name_template: "{{ .Tag }}-next"
dockers: dockers:
- image_templates: ["sundowndev/goreleaser-template:{{ .Version }}"] - image_templates:
- "sundowndev/goreleaser-template:{{ .Version }}"
- "sundowndev/goreleaser-template:{{ .Tag }}"
dockerfile: Dockerfile dockerfile: Dockerfile
build_flag_templates: build_flag_templates:
- --label=org.opencontainers.image.title={{ .ProjectName }} - --label=org.opencontainers.image.title={{ .ProjectName }}
@ -54,8 +56,9 @@ dockers:
- --label=org.opencontainers.image.created={{ time "2006-01-02T15:04:05Z07:00" }} - --label=org.opencontainers.image.created={{ time "2006-01-02T15:04:05Z07:00" }}
- --label=org.opencontainers.image.revision={{ .FullCommit }} - --label=org.opencontainers.image.revision={{ .FullCommit }}
- --label=org.opencontainers.image.licenses=MIT - --label=org.opencontainers.image.licenses=MIT
- --platform=linux/arm64
nfpms: nfpms:
- maintainer: sundowndev <raphael@crvx.fr> - maintainer: sundowndev <raphael@crvx.fr>
description: sample project description: sample project
homepage: https://github.com/sundowndev/goreleaser-template homepage: https://github.com/sundowndev/goreleaser-template
license: MIT license: MIT

View File

@ -4,7 +4,7 @@ import (
"fmt" "fmt"
) )
const version = "dev" var version = "dev"
func main() { func main() {
fmt.Println("Hello, world!", version) fmt.Println("Hello, world!", version)