Skip to content

Commit

Permalink
Add Makefile release cmd and include assets
Browse files Browse the repository at this point in the history
  • Loading branch information
vidfamn committed Jul 20, 2021
1 parent a736ab0 commit 8f9fd35
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,17 @@ VERSION="v0.1-$(shell git rev-parse --short HEAD)"
BUILD_TIME=$(shell date +"%Y%m%d.%H%M%S")

build: clean
mkdir -p bin/assets
cp assets/notification_icon.png bin/assets

GOOS=linux GOARCH=amd64 go build -ldflags="-X 'main.Version=${VERSION}' -X 'main.Build=${BUILD_TIME}'" -o bin/OGSGameNotifier-amd64-linux main.go
GOOS=windows GOARCH=amd64 go build -ldflags="-X 'main.Version=${VERSION}' -X 'main.Build=${BUILD_TIME}' -H 'windowsgui'" -o bin/OGSGameNotifier-amd64-windows.exe main.go

# GOOS=darwin GOARCH=amd64 go build -ldflags="-X 'main.Version=${VERSION}' -X 'main.Build=${BUILD_TIME}'" -o bin/OGSGameNotifier-amd64-darwin main.go

release: clean build
tar -czvf bin/OGSGameNotifier-amd64-linux-${VERSION}.tar.gz bin/OGSGameNotifier-amd64-linux bin/assets
tar -czvf bin/OGSGameNotifier-amd64-windows-${VERSION}.tar.gz bin/OGSGameNotifier-amd64-windows.exe bin/assets

clean:
-rm -rf bin

0 comments on commit 8f9fd35

Please sign in to comment.