-
Notifications
You must be signed in to change notification settings - Fork 16
/
Copy pathMakefile
39 lines (32 loc) · 1.06 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
# usage example:
#
# $ version=min make version build release -s
.PHONY: build
version_old != sed -n -E 's/.*"version":\s*"([0-9.]+)".*/\1/p' src/manifest.json
version ?= $(version_old)
ifeq ($(version), min)
version != awk -F. -v OFS=. '$$NF++' <<< "$(version_old)"
endif
version:
@echo "version $(version_old) -> $(version)"
shopt -s globstar; for fn in **/*.template; do \
fn_orig="$${fn:0:-9}"; \
sed -E -e 's/\{\{\$$version\}\}/$(version)/g' "$$fn" > "$$fn_orig"; \
git add "$$fn_orig"; \
done
git commit -m "Release v$(version)"
git tag v$(version)
build:
@echo "build $(version)"
web-ext build --overwrite-dest --source-dir src --artifacts-dir build \
--filename paxmod-$(version).xpi --ignore-files "*.template"
ln -sf paxmod-$(version).xpi build/paxmod-latest.xpi
release:
@echo "release $(version)"
git push --follow-tags
hub release create v$(version) -a build/paxmod-$(version).xpi -m v$(version)
demo:
DARK=1 FF_BINARY=firefox-developer-edition ./scripts/demo.sh
FF_BINARY=firefox-nightly ./scripts/demo.sh
clean:
rm -rf build/