feat: goose windows (#880)
Co-authored-by: Ryan Versaw <ryan@versaw.com>
This commit is contained in:
@@ -10,6 +10,31 @@ release-binary:
|
||||
cargo build --release
|
||||
@just copy-binary
|
||||
|
||||
# Build Windows executable
|
||||
release-windows:
|
||||
#!/usr/bin/env sh
|
||||
if [ "$(uname)" = "Darwin" ] || [ "$(uname)" = "Linux" ]; then
|
||||
echo "Building Windows executable using Docker..."
|
||||
docker volume create goose-windows-cache || true
|
||||
docker run --rm \
|
||||
-v "$(pwd)":/usr/src/myapp \
|
||||
-v goose-windows-cache:/usr/local/cargo/registry \
|
||||
-w /usr/src/myapp \
|
||||
rust:latest \
|
||||
sh -c "rustup target add x86_64-pc-windows-gnu && \
|
||||
apt-get update && \
|
||||
apt-get install -y mingw-w64 && \
|
||||
cargo build --release --target x86_64-pc-windows-gnu && \
|
||||
GCC_DIR=\$(ls -d /usr/lib/gcc/x86_64-w64-mingw32/*/ | head -n 1) && \
|
||||
cp \$GCC_DIR/libstdc++-6.dll /usr/src/myapp/target/x86_64-pc-windows-gnu/release/ && \
|
||||
cp \$GCC_DIR/libgcc_s_seh-1.dll /usr/src/myapp/target/x86_64-pc-windows-gnu/release/ && \
|
||||
cp /usr/x86_64-w64-mingw32/lib/libwinpthread-1.dll /usr/src/myapp/target/x86_64-pc-windows-gnu/release/"
|
||||
else
|
||||
echo "Building Windows executable using Docker through PowerShell..."
|
||||
powershell.exe -Command "docker volume create goose-windows-cache; docker run --rm -v ${PWD}:/usr/src/myapp -v goose-windows-cache:/usr/local/cargo/registry -w /usr/src/myapp rust:latest sh -c 'rustup target add x86_64-pc-windows-gnu && apt-get update && apt-get install -y mingw-w64 && cargo build --release --target x86_64-pc-windows-gnu && GCC_DIR=\$(ls -d /usr/lib/gcc/x86_64-w64-mingw32/*/ | head -n 1) && cp \$GCC_DIR/libstdc++-6.dll /usr/src/myapp/target/x86_64-pc-windows-gnu/release/ && cp \$GCC_DIR/libgcc_s_seh-1.dll /usr/src/myapp/target/x86_64-pc-windows-gnu/release/ && cp /usr/x86_64-w64-mingw32/lib/libwinpthread-1.dll /usr/src/myapp/target/x86_64-pc-windows-gnu/release/'"
|
||||
fi
|
||||
echo "Windows executable and required DLLs created at ./target/x86_64-pc-windows-gnu/release/"
|
||||
|
||||
# Copy binary command
|
||||
copy-binary:
|
||||
@if [ -f ./target/release/goosed ]; then \
|
||||
@@ -20,12 +45,30 @@ copy-binary:
|
||||
exit 1; \
|
||||
fi
|
||||
|
||||
# Copy Windows binary command
|
||||
copy-binary-windows:
|
||||
@powershell.exe -Command "if (Test-Path ./target/x86_64-pc-windows-gnu/release/goosed.exe) { \
|
||||
Write-Host 'Copying Windows binary and DLLs to ui/desktop/src/bin...'; \
|
||||
Copy-Item -Path './target/x86_64-pc-windows-gnu/release/goosed.exe' -Destination './ui/desktop/src/bin/' -Force; \
|
||||
Copy-Item -Path './target/x86_64-pc-windows-gnu/release/*.dll' -Destination './ui/desktop/src/bin/' -Force; \
|
||||
} else { \
|
||||
Write-Host 'Windows binary not found.' -ForegroundColor Red; \
|
||||
exit 1; \
|
||||
}"
|
||||
|
||||
# Run UI with latest
|
||||
run-ui:
|
||||
@just release-binary
|
||||
@echo "Running UI..."
|
||||
cd ui/desktop && npm install && npm run start-gui
|
||||
|
||||
# Run UI with latest (Windows version)
|
||||
run-ui-windows:
|
||||
@just release-windows
|
||||
@powershell.exe -Command "Write-Host 'Copying Windows binary...'"
|
||||
@just copy-binary-windows
|
||||
@powershell.exe -Command "Write-Host 'Running UI...'; Set-Location ui/desktop; npm install; npm run start-gui"
|
||||
|
||||
# Run Docusaurus server for documentation
|
||||
run-docs:
|
||||
@echo "Running docs server..."
|
||||
@@ -41,6 +84,26 @@ make-ui:
|
||||
@just release-binary
|
||||
cd ui/desktop && npm run bundle:default
|
||||
|
||||
# make GUI with latest Windows binary
|
||||
make-ui-windows:
|
||||
@just release-windows
|
||||
#!/usr/bin/env sh
|
||||
if [ -f "./target/x86_64-pc-windows-gnu/release/goosed.exe" ]; then \
|
||||
echo "Copying Windows binary and DLLs to ui/desktop/src/bin..."; \
|
||||
mkdir -p ./ui/desktop/src/bin; \
|
||||
cp -f ./target/x86_64-pc-windows-gnu/release/goosed.exe ./ui/desktop/src/bin/; \
|
||||
cp -f ./target/x86_64-pc-windows-gnu/release/*.dll ./ui/desktop/src/bin/; \
|
||||
echo "Building Windows package..."; \
|
||||
cd ui/desktop && \
|
||||
npm run bundle:windows && \
|
||||
mkdir -p out/Goose-win32-x64/resources/bin && \
|
||||
cp -f src/bin/goosed.exe out/Goose-win32-x64/resources/bin/ && \
|
||||
cp -f src/bin/*.dll out/Goose-win32-x64/resources/bin/; \
|
||||
else \
|
||||
echo "Windows binary not found."; \
|
||||
exit 1; \
|
||||
fi
|
||||
|
||||
# Setup langfuse server
|
||||
langfuse-server:
|
||||
#!/usr/bin/env bash
|
||||
|
||||
Reference in New Issue
Block a user