-
Notifications
You must be signed in to change notification settings - Fork 43
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Integrate stuffbin to create a standalone bin and add goreleaser conf
- Loading branch information
Showing
7 changed files
with
138 additions
and
24 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
# .goreleaser.yml | ||
builds: | ||
- binary: dictmaker | ||
goos: | ||
- darwin | ||
- linux | ||
goarch: | ||
- amd64 | ||
|
||
hooks: | ||
# stuff executables with static assets. | ||
post: make pack-releases | ||
|
||
archive: | ||
format: tar.gz | ||
files: | ||
- README.md | ||
- LICENSE | ||
- sample/* |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,23 @@ | ||
STATIC := config.toml.sample schema.sql queries.sql | ||
|
||
# Install dependencies needed for building | ||
.PHONY: deps | ||
deps: | ||
go get -u github.com/knadh/stuffbin/... | ||
|
||
.PHONY: build | ||
build: | ||
go build -o dictmaker | ||
stuffbin -a stuff -in dictmaker -out dictmaker ${STATIC} | ||
|
||
.PHONY: build-tokenizers | ||
build-tokenizers: | ||
# Compile the Kannada tokenizer. | ||
go build -ldflags="-s -w" -buildmode=plugin -o kannada.tk tokenizers/kannada/kannada.go | ||
|
||
.PHONY: run | ||
run: build | ||
./dictmaker --site alar | ||
# pack-releases runs stuffbin packing on a given list of | ||
# binaries. This is used with goreleaser for packing | ||
# release builds for cross-build targets. | ||
.PHONY: pack-releases | ||
pack-releases: | ||
$(foreach var,$(RELEASE_BUILDS),stuffbin -a stuff -in ${var} -out ${var} ${STATIC} $(var);) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters