-
Notifications
You must be signed in to change notification settings - Fork 73
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
5 changed files
with
100 additions
and
7 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 |
---|---|---|
@@ -1,2 +1,3 @@ | ||
.idea | ||
dnslookup | ||
build |
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,39 @@ | ||
language: go | ||
sudo: false | ||
|
||
os: | ||
- linux | ||
|
||
env: | ||
- GO111MODULE=on | ||
- GIMME_GO_VERSION=1.x | ||
|
||
go: | ||
- 1.x | ||
- 1.11 | ||
|
||
script: | ||
# Windows-386 build | ||
- GOOS=windows GOARCH=386 VERSION=${TRAVIS_TAG:-dev} make release | ||
# Windows-amd64 build | ||
- GOOS=windows GOARCH=amd64 VERSION=${TRAVIS_TAG:-dev} make release | ||
# Linux-386 build | ||
- GOOS=linux GOARCH=386 VERSION=${TRAVIS_TAG:-dev} make release | ||
# Linux-amd64 build | ||
- GOOS=linux GOARCH=amd64 VERSION=${TRAVIS_TAG:-dev} make release | ||
# Darwin-amd64 build | ||
- GOOS=darwin GOARCH=amd64 VERSION=${TRAVIS_TAG:-dev} make release | ||
# List build output | ||
- ls -l build/dnslookup-* | ||
|
||
deploy: | ||
provider: releases | ||
api_key: $GITHUB_TOKEN | ||
file: | ||
- build/dnslookup-*.zip | ||
- build/dnslookup-*.tar.gz | ||
on: | ||
repo: ameshkov/dnslookup | ||
tags: true | ||
file_glob: true | ||
skip_cleanup: true |
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,43 @@ | ||
NAME=dnslookup | ||
BASE_BUILDDIR=build | ||
BUILDNAME=$(GOOS)-$(GOARCH) | ||
BUILDDIR=$(BASE_BUILDDIR)/$(BUILDNAME) | ||
VERSION?=dev | ||
|
||
ifeq ($(GOOS),windows) | ||
ext=.exe | ||
archiveCmd=zip -9 -r $(NAME)-$(BUILDNAME)-$(VERSION).zip $(BUILDNAME) | ||
else | ||
ext= | ||
archiveCmd=tar czpvf $(NAME)-$(BUILDNAME)-$(VERSION).tar.gz $(BUILDNAME) | ||
endif | ||
|
||
.PHONY: default | ||
default: build | ||
|
||
build: clean test | ||
go build | ||
|
||
release: check-env-release | ||
mkdir -p $(BUILDDIR) | ||
cp LICENSE $(BUILDDIR)/ | ||
cp README.md $(BUILDDIR)/ | ||
GOOS=$(GOOS) GOARCH=$(GOARCH) go build -ldflags "-X main.VersionString=$(VERSION)" -o $(BUILDDIR)/$(NAME)$(ext) | ||
cd $(BASE_BUILDDIR) ; $(archiveCmd) | ||
|
||
test: | ||
go test -race -v -bench=. ./... | ||
|
||
clean: | ||
go clean | ||
rm -rf $(BASE_BUILDDIR) | ||
|
||
check-env-release: | ||
@ if [ "$(GOOS)" = "" ]; then \ | ||
echo "Environment variable GOOS not set"; \ | ||
exit 1; \ | ||
fi | ||
@ if [ "$(GOARCH)" = "" ]; then \ | ||
echo "Environment variable GOOS not set"; \ | ||
exit 1; \ | ||
fi |
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