Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
34 changes: 34 additions & 0 deletions .github/workflows/build-wails.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
name: Build Desktop App

on:
push:
branches: [ main ]
pull_request:

jobs:
wails:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Install Wails system dependencies
run: |
sudo apt-get update && make wails-deps

- uses: actions/setup-go@v5
with:
go-version: 1.23

- uses: actions/setup-node@v4
with:
node-version: 24

- name: Build UI
run: |
make build-ui

- name: Install Wails CLI
run: go install github.com/wailsapp/wails/v2/cmd/wails@latest

- name: Build Wails app
run: |
make wails-build-all
2 changes: 1 addition & 1 deletion .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Build
name: Build CLI

on:
push:
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ jobs:
- name: Set up Go
uses: actions/setup-go@v5
with:
go-version: '1.23'
go-version: '1.24'

- name: Configure Git
run: |
Expand Down Expand Up @@ -55,4 +55,4 @@ jobs:
draft: true
prerelease: true
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
42 changes: 34 additions & 8 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
BINARY_NAME = digler
CLI_BINARY_NAME = digler-cli
WAILS_BINARY_NAME = digler
MAIN_FILE = cmd/main.go
OUTPUT_DIR = bin

Expand All @@ -7,6 +8,17 @@ ENV_PKG = $(MODULE)/internal/env

# Target platforms: os/arch
TARGETS = linux/amd64 linux/arm64 darwin/amd64 darwin/arm64 windows/amd64
WAILS_TARGETS = linux/amd64 windows/amd64

WAILS_LIBS = \
libgtk-3-dev \
libwebkit2gtk-4.1-dev \
libglib2.0-dev \
libpango1.0-dev \
libgdk-pixbuf2.0-dev \
libatk1.0-dev \
libcairo2-dev \
pkg-config

# Get the latest tag (if any)
TAG := $(shell git describe --tags --exact-match 2>/dev/null || echo "")
Expand All @@ -30,23 +42,33 @@ COMMIT_HASH := $(shell git rev-parse HEAD)
# Get build time in ISO8601 format
BUILD_TIME := $(shell date -u +"%Y-%m-%dT%H:%M:%SZ")

.PHONY: all build build-ui wails-build clean version
.PHONY: all build build-ui wails-deps wails-build clean version

all: build
all: build build-ui wails-deps wails-build-all

build:
@mkdir -p $(OUTPUT_DIR)
@echo "Building $(BINARY_NAME) version: $(VERSION)"
@echo "Building $(CLI_BINARY_NAME) version: $(VERSION)"
@for target in $(TARGETS); do \
GOOS=$${target%%/*} && GOARCH=$${target##*/}; \
output_name="$(BINARY_NAME)-$${GOOS}-$${GOARCH}"; \
output_name="$(CLI_BINARY_NAME)-$${GOOS}-$${GOARCH}"; \
if [ "$${GOOS}" = "windows" ]; then output_name="$$output_name.exe"; fi; \
echo "-> $$output_name"; \
GOOS=$$GOOS GOARCH=$$GOARCH go build -ldflags "-X $(ENV_PKG).Version=$(VERSION) -X $(ENV_PKG).CommitHash=$(COMMIT_HASH) -X $(ENV_PKG).BuildTime=$(BUILD_TIME)" -o $(OUTPUT_DIR)/$$output_name $(MAIN_FILE); \
done

build-ui:
cd frontend && npm run build
cd frontend && npm install && npm run build

wails-deps:
sudo apt install -y $(WAILS_LIBS)
@WEBKIT_PC=$$(dpkg -L libwebkit2gtk-4.1-dev | grep webkit2gtk-4.1.pc | head -n1); \
if [ -z "$$WEBKIT_PC" ]; then \
echo "Error: webkit2gtk-4.1.pc not found!"; exit 1; \
fi; \
TARGET_PC=$$(echo "$$WEBKIT_PC" | sed 's/4\.1\.pc$$/4.0.pc/'); \
sudo ln -sf "$$WEBKIT_PC" "$$TARGET_PC"; \
echo "Created symlink: $$TARGET_PC -> $$WEBKIT_PC"

wails:
go run github.com/wailsapp/wails/v2/cmd/wails
Expand All @@ -58,9 +80,13 @@ wails-build:
go run github.com/wailsapp/wails/v2/cmd/wails build

wails-build-all:
@for target in $(TARGETS); do \
@for target in $(WAILS_TARGETS); do \
echo "Building for $$target"; \
go run github.com/wailsapp/wails/v2/cmd/wails build -platform $$target; \
GOOS=$${target%%/*} && GOARCH=$${target##*/}; \
output_name="$(WAILS_BINARY_NAME)-$${GOOS}-$${GOARCH}"; \
if [ "$${GOOS}" = "windows" ]; then output_name="$$output_name.exe"; fi; \
echo "-> $$output_name"; \
go run github.com/wailsapp/wails/v2/cmd/wails build -platform $$target -o $$output_name; \
done

# Default plugin source folder
Expand Down
Loading
Loading