diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 786c893ef..65a504e6c 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -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 diff --git a/.goreleaser.yaml b/.goreleaser.yaml index 382f7e973..d6bc393e2 100644 --- a/.goreleaser.yaml +++ b/.goreleaser.yaml @@ -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 diff --git a/Makefile b/Makefile index afc76a6ad..3fb825bb6 100644 --- a/Makefile +++ b/Makefile @@ -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)..." diff --git a/web/backend/.gitignore b/web/backend/.gitignore index 509042171..ef8dd4e42 100644 --- a/web/backend/.gitignore +++ b/web/backend/.gitignore @@ -10,6 +10,7 @@ picoclaw-web # Frontend build artifacts (embedded by Go) dist/* !dist/.gitkeep +!dist/index.html # OS .DS_Store diff --git a/web/backend/dist/.gitkeep b/web/backend/dist/.gitkeep new file mode 100644 index 000000000..e69de29bb diff --git a/web/backend/dist/index.html b/web/backend/dist/index.html new file mode 100644 index 000000000..9d791a1cd --- /dev/null +++ b/web/backend/dist/index.html @@ -0,0 +1 @@ +