From fbad5db9b998ca64feaffee78ba680300d3a52a6 Mon Sep 17 00:00:00 2001 From: Shulhan Date: Thu, 22 Jan 2026 14:57:20 +0700 Subject: Makefile: add task for build and deploy to internal kilabit --- Makefile | 14 ++++++++++++++ lilin.go | 2 +- 2 files changed, 15 insertions(+), 1 deletion(-) diff --git a/Makefile b/Makefile index f70d28a..82ceffc 100644 --- a/Makefile +++ b/Makefile @@ -1,9 +1,18 @@ ## SPDX-License-Identifier: GPL-3.0-only ## SPDX-FileCopyrightText: 2025 M. Shulhan +VERSION=$(shell git describe --long | sed 's/\([^-]*-g\)/r\1/;s/-/./g') + .PHONY: all all: lint test +.PHONY: build +build: LD_FLAGS+=-X 'git.sr.ht/~shulhan/lilin.Version=$(VERSION)' +build: + go build \ + -ldflags="$(LD_FLAGS)" \ + ./cmd/lilin/ + .PHONY: lint lint: go vet ./... @@ -28,3 +37,8 @@ dev.test: .PHONY: serve.docs serve.docs: ciigo serve _www/doc + +.PHONY: deploy.kilabit +deploy.kilabit: build + rsync lilin lilin.kilabit.internal:~/bin/lilin + ssh lilin.kilabit.internal "sudo systemctl restart lilin.service" diff --git a/lilin.go b/lilin.go index 70ce678..1c311f0 100644 --- a/lilin.go +++ b/lilin.go @@ -9,7 +9,7 @@ import ( ) // Version latest released version. -const Version = `0.2.0` +var Version = `0.2.0` // defTimeout define default timeout for service and client connection. const defTimeout = 5 * time.Second -- cgit v1.3