Skip to content

Commit

Permalink
Add goreleaser support
Browse files Browse the repository at this point in the history
  • Loading branch information
mchack-work committed Nov 1, 2023
1 parent f55cbd7 commit e0ddfbe
Show file tree
Hide file tree
Showing 3 changed files with 118 additions and 0 deletions.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -15,3 +15,5 @@
/gotools/golangci-lint
/gotools/go-winres
test/venv

dist/
115 changes: 115 additions & 0 deletions .goreleaser.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,115 @@
# Make sure to check the documentation at https://goreleaser.com
before:
hooks:
# You may remove this if you don't use go modules.
- go mod tidy
# you may remove this if you don't need go generate
- go generate ./...
builds:
-
main: ./cmd/tkey-sign
binary: tkey-sign
env:
- GOPROXY=https://proxy.golang.org,direct
- GOSUMDB=sum.golang.org
- CGO_ENABLED=0

goos:
- linux
- windows
# Build for macOS in a separate way because we need CGO and
# shared libs
#- darwin

# Custom ldflags mostly to avoid setting main.date which for some
# reason is default
ldflags:
-s -w -X main.version={{ .Version }}

overrides:
- goos: darwin
env:
- CGO_ENABLED=1

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 }}
# use zip for windows archives
format_overrides:
- goos: windows
format: zip

nfpms:
# note that this is an array of nfpm configs
- #
# ID of the nfpm config, must be unique.
#
# Default: 'default'
#id: foo

# Name of the package.
# Default: ProjectName
# Templates: allowed. (since v1.18)
package_name: tkey-sign

# Your app's vendor.
vendor: Tillitis AB

# Your app's homepage.
homepage: https://tillitis.se/

# Your app's maintainer (probably you).
maintainer: Tillitis <hello@tillitis.se>

# Your app's description.
description: |-
Signing tool
A tool to digitally sign files with hardware-backed
cryptographic signature.
# Your app's license.
license: GPL 2.0

# Formats to be generated.
formats:
- apk
- deb
- rpm
- archlinux # Since: v1.13

# Contents to add to the package.
# GoReleaser will automatically add the binaries.
contents:
- src: doc/tkey-sign.1
dst: /usr/share/man/man1/tkey-sign.1

# Custom configuration applied only to the Deb packager.
deb:
# Lintian overrides
lintian_overrides:
- statically-linked-binary
- changelog-file-missing-in-native-package

checksum:
name_template: 'checksums.txt'
snapshot:
name_template: "{{ incpatch .Version }}-next"
changelog:
sort: asc
filters:
exclude:
- '^docs:'
- '^test:'


# The lines beneath this are called `modelines`. See `:help modeline`
# Feel free to remove those if you don't want/use them.
# yaml-language-server: $schema=https://goreleaser.com/static/schema.json
# vim: set ts=2 sw=2 tw=0 fo=cnqoj
1 change: 1 addition & 0 deletions tools/spdx-ensure
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ missingok_files=(
.editorconfig
.gitignore
.golangci.yml
.goreleaser.yaml
LICENSE
Makefile
README.md
Expand Down

0 comments on commit e0ddfbe

Please sign in to comment.