Permalink
Browse files

Add release command to Makefile

  • Loading branch information...
biilmann committed Jan 23, 2018
1 parent 73da633 commit fceb725419eaf577a58559c94fea1136a87eda92
Showing with 17 additions and 0 deletions.
  1. +2 −0 .gitignore
  2. +15 −0 Makefile
@@ -13,3 +13,5 @@ www/dist/
www/.DS_Store
www/node_modules
npm-debug.log
builds/
releases/
@@ -21,6 +21,21 @@ package: build
package_linux: override os=linux
package_linux: package
release: ## Upload release to GitHub releases.
mkdir -p builds/darwin-${TAG}
GOOS=darwin GOARCH=$(arch) go build -ldflags "-X github.com/netlify/gocommerce/cmd.Version=`git rev-parse HEAD`" -o builds/darwin-${TAG}/gocommerce
mkdir -p builds/linux-${TAG}
GOOS=linux GOARCH=$(arch) go build -ldflags "-X github.com/netlify/gocommerce/cmd.Version=`git rev-parse HEAD`" -o builds/linux-${TAG}/gocommerce
mkdir -p builds/windows-${TAG}
GOOS=windows GOARCH=$(arch) go build -ldflags "-X github.com/netlify/gocommerce/cmd.Version=`git rev-parse HEAD`" -o builds/windows-${TAG}/gocommerce.exe
@rm -rf releases/${TAG}
mkdir -p releases/${TAG}
tar -czf releases/${TAG}/gocommerce-darwin-$(arch)-${TAG}.tar.gz -C builds/darwin-${TAG} gocommerce
tar -czf releases/${TAG}/gocommerce-linux-$(arch)-${TAG}.tar.gz -C builds/linux-${TAG} gocommerce
zip -j releases/${TAG}/gocommerce-windows-$(arch)-${TAG}.zip builds/windows-${TAG}/gocommerce.exe
@hub release create -a releases/${TAG}/gocommerce-darwin-$(arch)-${TAG}.tar.gz -a releases/${TAG}/gocommerce-linux-$(arch)-${TAG}.tar.gz -a releases/${TAG}/gocommerce-windows-$(arch)-${TAG}.zip v${TAG}
deps: ## Install dependencies.
@go get -u github.com/golang/lint/golint
@go get -u github.com/Masterminds/glide && glide install

0 comments on commit fceb725

Please sign in to comment.