Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,4 @@ mkr
build
snapshot
packaging/*.deb
dist
120 changes: 120 additions & 0 deletions .goreleaser.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,120 @@
# yaml-language-server: $schema=https://raw.githubusercontent.com/goreleaser/goreleaser/v2.9.0/www/docs/static/schema.json

version: 2
before:
hooks:
- go mod tidy
archives:
- formats:
- "binary"

- id: archives
ids:
- normal
- normal-deb-only
- normal-archives-only-linux
- normal-archives-only-darwin
name_template: "{{ .ProjectName }}_{{ .Os }}_{{ .Arch }}"
formats:
- "tar.gz"
files:
- LICENSE
- README.md
format_overrides:
- goos: darwin
formats:
- zip

builds:
- id: normal
env: &env
- CGO_ENABLED=0
goos: &goos
- linux
goarch:
- amd64
- arm64
binary: &normal-binary mkr
ldflags: &ldflags
- -s -w

- id: normal-deb-only
env: *env
goos: *goos
goarch:
- arm
goarm:
- "6" # specify ARMv6 for supporting Raspberry Pi 1 / Zero
binary: *normal-binary
ldflags: *ldflags

- id: normal-archives-only-linux
env: *env
goos: *goos
goarch:
- "386"
binary: *normal-binary
ldflags: *ldflags

- id: normal-archives-only-darwin
env: *env
goos:
- darwin
goarch:
- amd64
- arm64
binary: *normal-binary
ldflags: *ldflags

nfpms:
- id: normal-rpm
ids:
- normal
description: &description mackerel.io api client tool
homepage: &homepage https://mackerel.io
license: &license ASL 2.0
file_name_template: >-
{{- .PackageName -}}-{{- .Version }}-1.el7.centos.
{{- if eq .Arch "amd64" -}}x86_64{{- end -}}
{{- if eq .Arch "arm64" -}}aarch64{{- end -}}
{{- .ConventionalExtension -}}
maintainer: &maintainer Hatena <mackerel-developers@hatena.ne.jp>
formats: &rpm-formats
- rpm
package_name: mkr

- id: amazon-rpm
ids:
- normal
description: *description
homepage: *homepage
license: *license
file_name_template: >-
{{- .PackageName -}}-{{- .Version }}-1.amzn2.
{{- if eq .Arch "amd64" -}}x86_64{{- end -}}
{{- if eq .Arch "arm64" -}}aarch64{{- end -}}
{{- .ConventionalExtension -}}
maintainer: *maintainer
formats: *rpm-formats
package_name: mkr

- id: normal-deb
ids:
- normal
- normal-deb-only
description: *description
homepage: *homepage
license: *license
maintainer: *maintainer
file_name_template: >-
{{- .PackageName -}}_{{- .Version }}-1.v2_
{{- if eq .Arch "arm" -}}armhf{{ else -}}{{- .Arch -}}{{- end -}}
{{- .ConventionalExtension -}}
section: admin
priority: extra
formats:
- deb
package_name: mkr

release:
disable: true
Loading