mirror of
https://github.com/davidebianchi/gswagger.git
synced 2025-12-23 23:38:43 -05:00
24 lines
571 B
Makefile
24 lines
571 B
Makefile
VERSION ?= latest
|
|
|
|
# Create a variable that contains the current date in UTC
|
|
# Different flow if this script is running on Darwin or Linux machines.
|
|
ifeq (Darwin,$(shell uname))
|
|
NOW_DATE = $(shell date -u +%d-%m-%Y)
|
|
else
|
|
NOW_DATE = $(shell date -u -I)
|
|
endif
|
|
|
|
all: test
|
|
|
|
.PHONY: test
|
|
test:
|
|
go test ./... -coverprofile coverage.out
|
|
|
|
.PHONY: version
|
|
version:
|
|
sed -i.bck "s|## Unreleased|## Unreleased\n\n## ${VERSION} - ${NOW_DATE}|g" "CHANGELOG.md"
|
|
rm -fr "CHANGELOG.md.bck"
|
|
git add "CHANGELOG.md"
|
|
git commit -m "Upgrade version to v${VERSION}"
|
|
git tag v${VERSION}
|