Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Add release command to Makefile
  • Loading branch information
biilmann committed Jan 23, 2018
1 parent 73da633 commit fceb725
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 0 deletions.
2 changes: 2 additions & 0 deletions .gitignore
Expand Up @@ -13,3 +13,5 @@ www/dist/
www/.DS_Store
www/node_modules
npm-debug.log
builds/
releases/
15 changes: 15 additions & 0 deletions Makefile
Expand Up @@ -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
Expand Down

0 comments on commit fceb725

Please sign in to comment.