forked from rishu-buf/docs.buf.build
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
57 lines (44 loc) · 1010 Bytes
/
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
SHELL := /usr/bin/env bash -o pipefail
UNAME_OS := $(shell uname -s)
ifeq ($(UNAME_OS),Darwin)
SED_I := sed -i ''
else
SED_I := sed -i
endif
.DEFAULT_GOAL := all
.PHONY: all
all: run
.PHONY: install
install:
npm install
.PHONY: build
build: install
rm -rf build
npm run build
.PHONY: serve
serve: build
npm run serve
.PHONY: start
start:
npm run start
.PHONY: run
run: install
npm run start
.PHONY: update
upgrade:
npm update
.PHONY: clean
clean:
git clean -xdf
.PHONY: lint
lint:
vale docs
.PHONY: updateversion
updateversion:
ifndef VERSION
$(error "VERSION must be set")
endif
$(SED_I) "s/[0-9].[0-9][0-9]*\.[0-9][0-9]*/$(VERSION)/g" docs/installation.md
$(SED_I) "s/version: '[0-9].[0-9][0-9]*\.[0-9][0-9]*'/version: '$(VERSION)'/g" docs/ci-cd/github-actions.md
$(SED_I) "s/BUF_VERSION=[0-9].[0-9][0-9]*\.[0-9][0-9]*/BUF_VERSION=$(VERSION)/g" docs/ci-cd/setup.md
$(SED_I) "s/downloadRelease: '[0-9].[0-9][0-9]*\.[0-9][0-9]*'/downloadRelease: '$(VERSION)'/g" docusaurus.config.js