Skip to content

Commit

Permalink
feat(ci): add goreleaser support
Browse files Browse the repository at this point in the history
  • Loading branch information
iyear committed Jul 24, 2022
1 parent f2d1a14 commit fc510ef
Show file tree
Hide file tree
Showing 2 changed files with 55 additions and 0 deletions.
49 changes: 49 additions & 0 deletions .goreleaser.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
project_name: searchx
dist: .searchx/dist
env:
- GO111MODULE=on
builds:
- env:
- CGO_ENABLED=0
flags:
- -trimpath
ldflags:
- -s -w
- -X {{ .ModulePath }}/global.Version={{ .RawVersion }}
- -X {{ .ModulePath }}/global.Commit={{ .ShortCommit }}
- -X {{ .ModulePath }}/global.CommitDate={{ .CommitDate }}
mod_timestamp: '{{ .CommitTimestamp }}'
goos:
- linux
- windows
- darwin
goarch:
- 386
- amd64
- arm
- arm64
goarm:
- 5
- 6
- 7
checksum:
name_template: '{{ .ProjectName }}_checksums.txt'
archives:
- name_template: '{{ .ProjectName }}_{{ .Os }}_{{ .Arch }}{{ if .Arm }}v{{ .Arm }}{{ end }}'
replacements:
darwin: MacOS
linux: Linux
windows: Windows
386: 32bit
amd64: 64bit
format_overrides:
- goos: windows
format: zip
files:
- README.md
- LICENSE
- config/i18n/*
- config/dict.txt
- config/config.example.yaml
changelog:
sort: asc
6 changes: 6 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -11,3 +11,9 @@ build:
@echo "Version: $(VERSION)"
go build -ldflags "$(GO_LDFLAGS)" -o "$(BUILD_DIR)/searchx-${GOOS}-${GOARCH}"
@echo "'searchx' has been built in the '.searchx' directory)!"

.PHONY: packaging
packaging:
goreleaser release --skip-publish --snapshot --rm-dist
@echo "go to '.searchx/dist' directory to see the packages!"

0 comments on commit fc510ef

Please sign in to comment.