2020-07-29 17:11:41 +08:00
|
|
|
build:
|
2021-09-29 18:04:08 +08:00
|
|
|
go build -ldflags="-s -w" goctl.go
|
2024-05-10 21:33:03 +08:00
|
|
|
$(if $(shell command -v upx || which upx), upx goctl)
|
2022-04-06 16:09:06 +08:00
|
|
|
|
2020-08-30 18:22:46 +08:00
|
|
|
mac:
|
2021-09-29 18:04:08 +08:00
|
|
|
GOOS=darwin go build -ldflags="-s -w" -o goctl-darwin goctl.go
|
2024-05-10 21:33:03 +08:00
|
|
|
$(if $(shell command -v upx || which upx), upx goctl-darwin)
|
2022-04-06 16:09:06 +08:00
|
|
|
|
2020-08-30 18:22:46 +08:00
|
|
|
win:
|
2021-09-29 18:04:08 +08:00
|
|
|
GOOS=windows go build -ldflags="-s -w" -o goctl.exe goctl.go
|
2024-05-10 21:33:03 +08:00
|
|
|
$(if $(shell command -v upx || which upx), upx goctl.exe)
|
2022-04-06 16:09:06 +08:00
|
|
|
|
2020-08-30 18:22:46 +08:00
|
|
|
linux:
|
2021-09-29 18:04:08 +08:00
|
|
|
GOOS=linux go build -ldflags="-s -w" -o goctl-linux goctl.go
|
2024-05-10 21:33:03 +08:00
|
|
|
$(if $(shell command -v upx || which upx), upx goctl-linux)
|
2022-04-05 13:07:05 +08:00
|
|
|
|
|
|
|
image:
|
|
|
|
docker build --rm --platform linux/amd64 -t kevinwan/goctl:$(version) .
|
|
|
|
docker tag kevinwan/goctl:$(version) kevinwan/goctl:latest
|
|
|
|
docker push kevinwan/goctl:$(version)
|
|
|
|
docker push kevinwan/goctl:latest
|
|
|
|
docker build --rm --platform linux/arm64 -t kevinwan/goctl:$(version)-arm64 .
|
|
|
|
docker tag kevinwan/goctl:$(version)-arm64 kevinwan/goctl:latest-arm64
|
|
|
|
docker push kevinwan/goctl:$(version)-arm64
|
|
|
|
docker push kevinwan/goctl:latest-arm64
|