-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
66 lines (56 loc) · 1.49 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
VERSION := 1.0.6
INSTALLATION_SCRIPT_FILE := scripts/install.sh
BUILD_INFO_FILE := Sources/BuildInfo.swift
BUILD_INFO_TEMPLATE := Sources/BuildInfo.template.swift
.PHONY: help
help: ## print this message
@awk \
'BEGIN {FS = ":.*?## "} \
/^[a-zA-Z_-]+:.*?## / \
{printf "\033[33m%-15s\033[0m %s\n", $$1, $$2}' \
$(MAKEFILE_LIST)
.PHONY: generate
generate: ## generate build info
@bash build/generate-info.sh \
"${BUILD_INFO_TEMPLATE}" "${VERSION}" > "${BUILD_INFO_FILE}"
.PHONY: build
build: generate ## build runon
swift build
rm -rf ./dist
mkdir ./dist
cp .build/debug/runon ./dist/runon
.PHONY: build-release
build-release: build
bash ./build/generate-release-notes.sh "v${VERSION}" > dist/notes.md
cd dist; zip -r runon.zip .
.PHONY: lint
lint: generate ## check code style
swiftlint lint --config .swiftlint.yaml .
shellcheck -a "${INSTALLATION_SCRIPT_FILE}"
.PHONY: install
install: ## install runon to the system
rm -f \
/usr/local/bin/runon \
/usr/local/bin/runond \
/usr/local/bin/runon-service \
/usr/local/bin/runon-daemon
cp dist/runon /usr/local/bin/runon
.PHONY: test
test: generate ## run tests
swift test
.PHONY: setup
setup: ## download dependencies
swift package resolve
.PHONY: release
publish: # release a new version
git tag "v${VERSION}"
git chglog -o CHANGELOG.md
git tag -d "v${VERSION}"
git add Makefile
git add CHANGELOG.md
git commit -m "chore: release v${VERSION}"
git tag "v${VERSION}"
git push
git push --tags
.PHONY: check
check: lint test