-
Notifications
You must be signed in to change notification settings - Fork 72
/
Makefile
89 lines (73 loc) · 2.37 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
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
ENVIRONMENT := development
OS := $(shell uname -s)
.PHONY: build
build: verify-dev-env
cd go && $(MAKE) build-all ENVIRONMENT=$(ENVIRONMENT)
cd python && $(MAKE) build
.PHONY: install
install: build
ifeq ($(OS),Linux)
pip install python/dist/keepsake-*-py3-none-manylinux1_x86_64.whl
else ifeq ($(OS),Darwin)
pip install python/dist/keepsake-*-py3-none-macosx_*.whl
else
@echo Unknown OS: $(OS)
endif
.PHONY: develop
develop: verify-dev-env
cd go && $(MAKE) build
cd go && $(MAKE) install
cd python && python setup.py develop
.PHONY: install-test-dependencies
install-test-dependencies:
pip install -r requirements-test.txt
.PHONY: test
test: install-test-dependencies develop
cd go && $(MAKE) test
cd python && $(MAKE) test
cd end-to-end-test && $(MAKE) test
.PHONY: test-external
test-external: install-test-dependencies develop
cd go && $(MAKE) test-external
cd python && $(MAKE) test-external
cd end-to-end-test && $(MAKE) test-external
.PHONY: release
release: check-version-var verify-clean-main bump-version
git add go/Makefile python/keepsake/version.py web/.env
git commit -m "Bump to version $(VERSION)"
git tag "v$(VERSION)"
git push [email protected]:replicate/keepsake.git main
git push [email protected]:replicate/keepsake.git main --tags
git push [email protected]:replicate/keepsake.git main:website --force
.PHONY: verify-version
# quick and dirty
bump-version:
sed -E -i '' "s/VERSION := .+/VERSION := $(VERSION)/" go/Makefile
sed -E -i '' 's/version = ".+"/version = "$(VERSION)"/' python/keepsake/version.py
sed -E -i '' 's/NEXT_PUBLIC_VERSION=.+/NEXT_PUBLIC_VERSION=$(VERSION)/' web/.env
.PHONY: verify-clean-main
verify-clean-main:
git diff-index --quiet HEAD # make sure git is clean
git checkout main
git pull [email protected]:replicate/keepsake.git main
.PHONY: release-manual
release-manual: check-version-var verify-clean-main
cd go && $(MAKE) build-all ENVIRONMENT=production
cd python && $(MAKE) build
cd python && twine check dist/*
cd python && twine upload dist/*
.PHONY: check-version-var
check-version-var:
test $(VERSION)
.PHONY: verify-dev-env
verify-dev-env: verify-go-version verify-python-version
.PHONY: verify-go-version
verify-go-version:
@./makefile-scripts/verify-go-version.sh
.PHONY: verify-python-version
verify-python-version:
@./makefile-scripts/verify-python-version.sh
.PHONY: fmt
fmt:
cd go && $(MAKE) fmt
cd python && $(MAKE) fmt