feat: add auto-update functionality
This commit is contained in:
23
Makefile
23
Makefile
@@ -1,17 +1,23 @@
|
||||
.PHONY: dev build clean install frontend
|
||||
|
||||
# Get version from git tag
|
||||
VERSION := $(shell git describe --tags --always --dirty 2>/dev/null || echo "dev")
|
||||
GIT_COMMIT := $(shell git rev-parse --short HEAD 2>/dev/null || echo "unknown")
|
||||
BUILD_TIME := $(shell date -u +"%Y-%m-%dT%H:%M:%SZ")
|
||||
LDFLAGS := -X 'daily-timer/internal/version.Version=$(VERSION)' -X 'daily-timer/internal/version.GitCommit=$(GIT_COMMIT)' -X 'daily-timer/internal/version.BuildTime=$(BUILD_TIME)'
|
||||
|
||||
# Development (fixed ports: Vite 5173, Wails DevServer 34115)
|
||||
dev:
|
||||
wails dev -devserver localhost:34115
|
||||
|
||||
# Build for macOS
|
||||
build:
|
||||
wails build -clean
|
||||
build: lint
|
||||
wails build -clean -ldflags "$(LDFLAGS)"
|
||||
@xattr -cr "build/bin/Daily Timer.app" 2>/dev/null || true
|
||||
|
||||
# Build for macOS (universal binary)
|
||||
build-universal:
|
||||
wails build -clean -platform darwin/universal
|
||||
build-universal: lint
|
||||
wails build -clean -platform darwin/universal -ldflags "$(LDFLAGS)"
|
||||
@xattr -cr "build/bin/Daily Timer.app" 2>/dev/null || true
|
||||
|
||||
# Install frontend dependencies
|
||||
@@ -51,13 +57,10 @@ deps:
|
||||
init: deps frontend
|
||||
@echo "Project initialized. Run 'make dev' to start development."
|
||||
|
||||
# Get version from git tag
|
||||
VERSION := $(shell git describe --tags --always --dirty 2>/dev/null || echo "dev")
|
||||
|
||||
# Release - build and package
|
||||
release:
|
||||
release: lint
|
||||
@echo "Building release $(VERSION)..."
|
||||
wails build -clean
|
||||
wails build -clean -ldflags "$(LDFLAGS)"
|
||||
@xattr -cr "build/bin/Daily Timer.app" 2>/dev/null || true
|
||||
@mkdir -p dist
|
||||
cd build/bin && zip -r "../../dist/Daily-Timer-$(VERSION)-macos-arm64.zip" "Daily Timer.app"
|
||||
@@ -65,7 +68,7 @@ release:
|
||||
@ls -lh dist/*.zip
|
||||
|
||||
# Release for both architectures
|
||||
release-all:
|
||||
release-all: lint
|
||||
@echo "Building release $(VERSION) for all platforms..."
|
||||
@mkdir -p dist
|
||||
GOOS=darwin GOARCH=arm64 wails build -clean -o daily-timer-arm64
|
||||
|
||||
Reference in New Issue
Block a user