From ef71996bf700cb108fba5c2c68a6dfd52ce25ba7 Mon Sep 17 00:00:00 2001 From: ben dewan Date: Mon, 31 Jul 2017 09:47:59 -0400 Subject: [PATCH 1/4] Fix up the .travis.yml file based on feedback from docwhat Releases were not working because `git clean` was being on called on the repo by travis and I was unaware of that --- .travis.yml | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/.travis.yml b/.travis.yml index 95d4f4e..29027a0 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,7 +1,10 @@ +sudo: false language: go - -go: -- 1.8 +go: 1.8 +notifications: + email: + on_success: never + on_failure: never before_deploy: - mv $GOPATH/bin/pachelbel ${TRAVIS_BUILD_DIR} @@ -12,6 +15,7 @@ before_deploy: - zip ${TRAVIS_BUILD_DIR}/pachelbel_windows_amd64.zip ./pachelbel.exe deploy: + skip_cleanup: true provider: releases file: - ${TRAVIS_BUILD_DIR}/pachelbel_linux_amd64.tgz @@ -21,3 +25,4 @@ deploy: secure: UdI8QXj4ftVKoE2poKVC3NKr2xGgVHdC5+/o5I3C7VXKibI98Go/t6TfWkkOBH8fzYjj5hSZ+npjeopZCJUrSezRL1mtC7gyF5h+ExvcgkJjJNv/VhFQpopddJUifHiDXk/oGSV/cXsZR0N0IGfX0QB2/Y6DiLY5bAuZ6hSMHgOr8jsFKPKZoMYOFImdLr9Ducln1aPgNQO/HlGVrGwDsCUBazD4onUm7fMBNXcBUvnSLVas3izTda+NYYlX2aQncSrqvuQFi7sK+ny4RwX2tCW2m2/5WVk5oHTmhzr9B4FIfYi5pyzPKywvUNwJgkepLCbhkZVx3Uh7nN/rZCiRhBPa3qiVXihexi0ydbwnJm+d5vjbFreK2fzjGHEDT2jEUfgVzQiV6XE8Cch5yVT+gfg43E+nUF70Uja063ti8/9GvA27h0c1dg+bu5tz8p/lB8YIv3f0NeYG3odAzTH/mfSgV5S8l5ztGqMw2G192ZdvAPnSI0GMutoa4d1tdzrTTi8n9iY9sCJdrMTtuGK2hzUBRNUlFjw5+mT+WQIGdUdgi/A2Q4NmY+I7NEyeWwPdqB1MHhjqdIXjqWY+HWxparCaUgdg2rkA4z+VvVDVnCc2lqKYeiV9x1cvdFpAFiyGg1Yg6KluZoialh/xwNq761JsTZGcNWCpRrFkYjbs8PA= on: tags: true + repo: benjdewan/pachelbel From 06d9d128a5ba96f140d11d1470395231f88282c7 Mon Sep 17 00:00:00 2001 From: ben dewan Date: Mon, 31 Jul 2017 09:48:57 -0400 Subject: [PATCH 2/4] Set the version using git tags This way a person does not need to manually verify that the release version in the code is in sync with the release tags --- Makefile | 8 ++++---- cmd/version.go | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/Makefile b/Makefile index 9558918..cea8ed4 100644 --- a/Makefile +++ b/Makefile @@ -1,4 +1,4 @@ -CC=gcc +LDFLAGS="-X github.com/benjdewan/pachelbel/cmd.version=$(shell git describe --tags || echo DEV-BUILD)" .PHONY: all clean @@ -18,13 +18,13 @@ endif post-build: linux-build macos-build windows-build linux-build: test-build - CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go install github.com/benjdewan/pachelbel + CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go install -ldflags $(LDFLAGS) github.com/benjdewan/pachelbel macos-build: test-build - CGO_ENABLED=0 GOOS=darwin GOARCH=amd64 go install github.com/benjdewan/pachelbel + CGO_ENABLED=0 GOOS=darwin GOARCH=amd64 go install -ldflags $(LDFLAGS) github.com/benjdewan/pachelbel windows-build: test-build - CGO_ENABLED=0 GOOS=windows GOARCH=amd64 go install github.com/benjdewan/pachelbel + CGO_ENABLED=0 GOOS=windows GOARCH=amd64 go install -ldflags $(LDFLAGS) github.com/benjdewan/pachelbel test-build: pre-build $(GOPATH)/bin/gometalinter cmd/ connection/ main.go diff --git a/cmd/version.go b/cmd/version.go index 2644ee6..8ff3c5f 100644 --- a/cmd/version.go +++ b/cmd/version.go @@ -26,7 +26,7 @@ import ( "github.com/spf13/cobra" ) -const version string = "v0.1.2" +var version string = "DEV-BUILD" var versionCmd = &cobra.Command{ Use: "version", From 06cde8a9f2088e69143b7ed87804071a45a4aa01 Mon Sep 17 00:00:00 2001 From: ben dewan Date: Mon, 31 Jul 2017 10:22:42 -0400 Subject: [PATCH 3/4] Add release artifact files to .gitignore --- .gitignore | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/.gitignore b/.gitignore index 47ed842..0128991 100644 --- a/.gitignore +++ b/.gitignore @@ -3,3 +3,7 @@ vendor/github.com/ vendor/golang.org/ vendor/gopkg.in/ +pachelbel +pachelbel.exe +pachelbel*.tgz +pachelbel*.zip From dd5bbe4d4638b7a9f615b6e4e5595faa88a31267 Mon Sep 17 00:00:00 2001 From: ben dewan Date: Mon, 31 Jul 2017 10:54:45 -0400 Subject: [PATCH 4/4] Additional cleanup * Add leading '/' characters to .gitignore paths * Shorten the import path --- .gitignore | 14 +++++++------- Makefile | 2 +- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/.gitignore b/.gitignore index 0128991..374557b 100644 --- a/.gitignore +++ b/.gitignore @@ -1,9 +1,9 @@ *~ .*.sw[a-z] -vendor/github.com/ -vendor/golang.org/ -vendor/gopkg.in/ -pachelbel -pachelbel.exe -pachelbel*.tgz -pachelbel*.zip +/vendor/github.com/ +/vendor/golang.org/ +/vendor/gopkg.in/ +/pachelbel +/pachelbel.exe +/pachelbel*.tgz +/pachelbel*.zip diff --git a/Makefile b/Makefile index cea8ed4..ac1365d 100644 --- a/Makefile +++ b/Makefile @@ -1,4 +1,4 @@ -LDFLAGS="-X github.com/benjdewan/pachelbel/cmd.version=$(shell git describe --tags || echo DEV-BUILD)" +LDFLAGS="-X /cmd.version=$(shell git describe --tags || echo DEV-BUILD)" .PHONY: all clean