Setup release binaries and goreleaser

This commit is contained in:
hedy 2023-01-14 18:45:31 +08:00
parent c01872419a
commit bb8ac01706
Signed by: hedy
GPG Key ID: B51B5A8D1B176372
3 changed files with 65 additions and 0 deletions

2
.gitignore vendored
View File

@ -12,3 +12,5 @@
# Output of the go coverage tool, specifically when used with LiteIDE
*.out
# destination directory of built binaries for release
dist/

59
.goreleaser.yml Normal file
View File

@ -0,0 +1,59 @@
project_name: gelim
builds:
- env:
- CGO_ENABLED=0
goos:
- linux
# - windows
- darwin
- freebsd
- netbsd
- openbsd
goarch:
- 386
- amd64
- arm64
- arm
goarm:
- 6
- 7
ignore:
- goos: darwin
goarch: 386
- goos: freebsd
goarch: arm
- goos: freebsd
goarch: arm64
- goos: netbsd
goarch: arm
- goos: netbsd
goarch: arm64
- goos: openbsd
goarch: arm
- goos: openbsd
goarch: arm64
ldflags:
- -s -w -X main.Version={{.Version}}
archives:
- format: tar.gz
# this name template makes the OS and Arch compatible with the results of uname.
name_template: >-
{{ .ProjectName }}_{{ .Version }}_{{ .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
changelog:
skip: true
release:
skip_upload: true
# yaml-language-server: $schema=https://goreleaser.com/static/schema.json
# vim: set ts=2 sw=2 tw=0 fo=cnqoj

View File

@ -75,3 +75,7 @@ uninstall:
${RMDIR_IF_EMPTY} $(DESTDIR)$(BINDIR)
$(RMDIR_IF_EMPTY) $(DESTDIR)$(MANDIR)/man1
$(RMDIR_IF_EMPTY) $(DESTDIR)$(MANDIR)
.PHONY: release
release:
goreleaser release --skip-publish --skip-validate --rm-dist