-
-
Notifications
You must be signed in to change notification settings - Fork 93
Expand file tree
/
Copy pathMakefile
More file actions
52 lines (40 loc) · 1.69 KB
/
Makefile
File metadata and controls
52 lines (40 loc) · 1.69 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
# Get version from package.json
VERSION := $(shell ./get-version.js)
GOPATH ?= $(shell go env GOPATH)
WAILS := $(shell command -v wails 2> /dev/null || echo $(GOPATH)/bin/wails)
.PHONY: build dev clean bump
i:
cd frontend && pnpm install
# Default target
build:
@echo "Building WailBrew version: $(VERSION)"
$(WAILS) build -ldflags "-X main.Version=$(VERSION)"
build-universal:
@echo "Building WailBrew universal binary version: $(VERSION)"
$(WAILS) build -platform darwin/universal -ldflags "-X main.Version=$(VERSION)"
dev:
$(WAILS) dev
bump:
@CURRENT=$$(grep '"version"' frontend/package.json | head -1 | sed 's/.*"\([0-9]*\.[0-9]*\.[0-9]*\)".*/\1/'); \
MAJOR=$$(echo $$CURRENT | cut -d. -f1); \
MINOR=$$(echo $$CURRENT | cut -d. -f2); \
PATCH=$$(echo $$CURRENT | cut -d. -f3); \
NEW_PATCH=$$((PATCH + 1)); \
NEW_VERSION="$$MAJOR.$$MINOR.$$NEW_PATCH"; \
echo "Bumping version: $$CURRENT -> $$NEW_VERSION"; \
sed -i '' "s/\"version\": \"$$CURRENT\"/\"version\": \"$$NEW_VERSION\"/g" frontend/package.json; \
sed -i '' "s/\"version\": \"$$CURRENT\"/\"version\": \"$$NEW_VERSION\"/g" wails.json; \
sed -i '' "s/\"productVersion\": \"$$CURRENT\"/\"productVersion\": \"$$NEW_VERSION\"/g" wails.json; \
echo "Updated frontend/package.json and wails.json to $$NEW_VERSION"
clean:
rm -rf build/
install: build
@echo "Installing WailBrew to /Applications"
cp -r build/bin/WailBrew.app /Applications/
release: build
@echo "==> Releasing WailBrew version: $(VERSION)"
./scripts/release.sh $(VERSION) build/bin/WailBrew.app
release-universal: build-universal
@echo "==> Releasing WailBrew universal binary version: $(VERSION)"
./scripts/release.sh $(VERSION) build/bin/WailBrew.app
.DEFAULT_GOAL := build