This repository was archived by the owner on Mar 27, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
40 lines (40 loc) · 1.36 KB
/
Makefile
File metadata and controls
40 lines (40 loc) · 1.36 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
VERSION ?= $(shell git describe --tags)
REVISION ?= $(shell git rev-parse HEAD)
BRANCH ?= $(shell git rev-parse --abbrev-ref HEAD)
BUILDUSER ?= $(shell id -un)
BUILDTIME ?= $(shell date '+%Y%m%d-%H:%M:%S')
MAJORVERSION ?= $(shell git describe --tags --abbrev=0 | sed s/v// | awk -F. '{print $$1+1".0.0"}')
MINORVERSION ?= $(shell git describe --tags --abbrev=0 | sed s/v// | awk -F. '{print $$1"."$$2+1".0"}')
PATCHVERSION ?= $(shell git describe --tags --abbrev=0 | sed s/v// | awk -F. '{print $$1"."$$2"."$$3+1}')
.PHONY: info
.SILENT: info
info:
- $(info VERSION = $(VERSION))
- $(info REVISION = $(REVISION))
- $(info BRANCH = $(BRANCH))
- $(info BUILDUSER = $(BUILDUSER))
- $(info BUILDTIME = $(BUILDTIME))
- $(info MAJORVERSION = $(MAJORVERSION))
- $(info MINORVERSION = $(MINORVERSION))
- $(info PATCHVERSION = $(PATCHVERSION))
.PHONY: release-major
.SILENT: release-major
release-major:
- git checkout master
- git pull
- git tag -a v$(MAJORVERSION) -m 'release $(MAJORVERSION)'
- git push origin --tags
.PHONY: release-minor
.SILENT: release-minor
release-minor:
- git checkout master
- git pull
- git tag -a v$(MINORVERSION) -m 'release $(MINORVERSION)'
- git push origin --tags
.PHONY :release-patch
.SILENT :release-patch
release-patch:
- git checkout master
- git pull
- git tag -a v$(PATCHVERSION) -m 'release $(PATCHVERSION)'
- git push origin --tags