Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
18 changes: 15 additions & 3 deletions Makefile
Original file line number Diff line number Diff line change
@@ -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
Comment thread
rosygmiki marked this conversation as resolved.

export GOPROXY=https://proxy.golang.org

Expand All @@ -17,13 +21,16 @@ 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}

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) ./...

Expand All @@ -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
Expand All @@ -65,3 +73,7 @@ validate: lint

lint:
GOFLAGS=$(GOFLAGS) $(GOBIN)/golangci-lint run

dist: $(PROJ_TARBALL)
@echo "Created $(PROJ_TARBALL)"