feat(windows): rewrite NSIS installer, add pgtidy update command
This commit is contained in:
@@ -2,7 +2,7 @@ APP := pgtidy
|
||||
CMD := ./cmd/pgtidy
|
||||
DIST := dist
|
||||
|
||||
.PHONY: build test lint vet fmt clean release release-version snapshot vscode-compile vscode-package
|
||||
.PHONY: installer-windows build test lint vet fmt clean release release-version snapshot vscode-compile vscode-package
|
||||
|
||||
## build: compile binary for the current platform
|
||||
build:
|
||||
@@ -25,6 +25,11 @@ lint: vet
|
||||
test -z "$$(gofmt -l .)" || (echo "gofmt needed:"; gofmt -l .; exit 1)
|
||||
golangci-lint run ./...
|
||||
|
||||
## installer-windows: build the Windows binary and NSIS installer (requires makensis)
|
||||
installer-windows:
|
||||
GOOS=windows GOARCH=amd64 CGO_ENABLED=0 go build -trimpath -ldflags "-s -w -X main.version=$$(git describe --tags --abbrev=0 2>/dev/null || echo dev)" -o $(DIST)/pgtidy-windows-amd64.exe $(CMD)
|
||||
makensis -DVERSION=$$(git describe --tags --abbrev=0 2>/dev/null | sed 's/^v//' | grep -E '^[0-9]+\.[0-9]+\.[0-9]+$$' || echo 0.0.0) -DEXE=$(CURDIR)/$(DIST)/pgtidy-windows-amd64.exe -DOUT=$(CURDIR)/$(DIST)/pgtidy-setup-windows-amd64.exe windows/installer.nsi
|
||||
|
||||
## clean: remove build artifacts
|
||||
clean:
|
||||
rm -rf $(DIST)
|
||||
|
||||
Reference in New Issue
Block a user