Skip to content

Commit 321a6fa

Browse files
committed
Add Makefile targets for updates
1 parent 71cae82 commit 321a6fa

File tree

6 files changed

+49
-17
lines changed

6 files changed

+49
-17
lines changed

Makefile

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -25,11 +25,12 @@ help:
2525
@echo "$(PROJECT) Makefile."
2626
@echo "The following commands are available:"
2727
@echo ""
28-
@echo " make c : Build and test the C version"
29-
@echo " make go : Build and test the GO version"
30-
@echo " make python : Build and test the Python version"
31-
@echo " make clean : Remove any build artifact"
32-
@echo " make tag : Tag the Git repository"
28+
@echo " make c : Build and test the C version"
29+
@echo " make go : Build and test the GO version"
30+
@echo " make python : Build and test the Python version"
31+
@echo " make clean : Remove any build artifact"
32+
@echo " make tag : Tag the Git repository"
33+
@echo " make versionup : Increase the patch number in the VERSION file"
3334
@echo ""
3435

3536
all: c go python
@@ -62,3 +63,8 @@ clean:
6263
tag:
6364
git tag -a "v$(VERSION)" -m "Version $(VERSION)" && \
6465
git push origin --tags
66+
67+
# Increase the patch number in the VERSION file
68+
.PHONY: versionup
69+
versionup:
70+
echo ${VERSION} | gawk -F. '{printf("%d.%d.%d",$$1,$$2,(($$3+1)));}' > VERSION

VERSION

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
9.4.18
1+
9.4.19

c/doc/Doxyfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ PROJECT_NAME = "Binsearch"
3232
# This could be handy for archiving the generated documentation or
3333
# if some version control system is used.
3434

35-
PROJECT_NUMBER = 9.4.18
35+
PROJECT_NUMBER = 9.4.19
3636

3737
# Using the PROJECT_BRIEF tag one can provide an optional one line description
3838
# for a project that appears at the top of each page and should give viewer

go.sum

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,6 @@ github.com/stretchr/objx v0.5.2/go.mod h1:FRsXN1f5AsAjCGJKqEizvkpNtU+EGNCLh3NxZ/
2020
github.com/stretchr/testify v1.9.0 h1:HtqpIVDClZ4nwg75+f6Lvsy/wHu+3BoSGCbBAcpTsTg=
2121
github.com/stretchr/testify v1.9.0/go.mod h1:r2ic/lqez/lEtzL7wO/rwa5dbSLXVDPFyf8C91i36aY=
2222
golang.org/x/sys v0.0.0-20190222072716-a9d3bda3a223/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
23-
golang.org/x/sys v0.0.0-20191026070338-33540a1f6037 h1:YyJpGZS1sBuBCzLAR1VEpK193GlqGZbnPFnPV/5Rsb4=
2423
golang.org/x/sys v0.0.0-20191026070338-33540a1f6037/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
2524
golang.org/x/sys v0.1.0 h1:kunALQeHf1/185U1i0GOB/fy1IPRDDpuoOOqRReG57U=
2625
golang.org/x/sys v0.1.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=

go/Makefile

Lines changed: 35 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -72,14 +72,18 @@ help:
7272
@echo "GOPATH=$(GOPATH)"
7373
@echo "The following commands are available:"
7474
@echo ""
75-
@echo " make clean : Remove any build artifact"
76-
@echo " make coverage : Generate the coverage report"
77-
@echo " make deps : Get dependencies"
78-
@echo " make format : Format the source code"
79-
@echo " make linter : Check code against multiple linters"
80-
@echo " make mod : Download dependencies"
81-
@echo " make qa : Run all tests and static analysis tools"
82-
@echo " make test : Run unit tests"
75+
@echo " make clean : Remove any build artifact"
76+
@echo " make coverage : Generate the coverage report"
77+
@echo " make deps : Get dependencies"
78+
@echo " make format : Format the source code"
79+
@echo " make linter : Check code against multiple linters"
80+
@echo " make mod : Download dependencies"
81+
@echo " make qa : Run all tests and static analysis tools"
82+
@echo " make test : Run unit tests"
83+
@echo " make updateall : Update everything"
84+
@echo " make updatego : Update Go version"
85+
@echo " make updatelint : Update golangci-lint version"
86+
@echo " make updatemod : Update dependencies"
8387
@echo ""
8488
@echo "Use DEVMODE=LOCAL for human friendly output."
8589
@echo ""
@@ -159,3 +163,26 @@ test: ensuretarget
159163
-coverprofile=target/report/coverage.out \
160164
-v $(SRCDIR) $(TESTEXTRACMD)
161165
@echo -e "\n\n>>> END: Unit Tests <<<\n\n"
166+
167+
# Update everything
168+
.PHONY: updateall
169+
updateall: updatego updatelint updatemod
170+
171+
# Update go version
172+
.PHONY: updatego
173+
updatego:
174+
$(eval LAST_GO_TOOLCHAIN=$(shell curl -s https://go.dev/dl/ | grep -oP 'go[0-9]+\.[0-9]+\.[0-9]+\.linux-amd64\.tar\.gz' | head -n 1 | grep -oP 'go[0-9]+\.[0-9]+\.[0-9]+'))
175+
$(eval LAST_GO_VERSION=$(shell echo ${LAST_GO_TOOLCHAIN} | grep -oP '[0-9]+\.[0-9]+'))
176+
sed -i "s|^go [0-9]*\.[0-9]*$$|go ${LAST_GO_VERSION}|g" ../go.mod
177+
sed -i "s|^toolchain go[0-9]*\.[0-9]*\.[0-9]*$$|toolchain ${LAST_GO_TOOLCHAIN}|g" ../go.mod
178+
179+
# Update linter version
180+
.PHONY: updatelint
181+
updatelint:
182+
$(eval LAST_GOLANGCILINT_VERSION=$(shell curl -sL https://github.com/golangci/golangci-lint/releases/latest | grep -oP '<title>Release \Kv[0-9]+\.[0-9]+\.[0-9]+'))
183+
sed -i "s|^GOLANGCILINTVERSION=v[0-9]*\.[0-9]*\.[0-9]*$$|GOLANGCILINTVERSION=${LAST_GOLANGCILINT_VERSION}|g" Makefile
184+
185+
# Update dependencies
186+
.PHONY: updatemod
187+
updatemod:
188+
$(GO) get -t -u ./... && go mod tidy -compat=$(shell grep -oP 'go \K[0-9]+\.[0-9]+' ../go.mod)

python/setup.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ def run(self):
3030

3131
setup(
3232
name="binsearch",
33-
version="9.4.18.0",
33+
version="9.4.19.0",
3434
keywords=("binsearch"),
3535
description="Binsearch Bindings for Python",
3636
long_description=read("../README.md"),

0 commit comments

Comments
 (0)