46 lines
1.6 KiB
Makefile
46 lines
1.6 KiB
Makefile
# Signed package repositories of r4ven-me (deb, rpm, arch, apk): keys, signing, publishing. Plain bash and Docker.
|
|
|
|
-include .local.mk
|
|
|
|
KDBX ?=
|
|
ENTRY ?=
|
|
ATTACH ?= r4ven-pkgs.private.asc
|
|
KDBX_PASS_CMD ?=
|
|
KEEP ?= 3
|
|
APK_ENTRY ?=
|
|
APK_ATTACH ?= r4ven-apk.pem
|
|
APK_RELEASE ?= 25.12
|
|
APK_ARCH ?= x86_64
|
|
SITE_REMOTE ?=
|
|
SITE_RSH ?= ssh
|
|
SITE_RSYNC_PATH ?= rsync
|
|
SRC ?=
|
|
FORGEJO_URL ?= https://git.r4ven.me
|
|
FORGEJO_TOKEN ?=
|
|
FORGEJO_TOKEN_CMD ?=
|
|
|
|
export KDBX ENTRY ATTACH KDBX_PASS_CMD KEEP APK_ENTRY APK_ATTACH APK_RELEASE APK_ARCH SITE_REMOTE SITE_RSH SITE_RSYNC_PATH FORGEJO_URL FORGEJO_TOKEN FORGEJO_TOKEN_CMD SRC
|
|
|
|
.PHONY: help keygen release test check clean
|
|
|
|
.DEFAULT_GOAL := help
|
|
|
|
help: ## Show this help
|
|
@grep -E '^[a-z-]+:.*## ' $(MAKEFILE_LIST) | awk -F':.*## ' '{printf " %-10s %s\n", $$1, $$2}'
|
|
|
|
keygen: ## Create the signing key; the private part goes to KeePassXC, the public part to keys/
|
|
scripts/keygen.sh
|
|
|
|
release: ## Sign and publish packages: make release SRC=../korterm/dist REPO=ivan/korterm TAG=v0.3.0
|
|
@test -n "$(SRC)" -a -n "$(REPO)" -a -n "$(TAG)" || { echo "usage: make release SRC=dir REPO=owner/name TAG=vX.Y.Z" >&2; exit 1; }
|
|
scripts/release.sh "$(REPO)" "$(TAG)"
|
|
|
|
test: ## End-to-end test: sign test packages, install them with apt, dnf, pacman and apk (needs docker and network)
|
|
tests/run_test.sh
|
|
|
|
check: ## Check the scripts with bash -n and shellcheck
|
|
bash -n scripts/*.sh tests/*.sh
|
|
shellcheck -x $(filter-out scripts/lib.sh,$(wildcard scripts/*.sh tests/*.sh))
|
|
|
|
clean: ## Remove release staging files and the local site mirror
|
|
rm -rf .work
|