feat: update build for web-based launcher (#1186)

- Makefile: add build-launcher target (builds frontend + Go backend)
- GoReleaser: point picoclaw-launcher build to web/backend, add frontend
  build hook, restore winres hook with updated paths
- Restore icon.ico and winres config from main for Windows builds

Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
Guoguo 2026-03-06 18:56:16 +08:00 committed by GitHub
parent 109581ceaf
commit e676092dd4
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
8 changed files with 47 additions and 2 deletions

View file

@ -60,6 +60,14 @@ jobs:
with:
go-version-file: go.mod
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: 22
- name: Setup pnpm
run: corepack enable && corepack prepare pnpm@latest --activate
- name: Set up QEMU
uses: docker/setup-qemu-action@v3

View file

@ -6,8 +6,9 @@ before:
hooks:
- go mod tidy
- go generate ./...
- sh -c 'cd web/frontend && pnpm install && pnpm build:backend'
- go install github.com/tc-hib/go-winres@latest
- go-winres make --in cmd/picoclaw-launcher/winres/winres.json --out cmd/picoclaw-launcher/rsrc --product-version={{ .Version }} --file-version={{ .Version }}
- go-winres make --in web/backend/winres/winres.json --out web/backend/rsrc --product-version={{ .Version }} --file-version={{ .Version }}
builds:
- id: picoclaw
@ -62,7 +63,7 @@ builds:
goarm:
- "6"
- "7"
main: ./cmd/picoclaw-launcher
main: ./web/backend
ignore:
- goos: windows
goarch: arm

View file

@ -87,6 +87,18 @@ build: generate
@echo "Build complete: $(BINARY_PATH)"
@ln -sf $(BINARY_NAME)-$(PLATFORM)-$(ARCH) $(BUILD_DIR)/$(BINARY_NAME)
## build-launcher: Build the picoclaw-launcher (web console) binary
build-launcher:
@echo "Building picoclaw-launcher for $(PLATFORM)/$(ARCH)..."
@mkdir -p $(BUILD_DIR)
@if [ ! -d web/backend/dist ]; then \
echo "Building frontend..."; \
cd web/frontend && pnpm install && pnpm build:backend; \
fi
@$(GO) build $(GOFLAGS) -o $(BUILD_DIR)/picoclaw-launcher-$(PLATFORM)-$(ARCH) ./web/backend
@ln -sf picoclaw-launcher-$(PLATFORM)-$(ARCH) $(BUILD_DIR)/picoclaw-launcher
@echo "Build complete: $(BUILD_DIR)/picoclaw-launcher"
## build-whatsapp-native: Build with WhatsApp native (whatsmeow) support; larger binary
build-whatsapp-native: generate
## @echo "Building $(BINARY_NAME) with WhatsApp native for $(PLATFORM)/$(ARCH)..."

View file

@ -10,6 +10,7 @@ picoclaw-web
# Frontend build artifacts (embedded by Go)
dist/*
!dist/.gitkeep
!dist/index.html
# OS
.DS_Store

0
web/backend/dist/.gitkeep vendored Normal file
View file

1
web/backend/dist/index.html vendored Normal file
View file

@ -0,0 +1 @@
<!DOCTYPE html><html><head><meta charset="utf-8"><title>PicoClaw</title></head><body><div id="root"></div></body></html>

BIN
web/backend/icon.ico Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 44 KiB

View file

@ -0,0 +1,22 @@
{
"RT_GROUP_ICON": {
"APP": {
"0000": "../icon.ico"
}
},
"RT_MANIFEST": {
"#1": {
"0409": {
"identity": {
"name": "PicoClaw Launcher",
"version": "0.0.0.0"
},
"description": "PicoClaw Launcher - Web-based configuration editor",
"minimum-os": "win7",
"execution-level": "asInvoker",
"dpi-awareness": "system",
"use-common-controls-v6": true
}
}
}
}