build: add Windows desktop test bundle
This commit is contained in:
parent
47a8d565e8
commit
f4e911c14a
|
|
@ -2,6 +2,7 @@
|
||||||
frontend/node_modules/
|
frontend/node_modules/
|
||||||
frontend/dist/
|
frontend/dist/
|
||||||
build/bin/verstak-desktop
|
build/bin/verstak-desktop
|
||||||
|
build/windows-amd64/
|
||||||
smoke-platform
|
smoke-platform
|
||||||
plugins/
|
plugins/
|
||||||
vendor/
|
vendor/
|
||||||
|
|
|
||||||
24
README.md
24
README.md
|
|
@ -78,6 +78,30 @@ diagnostic logs:
|
||||||
./build/bin/verstak-desktop --debug
|
./build/bin/verstak-desktop --debug
|
||||||
```
|
```
|
||||||
|
|
||||||
|
## Windows test bundle from Linux
|
||||||
|
|
||||||
|
The current Windows path is intended for manual testing, not publication. On a
|
||||||
|
Linux host install MinGW, then run:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
sudo apt install gcc-mingw-w64-x86-64
|
||||||
|
./scripts/build-windows.sh
|
||||||
|
```
|
||||||
|
|
||||||
|
The script builds Windows amd64 plugin packages from the sibling
|
||||||
|
`verstak-official-plugins` checkout, cross-compiles the Wails host, and writes
|
||||||
|
a folder ready to copy to a Windows machine:
|
||||||
|
|
||||||
|
```text
|
||||||
|
build/windows-amd64/
|
||||||
|
├── verstak-desktop.exe
|
||||||
|
└── plugins/
|
||||||
|
```
|
||||||
|
|
||||||
|
Copy the whole directory to Windows and run `verstak-desktop.exe`. Windows
|
||||||
|
requires the Microsoft WebView2 Runtime; Windows 11 normally includes it.
|
||||||
|
No Windows GitHub Release is created by this command.
|
||||||
|
|
||||||
## First local vault
|
## First local vault
|
||||||
|
|
||||||
1. Launch the desktop application and choose or create a writable vault folder.
|
1. Launch the desktop application and choose or create a writable vault folder.
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,72 @@
|
||||||
|
#!/usr/bin/env bash
|
||||||
|
set -euo pipefail
|
||||||
|
|
||||||
|
ROOT="$(cd "$(dirname "$0")/.." && pwd)"
|
||||||
|
OFFICIAL_PLUGINS="${VERSTAK_OFFICIAL_PLUGINS_DIR:-$ROOT/../verstak-official-plugins}"
|
||||||
|
WINDOWS_PLUGIN_DIST="${VERSTAK_WINDOWS_PLUGIN_DIST:-$OFFICIAL_PLUGINS/dist-windows}"
|
||||||
|
WINDOWS_OUTPUT="${VERSTAK_WINDOWS_OUTPUT_DIR:-$ROOT/build/windows-amd64}"
|
||||||
|
WINDOWS_CC="${VERSTAK_WINDOWS_CC:-x86_64-w64-mingw32-gcc}"
|
||||||
|
|
||||||
|
if ! command -v "$WINDOWS_CC" >/dev/null; then
|
||||||
|
echo "Windows cross-compiler not found: $WINDOWS_CC" >&2
|
||||||
|
echo "Install x86_64-w64-mingw32-gcc (for example: sudo apt install gcc-mingw-w64-x86-64)." >&2
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
if [[ ! -d "$OFFICIAL_PLUGINS" ]]; then
|
||||||
|
echo "official plugins repository not found: $OFFICIAL_PLUGINS" >&2
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
WAILS="${WAILS_BIN:-}"
|
||||||
|
if [[ -z "$WAILS" ]]; then
|
||||||
|
if command -v wails >/dev/null; then
|
||||||
|
WAILS="wails"
|
||||||
|
elif [[ -n "$(go env GOBIN 2>/dev/null)" && -x "$(go env GOBIN)/wails" ]]; then
|
||||||
|
WAILS="$(go env GOBIN)/wails"
|
||||||
|
elif [[ -x "$(go env GOPATH)/bin/wails" ]]; then
|
||||||
|
WAILS="$(go env GOPATH)/bin/wails"
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
if [[ -z "$WAILS" ]]; then
|
||||||
|
echo "Wails CLI is required. Install it with: go install github.com/wailsapp/wails/v2/cmd/wails@v2.12.0" >&2
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
cd "$ROOT"
|
||||||
|
echo "=== verstak desktop Windows amd64 build ==="
|
||||||
|
|
||||||
|
if [[ ! -d "$ROOT/frontend/node_modules" ]]; then
|
||||||
|
if [[ -f "$ROOT/frontend/package-lock.json" ]]; then
|
||||||
|
(cd "$ROOT/frontend" && npm ci --no-audit --no-fund)
|
||||||
|
else
|
||||||
|
(cd "$ROOT/frontend" && npm install --no-audit --no-fund)
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
(cd "$ROOT/frontend" && npm run build)
|
||||||
|
|
||||||
|
go mod download
|
||||||
|
go test -count=1 ./...
|
||||||
|
|
||||||
|
"$OFFICIAL_PLUGINS/scripts/build-windows.sh"
|
||||||
|
if [[ ! -d "$WINDOWS_PLUGIN_DIST" ]]; then
|
||||||
|
echo "Windows plugin packages were not produced: $WINDOWS_PLUGIN_DIST" >&2
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
# Wails generates Windows resources and invokes the supplied MinGW compiler.
|
||||||
|
# -clean resets build/bin, so copy the finished executable only afterwards.
|
||||||
|
"$WAILS" build -clean -platform windows/amd64 -compiler "$WINDOWS_CC" -o verstak-desktop.exe
|
||||||
|
|
||||||
|
WINDOWS_BINARY="$ROOT/build/bin/verstak-desktop.exe"
|
||||||
|
if [[ ! -f "$WINDOWS_BINARY" ]]; then
|
||||||
|
echo "Windows executable was not produced: $WINDOWS_BINARY" >&2
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
rm -rf "$WINDOWS_OUTPUT"
|
||||||
|
mkdir -p "$WINDOWS_OUTPUT/plugins"
|
||||||
|
cp "$WINDOWS_BINARY" "$WINDOWS_OUTPUT/verstak-desktop.exe"
|
||||||
|
cp -R "$WINDOWS_PLUGIN_DIST/." "$WINDOWS_OUTPUT/plugins/"
|
||||||
|
|
||||||
|
echo "Windows test bundle: $WINDOWS_OUTPUT"
|
||||||
|
echo "Copy this directory to Windows and run verstak-desktop.exe."
|
||||||
|
|
@ -0,0 +1,19 @@
|
||||||
|
#!/usr/bin/env bash
|
||||||
|
set -euo pipefail
|
||||||
|
|
||||||
|
ROOT="$(cd "$(dirname "$0")/.." && pwd)"
|
||||||
|
BUILDER="$ROOT/scripts/build-windows.sh"
|
||||||
|
|
||||||
|
if [[ ! -x "$BUILDER" ]]; then
|
||||||
|
echo "Windows desktop builder is missing or not executable: $BUILDER" >&2
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
bash -n "$BUILDER"
|
||||||
|
grep -Fq -- '-platform windows/amd64' "$BUILDER"
|
||||||
|
grep -Fq -- '-compiler "$WINDOWS_CC"' "$BUILDER"
|
||||||
|
grep -Fq 'dist-windows' "$BUILDER"
|
||||||
|
grep -Fq 'verstak-desktop.exe' "$BUILDER"
|
||||||
|
grep -Fq 'x86_64-w64-mingw32-gcc' "$BUILDER"
|
||||||
|
|
||||||
|
echo "Windows desktop build script contract passed"
|
||||||
Loading…
Reference in New Issue