Add .deb packaging, GitHub Actions CI/CD, and release workflows
CI / test (push) Failing after 17m30s
CI / test (push) Failing after 17m30s
- Makefile: add 'deb' and 'release' targets; fix migrate/create syntax - scripts/build-deb.sh: build .deb with systemd unit, postinst/prerm/postrm - .github/workflows/ci.yml: go build, test, lint on PR/push to main - .github/workflows/release.yml: multi-platform build (linux/darwin/windows × amd64/arm64), .deb for Linux, tarballs, draft GitHub Release on tag v* - README.md: add CI/Release badges, Install section with .deb and binary release instructions
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
.PHONY: build run test lint clean migrate dev prod deps fmt
|
||||
.PHONY: build run test lint clean migrate dev prod deps fmt deb release
|
||||
|
||||
# Binary name
|
||||
BINARY=llamalink
|
||||
@@ -8,7 +8,9 @@ LDFLAGS=-ldflags "-X main.Version=$(VERSION) -X main.BuildTime=$(BUILD_TIME)"
|
||||
|
||||
# Directories
|
||||
BUILD_DIR=./bin
|
||||
DIST_DIR=./dist
|
||||
FRONTEND_DIR=./web/frontend
|
||||
DEB_ARCH=$(shell dpkg --print-architecture 2>/dev/null || echo "amd64")
|
||||
|
||||
# Go parameters
|
||||
GOCMD=go
|
||||
@@ -60,7 +62,7 @@ deps:
|
||||
|
||||
## clean: Remove build artifacts
|
||||
clean:
|
||||
rm -rf $(BUILD_DIR)
|
||||
rm -rf $(BUILD_DIR) $(DIST_DIR)
|
||||
rm -f coverage.out
|
||||
rm -f *.db
|
||||
|
||||
@@ -72,8 +74,9 @@ migrate/up:
|
||||
migrate/down:
|
||||
migrate -path internal/db/migrations -database "$(DATABASE_URL)" down
|
||||
|
||||
## migrate/create: Create a new migration
|
||||
migrate/create NAME=add_users_table:
|
||||
## migrate/create: Create a new migration (Usage: make migrate/create NAME=add_users_table)
|
||||
migrate/create:
|
||||
@if [ -z "$(NAME)" ]; then echo "Usage: make migrate/create NAME=add_users_table"; exit 1; fi
|
||||
migrate create -path internal/db/migrations -ext .sql -dir internal/db/migrations $(NAME)
|
||||
|
||||
## frontend/install: Install frontend dependencies
|
||||
@@ -99,6 +102,19 @@ docker/run:
|
||||
## docker/build/run: Build and run with docker-compose
|
||||
docker/build/run: docker/build docker/run
|
||||
|
||||
## deb: Build .deb package (requires dpkg-deb, Linux only)
|
||||
deb: build
|
||||
@echo "Building .deb package..."
|
||||
@./scripts/build-deb.sh $(VERSION) $(DEB_ARCH)
|
||||
|
||||
## release: Build all release artifacts locally
|
||||
release:
|
||||
@echo "Building release artifacts for $(VERSION)..."
|
||||
@mkdir -p $(DIST_DIR)
|
||||
$(MAKE) build
|
||||
$(MAKE) deb
|
||||
@echo "Release artifacts in $(DIST_DIR)/"
|
||||
|
||||
## help: Show this help
|
||||
help:
|
||||
@grep -E '^[a-zA-Z_-]+:.*?## .*$$' $(MAKEFILE_LIST) | sort | awk 'BEGIN {FS = ":.*?## "}; {printf "\033[36m%-20s\033[0m %s\n", $$1, $$2}'
|
||||
|
||||
Reference in New Issue
Block a user