-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
63 lines (46 loc) · 1.8 KB
/
Copy pathMakefile
File metadata and controls
63 lines (46 loc) · 1.8 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
50
51
52
53
54
55
56
57
58
59
60
61
62
63
TOOLS := pgpac d1pac
VERSION ?= dev
version ?= $(VERSION)
tool ?=
COMMIT ?= $(shell git rev-parse --short HEAD 2>/dev/null || echo unknown)
commit ?= $(COMMIT)
BUILD_DATE ?= $(shell date -u +"%Y-%m-%dT%H:%M:%SZ")
build_date ?= $(BUILD_DATE)
RELEASE_DIR := .out
.PHONY: build test pgpac-build d1pac-build sample clean verify-changelog release-build release-prepare release-smoke release-test website website-install website-typecheck website-build website-version
build: pgpac-build d1pac-build
test:
go test ./...
./.github/scripts/test-release.sh
pgpac-build:
go build -ldflags "-X main.version=$(version) -X main.commit=$(commit) -X main.buildDate=$(build_date)" -o pgpac ./cmd/pgpac
d1pac-build:
go build -ldflags "-X main.version=$(version) -X main.commit=$(commit) -X main.buildDate=$(build_date)" -o d1pac ./cmd/d1pac
sample:
mkdir -p out
go run ./cmd/pgpac build --project products/pgpac/testdata/sample/sample.pgpac --output out/
go run ./cmd/d1pac build --project products/d1pac/testdata/sample/sample.d1pac --output out/
verify-changelog:
./.github/scripts/check-unreleased-changelog.sh
release-build:
@case "$(tool)" in pgpac|d1pac) ;; *) echo "Usage: make release-build tool=<pgpac|d1pac> version=X.Y.Z"; exit 2;; esac
./.github/scripts/build-release-archive.sh "$(tool)" "$(version)" "$(RELEASE_DIR)"
release-prepare:
./.github/scripts/release.sh "$(version)" "$(dryrun)"
release-smoke:
./.github/scripts/release-smoke.sh
release-test:
./.github/scripts/test-release.sh
website-install:
rm -rf website/node_modules/.cache
cd website && npm ci
website-typecheck:
cd website && npm run typecheck
website-build:
cd website && npm run build
website-version:
cd website && npm run version-docs -- "$(version)"
website:
cd website && npm run start
clean:
rm -rf .out out website/build pgpac d1pac