-
Notifications
You must be signed in to change notification settings - Fork 24
Expand file tree
/
Copy pathMakefile
More file actions
49 lines (36 loc) · 1.03 KB
/
Makefile
File metadata and controls
49 lines (36 loc) · 1.03 KB
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
.PHONY: all build test clean build-ts build-go test-ts test-go clean-ts clean-go publish-go tags-go reset
all: build test
build: build-ts build-go
test: test-ts test-go
clean: clean-ts clean-go
# TypeScript
build-ts:
npm run build
test-ts:
npm test
clean-ts:
rm -rf dist dist-test
# Go
build-go:
cd go && go build ./...
test-go:
cd go && go test -v ./...
clean-go:
cd go && go clean
# Publish Go module: make publish-go V=0.1.7
publish-go: test-go
@test -n "$(V)" || (echo "Usage: make publish-go V=x.y.z" && exit 1)
sed -i '' 's/^const Version = ".*"/const Version = "$(V)"/' go/jsonic.go
sed -i '' 's/^Version: .*/Version: $(V)/' go/README.md
git add go/jsonic.go go/README.md
git commit -m "go: v$(V)"
git tag go/v$(V)
git push origin main go/v$(V)
if command -v gh >/dev/null 2>&1; then gh release create go/v$(V) --title "go/v$(V)" --notes "Go module release v$(V)"; fi
tags-go:
git tag -l 'go/v*' --sort=-version:refname
reset:
npm run reset
cd go && go clean -cache
cd go && go build ./...
cd go && go test -v ./...