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,23 +43,26 @@ checksum:
snapshot: snapshot:
name_template: "{{ .Tag }}-next" name_template: "{{ .Tag }}-next"
dockers: dockers:
- image_templates: ["sundowndev/goreleaser-template:{{ .Version }}"] - image_templates:
dockerfile: Dockerfile - "sundowndev/goreleaser-template:{{ .Version }}"
build_flag_templates: - "sundowndev/goreleaser-template:{{ .Tag }}"
- --label=org.opencontainers.image.title={{ .ProjectName }} dockerfile: Dockerfile
- --label=org.opencontainers.image.description={{ .ProjectName }} build_flag_templates:
- --label=org.opencontainers.image.url=https://github.com/sundowndev/goreleaser-template - --label=org.opencontainers.image.title={{ .ProjectName }}
- --label=org.opencontainers.image.source=https://github.com/sundowndev/goreleaser-template - --label=org.opencontainers.image.description={{ .ProjectName }}
- --label=org.opencontainers.image.version={{ .Version }} - --label=org.opencontainers.image.url=https://github.com/sundowndev/goreleaser-template
- --label=org.opencontainers.image.created={{ time "2006-01-02T15:04:05Z07:00" }} - --label=org.opencontainers.image.source=https://github.com/sundowndev/goreleaser-template
- --label=org.opencontainers.image.revision={{ .FullCommit }} - --label=org.opencontainers.image.version={{ .Version }}
- --label=org.opencontainers.image.licenses=MIT - --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: 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
formats: formats:
- deb - deb
- rpm - rpm
- apk - apk

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)