From c73dfde9313ff8b5804ff7b8e44aa1b752bd4e16 Mon Sep 17 00:00:00 2001 From: Rosy-Glorious Miki Date: Tue, 3 Feb 2026 12:03:03 -0500 Subject: [PATCH 1/2] fix: separate PREFIX and DESTDIR paths Signed-off-by: Rosy-Glorious Miki --- Makefile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Makefile b/Makefile index f357a38..4b6fd1c 100644 --- a/Makefile +++ b/Makefile @@ -17,8 +17,8 @@ endif PACKAGES := $(shell go list $(GOFLAGS) ./...) SOURCE_DIRS = $(shell echo $(PACKAGES) | awk 'BEGIN{FS="/"; RS=" "}{print $$4}' | uniq) -PREFIX ?= ${DESTDIR}/usr -INSTALLDIR=${PREFIX}/bin +PREFIX ?= /usr +INSTALLDIR=${DESTDIR}${PREFIX}/bin export PATH := $(PATH):${GOBIN} From 2b9dd898fd4626f052e007ec4519133fac3cd51c Mon Sep 17 00:00:00 2001 From: Rosy-Glorious Miki Date: Tue, 3 Feb 2026 14:28:19 -0500 Subject: [PATCH 2/2] feat: add make dist target for source tarball creation Signed-off-by: Rosy-Glorious Miki --- .github/workflows/ci.yml | 2 ++ Makefile | 14 +++++++++++++- 2 files changed, 15 insertions(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 93734aa..d3114a0 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -33,6 +33,8 @@ jobs: run: | dnf update -y dnf install -y golang make tar diffutils bzip2 gzip curl git which + - name: Mark repo as safe for git + run: git config --global --add safe.directory $GITHUB_WORKSPACE - name: Check out repository uses: actions/checkout@v6 - name: Build and test diff --git a/Makefile b/Makefile index 4b6fd1c..43419e0 100644 --- a/Makefile +++ b/Makefile @@ -1,4 +1,8 @@ -.PHONY: all build clean fmt install lint test tools unit-test integration-test validate .install.golangci-lint +PROJECT := tar-diff +VERSION := $(shell grep -oP 'VERSION\s*=\s*"\K[^"]+' pkg/common/version.go) +PROJ_TARBALL := $(PROJECT)_$(VERSION).tar.gz + +.PHONY: all build clean fmt install lint test tools dist unit-test integration-test validate .install.golangci-lint export GOPROXY=https://proxy.golang.org @@ -24,6 +28,9 @@ export PATH := $(PATH):${GOBIN} all: tools tar-diff tar-patch test validate +$(PROJ_TARBALL): + git archive --prefix=tar-diff_$(VERSION)/ --format=tar.gz HEAD --output $(PROJ_TARBALL) + build: go build $(GOFLAGS) ./... @@ -47,6 +54,7 @@ tools: .install.golangci-lint clean: rm -f tar-diff tar-patch + rm -rf $(PROJECT)_$(VERSION) $(PROJ_TARBALL) integration-test: tar-diff tar-patch tests/test.sh @@ -65,3 +73,7 @@ validate: lint lint: GOFLAGS=$(GOFLAGS) $(GOBIN)/golangci-lint run + +dist: $(PROJ_TARBALL) + @echo "Created $(PROJ_TARBALL)" +