diff --git a/Makefile b/Makefile index c7aa150..05104ac 100644 --- a/Makefile +++ b/Makefile @@ -7,3 +7,29 @@ clean: dev: go build -o ./dist/envy . + + +BINARY := myapp +VERSION := $(shell git describe --tags --always --dirty) +OUTPUT := dist + +GOOSARCHES = \ + linux/amd64 \ + linux/arm64 \ + darwin/amd64 \ + darwin/arm64 \ + windows/amd64 \ + windows/arm64 + +prod: + @echo "==> Building version $(VERSION)" + @mkdir -p $(OUTPUT) + @for platform in $(GOOSARCHES); do \ + OS=$${platform%/*}; \ + ARCH=$${platform#*/}; \ + EXT=""; \ + if [ $$OS = "windows" ]; then EXT=".exe"; fi; \ + OUTFILE=$(OUTPUT)/$(BINARY)-$(VERSION)-$$OS-$$ARCH$$EXT; \ + echo " -> $$OS/$$ARCH"; \ + GOOS=$$OS GOARCH=$$ARCH go build -ldflags="-s -w" -trimpath -o $$OUTFILE . || exit 1; \ + done \ No newline at end of file diff --git a/README.md b/README.md index 88f150f..c174e44 100644 --- a/README.md +++ b/README.md @@ -84,3 +84,8 @@ make ### envy edit - Open .env file in the default editor + +### envy delete + +- Delete a particular environment, or the entire project +- Cannot delete current environment