Skip to content

Commit

Permalink
refresh buildsystem
Browse files Browse the repository at this point in the history
  • Loading branch information
alessio committed Dec 29, 2023
1 parent 5a739bb commit 5387d0e
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 10 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,8 @@ jobs:
with:
go-version: '1.21'
- run: go version
- run: make clean ; go generate ./... ; go build -o build/ ./cmd/...
- run: go test -race -cover -covermode=atomic -coverprofile=coverage.out ./...
- run: make clean
- run: make
- run: ./build/pathctl -version
- uses: codecov/codecov-action@v3
with:
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -22,3 +22,4 @@ generate-stamp
.DS_Store

.envrc
version.txt
14 changes: 6 additions & 8 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -31,11 +31,11 @@ ifdef verbose
VERBOSE = -v
endif

all: generate build check
all: version.txt build check

BUILD_TARGETS := build install

build: generate
build: version.txt
build: BUILD_ARGS=-o $(BUILDDIR)/

$(BUILD_TARGETS): $(BUILDDIR)/
Expand All @@ -55,10 +55,8 @@ go.sum: go.mod
go mod tidy
touch $@

generate: generate-stamp
generate-stamp: go.sum
generate:
go generate ./...
touch $@

distclean: clean
rm -rf dist/
Expand All @@ -68,10 +66,10 @@ clean:
rm -rf $(BUILDDIR)
rm -f \
$(COVERAGE_REPORT_FILENAME) \
generate-stamp version-stamp
version.txt

version-stamp: generate
cp internal/version/version.txt $@
version.txt: generate
cp -f version/version.txt version.txt

list:
@echo $(BINS) | tr ' ' '\n'
Expand Down

0 comments on commit 5387d0e

Please sign in to comment.