You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 

29 lines
1.2 KiB

#!/bin/bash
VERSION="0.0.3"
export OLD_GOOS=$(go env GOOS)
export OLD_GOARCH=$(go env GOARCH)
mkdir bin
mkdir bin/$VERSION
# buid for macos x86 64-bit
export GOOS=darwin
export GOARCH=amd64
mkdir bin/$VERSION/$(go env GOOS)-$(go env GOARCH)
cp .env.example ./bin/$VERSION/$(go env GOOS)-$(go env GOARCH)/.env.example
go build -o ./bin/$VERSION/$(go env GOOS)-$(go env GOARCH)/middlewhere-$VERSION-$(go env GOOS)-$(go env GOARCH)
$(go env GOPATH)/bin/rice append --exec ./bin/$VERSION/$(go env GOOS)-$(go env GOARCH)/middlewhere-$VERSION-$(go env GOOS)-$(go env GOARCH)
tar -czvf ./bin/$VERSION/$VERSION-$(go env GOOS)-$(go env GOARCH).tar.gz ./bin/$VERSION/$(go env GOOS)-$(go env GOARCH)
# buid for linux x86 64-bit
export GOOS=linux
export GOARCH=amd64
mkdir bin/$VERSION/$(go env GOOS)-$(go env GOARCH)
cp .env.example ./bin/$VERSION/$(go env GOOS)-$(go env GOARCH)/.env.example
go build -o ./bin/$VERSION/$(go env GOOS)-$(go env GOARCH)/middlewhere-$VERSION-$(go env GOOS)-$(go env GOARCH)
$(go env GOPATH)/bin/rice append --exec ./bin/$VERSION/$(go env GOOS)-$(go env GOARCH)/middlewhere-$VERSION-$(go env GOOS)-$(go env GOARCH)
tar -czvf ./bin/$VERSION/$VERSION-$(go env GOOS)-$(go env GOARCH).tar.gz ./bin/$VERSION/$(go env GOOS)-$(go env GOARCH)