-
Notifications
You must be signed in to change notification settings - Fork 1
/
Makefile
61 lines (47 loc) · 1.7 KB
/
Makefile
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
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
SHELL := /bin/bash
.DEFAULT_GOAL := usage
BOLD := \033[1m
BRED := \033[1;31m
RED := \033[0;31m
GREEN := \033[0;32m
CYAN := \033[0;36m
YELLOW := \033[0;33m
NC := \033[0m
.PHONY: usage
usage:
@printf "\n$(YELLOW)Usage:$(NC)\n\n"
@printf "$(YELLOW)make build $(GREEN)# Build the code of the project $(NC)\n"
@printf "$(YELLOW)make patch $(GREEN)# Patches the project to the next version$(NC)\n\n"
@exit 0
# ---- defaults and macros ---------------------------------------------------------------------------------------------
# the version macro is used for tagging the builds in git
# BEWARE: this macro expands at the start when the make file is run, if you do something
# to the version file, this variable will be set to the old version !!!
VERSION ?= $(shell cat .bumpversion.cfg | grep current_version | awk '{ print $$3 }')
# ---- build process ---------------------------------------------------------------------------------------------------
.PHONY: clean
clean:
@rm -rf dist/ build/
dist/:
@mkdir dist
dist/VERSION: dist/
@echo "$(VERSION)" > dist/VERSION
dist/code-v$(VERSION).zip: dist/
@zip -b src/main/resources dist/code-v$(VERSION).zip *
.PHONY: sign
sign: dist/code-v$(VERSION).zip
@echo "FIXME fake sign $(VERSION)" > dist/code-v$(VERSION).zip.asc
@md5sum -b dist/code-v$(VERSION).zip > dist/code-v$(VERSION).zip.md5
.PHONY: build
build: dist/VERSION sign
-which pip3
-pip3 install --user bump2version
-which bumpversion
-ls -alR ~/bin
-ls -alR ~/.local
-bumpversion
# ---- patch release ---------------------------------------------------------------------------------------------------
# bump a minor version number
.PHONY: patch
patch:
@bumpversion patch