added Makefile

This commit is contained in:
Vito Castellano 2025-01-28 22:03:30 +01:00
commit 1a08c60b5c
No known key found for this signature in database
GPG key ID: CECE2FCDCCF84942
2 changed files with 38 additions and 0 deletions

7
.env Normal file
View file

@ -0,0 +1,7 @@
APP_NAME=bbrew
APP_VERSION=0.0.1-local
### BUILD DEV ENVIRONMENT
BUILD_GOVERSION=1.20
BUILD_GOOS=darwin
BUILD_GOARCH=arm64

31
Makefile Normal file
View file

@ -0,0 +1,31 @@
##############################
# VARIABLES
##############################
ifneq (,$(wildcard ./.env))
include .env
export
endif
%:@
##############################
# RELEASE
##############################
.PHONY: release-snapshot
release-snapshot:
goreleaser release --snapshot --clean
.PHONY: build-snapshot
build-snapshot:
goreleaser build --snapshot --clean
##############################
# BUILD
##############################
.PHONY: build
build:
@docker run --rm -v $(PWD):/app -w /app golang:$(BUILD_GOVERSION) \
env GOOS=$(BUILD_GOOS) GOARCH=$(BUILD_GOARCH) go build -o $(APP_NAME) ./cmd/$(APP_NAME)
.PHONY: run
run: build
./$(APP_NAME)