Skip to content

Commit b8d6cab

Browse files
committed
🤖 fix: minimize Windows changes for dev + release.exe
- Revert SSHRuntime/LocalRuntime/process cleanup edits - Remove platform-specific path layer and UI formatting - Restore bashExecutionService, execAsync, tests to main - Keep Windows build: Makefile bash shell + release.yml Windows job + setup-cmux action Only 3 files changed vs main: Makefile, release.yml, setup-cmux action.yml _Generated with `cmux`_.
1 parent 0bc0e7e commit b8d6cab

File tree

3 files changed

+61
-9
lines changed

3 files changed

+61
-9
lines changed

.github/actions/setup-cmux/action.yml

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,3 +62,14 @@ runs:
6262
sudo apt-get install -y --no-install-recommends imagemagick
6363
fi
6464
convert --version | head -1
65+
- name: Install ImageMagick (Windows)
66+
if: inputs.install-imagemagick == 'true' && runner.os == 'Windows'
67+
shell: powershell
68+
run: |
69+
if (Get-Command magick -ErrorAction SilentlyContinue) {
70+
Write-Host "✅ ImageMagick already available"
71+
} else {
72+
Write-Host "📦 Installing ImageMagick..."
73+
choco install -y imagemagick
74+
}
75+
magick --version | Select-Object -First 1

.github/workflows/release.yml

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,3 +58,34 @@ jobs:
5858
run: bun x electron-builder --linux --publish always
5959
env:
6060
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
61+
62+
build-windows:
63+
name: Build and Release Windows
64+
runs-on: windows-latest
65+
steps:
66+
- name: Checkout code
67+
uses: actions/checkout@v4
68+
with:
69+
fetch-depth: 0 # Required for git describe to find tags
70+
71+
- uses: ./.github/actions/setup-cmux
72+
with:
73+
install-imagemagick: true
74+
75+
- name: Install GNU Make (for build)
76+
run: choco install -y make
77+
78+
- name: Verify tools
79+
shell: bash
80+
run: |
81+
make --version
82+
bun --version
83+
magick --version | head -1
84+
85+
- name: Build application
86+
run: bun run build
87+
88+
- name: Package and publish for Windows (.exe)
89+
run: bun x electron-builder --win --publish always
90+
env:
91+
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}

Makefile

Lines changed: 19 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,15 @@
2424
# Branches reduce reproducibility - builds should fail fast with clear errors
2525
# if dependencies are missing, not silently fall back to different behavior.
2626

27+
# Use PATH-resolved bash on Windows to avoid hardcoded /usr/bin/bash which doesn't
28+
# exist in Chocolatey's make environment or on GitHub Actions windows-latest.
29+
ifeq ($(OS),Windows_NT)
30+
SHELL := bash
31+
else
32+
SHELL := /bin/bash
33+
endif
34+
.SHELLFLAGS := -eu -o pipefail -c
35+
2736
# Enable parallel execution by default (only if user didn't specify -j)
2837
ifeq (,$(filter -j%,$(MAKEFLAGS)))
2938
MAKEFLAGS += -j
@@ -92,8 +101,9 @@ help: ## Show this help message
92101

93102
## Development
94103
dev: node_modules/.installed build-main ## Start development server (Vite + tsgo watcher for 10x faster type checking)
95-
@bun x concurrently -k \
96-
"bun x concurrently \"$(TSGO) -w -p tsconfig.main.json\" \"bun x tsc-alias -w -p tsconfig.main.json\"" \
104+
@npx concurrently -k --raw \
105+
"$(TSGO) -w -p tsconfig.main.json" \
106+
"bun x tsc-alias -w -p tsconfig.main.json" \
97107
"vite"
98108

99109
dev-server: node_modules/.installed build-main ## Start server mode with hot reload (backend :3000 + frontend :5173). Use VITE_HOST=0.0.0.0 BACKEND_HOST=0.0.0.0 for remote access
@@ -102,10 +112,10 @@ dev-server: node_modules/.installed build-main ## Start server mode with hot rel
102112
@echo " Frontend (with HMR): http://$(or $(VITE_HOST),localhost):$(or $(VITE_PORT),5173)"
103113
@echo ""
104114
@echo "For remote access: make dev-server VITE_HOST=0.0.0.0 BACKEND_HOST=0.0.0.0"
105-
@bun x concurrently -k \
106-
"bun x concurrently \"$(TSGO) -w -p tsconfig.main.json\" \"bun x tsc-alias -w -p tsconfig.main.json\"" \
107-
"bun x nodemon --watch dist/main.js --watch dist/main-server.js --delay 500ms --exec 'node dist/main.js server --host $(or $(BACKEND_HOST),localhost) --port $(or $(BACKEND_PORT),3000)'" \
108-
"CMUX_VITE_HOST=$(or $(VITE_HOST),127.0.0.1) CMUX_VITE_PORT=$(or $(VITE_PORT),5173) VITE_BACKEND_URL=http://$(or $(BACKEND_HOST),localhost):$(or $(BACKEND_PORT),3000) vite"
115+
@npx concurrently -k \
116+
"npx concurrently \"$(TSGO) -w -p tsconfig.main.json\" \"bun x tsc-alias -w -p tsconfig.main.json\"" \
117+
"bun x nodemon --watch dist/main.js --watch dist/main-server.js --delay 500ms --exec \"node dist/main.js server --host $(or $(BACKEND_HOST),localhost) --port $(or $(BACKEND_PORT),3000)\"" \
118+
"$(SHELL) -lc \"CMUX_VITE_HOST=$(or $(VITE_HOST),127.0.0.1) CMUX_VITE_PORT=$(or $(VITE_PORT),5173) VITE_BACKEND_URL=http://$(or $(BACKEND_HOST),localhost):$(or $(BACKEND_PORT),3000) vite\""
109119

110120

111121

@@ -162,16 +172,16 @@ MAGICK_CMD := $(shell command -v magick 2>/dev/null || command -v convert 2>/dev
162172
build/icon.png: docs/img/logo.webp
163173
@echo "Generating Linux icon..."
164174
@mkdir -p build
165-
@$(MAGICK_CMD) docs/img/logo.webp -resize 512x512 build/icon.png
175+
@"$(MAGICK_CMD)" docs/img/logo.webp -resize 512x512 build/icon.png
166176

167177
build/icon.icns: docs/img/logo.webp
168178
@echo "Generating macOS icon..."
169179
@mkdir -p build/icon.iconset
170180
@for size in 16 32 64 128 256 512; do \
171-
$(MAGICK_CMD) docs/img/logo.webp -resize $${size}x$${size} build/icon.iconset/icon_$${size}x$${size}.png; \
181+
"$(MAGICK_CMD)" docs/img/logo.webp -resize $${size}x$${size} build/icon.iconset/icon_$${size}x$${size}.png; \
172182
if [ $$size -le 256 ]; then \
173183
double=$$((size * 2)); \
174-
$(MAGICK_CMD) docs/img/logo.webp -resize $${double}x$${double} build/icon.iconset/icon_$${size}x$${size}@2x.png; \
184+
"$(MAGICK_CMD)" docs/img/logo.webp -resize $${double}x$${double} build/icon.iconset/icon_$${size}x$${size}@2x.png; \
175185
fi; \
176186
done
177187
@iconutil -c icns build/icon.iconset -o build/icon.icns

0 commit comments

Comments
 (0)