-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
40 lines (32 loc) · 1.16 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
include ./make/help.mk
include ./make/release.mk
.PHONY: all
all: test release ## Test, (build) and release. Ready to deploy.
.PHONY: build
build: ## Create all build artifacts
npm install
npm audit fix
npm run build
.PHONY: clean
clean: ## Remove all build artifacts
-@rm public/build/* 2>/dev/null || true
.PHONY: deploy
deploy: ## Deploy latest release
surge public https://app.memorablewords.org
.PHONY: release
release: CURRENT_RELEASE = $$((${RELEASE} + 1))
release: ## Create a release
@echo "RELEASE = ${CURRENT_RELEASE}" > ./make/release.mk
make src/version.js build
.PHONY: record-release
record-release: CURRENT_RELEASE = $$((${RELEASE} + 1))
record-release: ## Commit a release to version control
@git add make/release.mk src/version.js \
&& git commit -m "Add release #${CURRENT_RELEASE}" \
&& git tag -a "release-${CURRENT_RELEASE}" -m "Release #${CURRENT_RELEASE}"
.PHONY: src/version.js # ensure the version is always fresh
src/version.js:
@echo "// File generated by release script, DO NOT EDIT.\nexport const version = '${RELEASE}–$(shell git log -1 --oneline | cut -d' ' -f1)';" > src/version.js
.PHONY: test
test: ## Run package tests
npm test