-
Notifications
You must be signed in to change notification settings - Fork 16
/
Copy pathMakefile
36 lines (29 loc) · 1.08 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
VERSION := $(shell cat VERSION)
# Create releases for popular systems.
.PHONY: release
release:
env GOARCH=amd64 GOOS=darwin go build -ldflags="-s -w" \
-o release/contribution-$(VERSION)-x64-macos .
env GOARCH=amd64 GOOS=linux go build -ldflags="-s -w" \
-o release/contribution-$(VERSION)-x64-linux .
env GOARCH=amd64 GOOS=windows go build -ldflags="-s -w" \
-o release/contribution-$(VERSION)-x64.exe .
# Create and push a release tag.
.PHONY: release-tag
release-tag:
git tag $(VERSION)
git push origin --tags
# Append help command to documentation.
.PHONY: README.md
README.md:
@sed '/<!-- .* -->/q' README.md > README.md.tmp
@mv README.md.tmp README.md # -i does not work on macOS
@echo '### `contribution -help`\n```' >> README.md 2>&1
go run . -help >> README.md 2>&1
@echo '```\n' >> README.md 2>&1
@echo '### `contribution preview -help`\n```' >> README.md 2>&1
go run . preview -help >> README.md 2>&1
@echo '```\n' >> README.md 2>&1
@echo '### `contribution push -help`\n```' >> README.md 2>&1
go run . push -help >> README.md 2>&1
@echo '```' >> README.md 2>&1