forked from elgatito/script.elementum.burst
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
60 lines (49 loc) · 1.31 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
NAME = script.elementum.burst
GIT = git
GIT_VERSION = $(shell $(GIT) describe --abbrev=0 --tags)
GIT_USER = elgatito
GIT_REPOSITORY = script.elementum.burst
TAG_VERSION = $(subst v,,$(GIT_VERSION))
LAST_COMMIT = $(shell $(GIT) log -1 --pretty=\%B)
VERSION = $(shell sed -ne "s/.*COLOR\]\"\sversion=\"\([0-9a-z\.\-]*\)\".*/\1/p" addon.xml)
ZIP_SUFFIX = zip
ZIP_FILE = $(NAME)-$(VERSION).$(ZIP_SUFFIX)
all: clean zip
$(ZIP_FILE):
$(GIT) archive --format zip --prefix $(NAME)/ --output $(ZIP_FILE) HEAD
rm -rf $(NAME)
zip: $(ZIP_FILE)
clean_arch:
rm -f $(ZIP_FILE)
clean:
rm -f $(ZIP_FILE)
rm -rf $(NAME)
check:
python -m flake8
# extract:
# ./scripts/extract.py --exclude-icons
#
# extract-icons:
# ./scripts/extract.py --exclude-defs
upload:
$(eval EXISTS := $(shell github-release info --user $(GIT_USER) --repo $(GIT_REPOSITORY) --tag v$(VERSION) 1>&2 2>/dev/null; echo $$?))
ifneq ($(EXISTS),1)
github-release release \
--user $(GIT_USER) \
--repo $(GIT_REPOSITORY) \
--tag v$(VERSION) \
--name "$(VERSION)" \
--description "$(VERSION)"
endif
sleep 5
github-release upload \
--user $(GIT_USER) \
--repo $(GIT_REPOSITORY) \
--replace \
--tag v$(VERSION) \
--file $(NAME)-$(VERSION).zip \
--name $(NAME)-$(VERSION).zip
settings:
scripts/generate_settings.py
locales:
scripts/xgettext_merge.sh