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

View File

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