mirror of
https://github.com/moku-project/Moku.git
synced 2026-06-13 09:19:56 -05:00
Fix: Attempt #1 Windows Workflow
This commit is contained in:
@@ -4,7 +4,7 @@ on:
|
|||||||
workflow_dispatch:
|
workflow_dispatch:
|
||||||
inputs:
|
inputs:
|
||||||
version:
|
version:
|
||||||
description: "Version to build (e.g. 0.3.0)"
|
description: "Version to build (e.g. 0.4.0)"
|
||||||
required: true
|
required: true
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
@@ -81,58 +81,39 @@ jobs:
|
|||||||
|
|
||||||
echo "ab6687d278e0dd0984f67abbc853511a7e764f84b126a35d09bfd9b0307321ff suwayomi-windows.zip" | sha256sum -c -
|
echo "ab6687d278e0dd0984f67abbc853511a7e764f84b126a35d09bfd9b0307321ff suwayomi-windows.zip" | sha256sum -c -
|
||||||
|
|
||||||
unzip -q suwayomi-windows.zip -d suwayomi-extracted-raw
|
unzip -q suwayomi-windows.zip -d suwayomi-raw
|
||||||
|
|
||||||
# Detect whether the zip has a single top-level directory wrapper.
|
TOP_DIRS=$(find suwayomi-raw -mindepth 1 -maxdepth 1 -type d)
|
||||||
# If exactly one entry exists at depth-1 and it is a directory, strip it.
|
TOP_FILES=$(find suwayomi-raw -mindepth 1 -maxdepth 1 -type f)
|
||||||
TOP_DIRS=$(find suwayomi-extracted-raw -mindepth 1 -maxdepth 1 -type d)
|
|
||||||
TOP_FILES=$(find suwayomi-extracted-raw -mindepth 1 -maxdepth 1 -type f)
|
|
||||||
TOP_DIR_COUNT=$(echo "$TOP_DIRS" | grep -c . || true)
|
TOP_DIR_COUNT=$(echo "$TOP_DIRS" | grep -c . || true)
|
||||||
|
|
||||||
mkdir -p suwayomi-extracted
|
mkdir -p suwayomi-extracted
|
||||||
if [ "$TOP_DIR_COUNT" -eq 1 ] && [ -z "$TOP_FILES" ]; then
|
if [ "$TOP_DIR_COUNT" -eq 1 ] && [ -z "$TOP_FILES" ]; then
|
||||||
# Single wrapping directory — strip it
|
|
||||||
mv "$TOP_DIRS"/* suwayomi-extracted/
|
mv "$TOP_DIRS"/* suwayomi-extracted/
|
||||||
else
|
else
|
||||||
# Files already at root level — move everything as-is
|
mv suwayomi-raw/* suwayomi-extracted/
|
||||||
mv suwayomi-extracted-raw/* suwayomi-extracted/
|
|
||||||
fi
|
fi
|
||||||
|
|
||||||
- name: Inspect Suwayomi launcher
|
- name: Stage Suwayomi bundle
|
||||||
shell: bash
|
|
||||||
run: |
|
|
||||||
echo "=== Top-level contents ==="
|
|
||||||
ls -la suwayomi-extracted/
|
|
||||||
echo "=== All .exe files ==="
|
|
||||||
find suwayomi-extracted -name "*.exe" | head -20
|
|
||||||
echo "=== All .cmd/.bat files ==="
|
|
||||||
find suwayomi-extracted -name "*.cmd" -o -name "*.bat" | head -20
|
|
||||||
|
|
||||||
- name: Stage Suwayomi sidecar
|
|
||||||
shell: bash
|
shell: bash
|
||||||
run: |
|
run: |
|
||||||
mkdir -p src-tauri/binaries
|
mkdir -p src-tauri/binaries
|
||||||
|
|
||||||
# The Windows bundle has no standalone launcher exe — it ships
|
|
||||||
# "Suwayomi Launcher.bat" which calls jre\bin\javaw.exe -jar Suwayomi-Launcher.jar.
|
|
||||||
# Tauri sidecars must be real executables, so we stage javaw.exe as the
|
|
||||||
# sidecar. lib.rs will invoke it with the correct -jar + working-dir args.
|
|
||||||
JAVAW=$(find suwayomi-extracted -path "*/jre/bin/javaw.exe" | head -1)
|
JAVAW=$(find suwayomi-extracted -path "*/jre/bin/javaw.exe" | head -1)
|
||||||
|
|
||||||
if [ -z "$JAVAW" ]; then
|
if [ -z "$JAVAW" ]; then
|
||||||
echo "ERROR: could not find jre/bin/javaw.exe"
|
echo "ERROR: could not find jre/bin/javaw.exe — bundle contents:"
|
||||||
ls -lR suwayomi-extracted/
|
find suwayomi-extracted -type f | head -40
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
echo "Using javaw: $JAVAW"
|
echo "Found javaw: $JAVAW"
|
||||||
cp "$JAVAW" "src-tauri/binaries/suwayomi-server-x86_64-pc-windows-msvc.exe"
|
|
||||||
|
|
||||||
# Copy the full bundle so the .jar and jre/ tree are available at runtime.
|
# Copy full bundle so jar + jre tree are available at runtime.
|
||||||
# lib.rs sets the working directory to this folder before spawning.
|
# lib.rs looks for suwayomi-bundle/jre/bin/javaw.exe in the resource dir.
|
||||||
cp -r suwayomi-extracted src-tauri/binaries/suwayomi-bundle
|
cp -r suwayomi-extracted src-tauri/binaries/suwayomi-bundle
|
||||||
|
|
||||||
- name: Patch tauri.conf.json for CI
|
- name: Suppress frontend rebuild
|
||||||
shell: bash
|
shell: bash
|
||||||
run: |
|
run: |
|
||||||
sed -i 's/"beforeBuildCommand": "pnpm build"/"beforeBuildCommand": ""/' src-tauri/tauri.conf.json
|
sed -i 's/"beforeBuildCommand": "pnpm build"/"beforeBuildCommand": ""/' src-tauri/tauri.conf.json
|
||||||
|
|||||||
@@ -14,7 +14,9 @@
|
|||||||
{ "name": "suwayomi-server" },
|
{ "name": "suwayomi-server" },
|
||||||
{ "name": "suwayomi-server-aarch64-apple-darwin" },
|
{ "name": "suwayomi-server-aarch64-apple-darwin" },
|
||||||
{ "name": "suwayomi-server-x86_64-apple-darwin" },
|
{ "name": "suwayomi-server-x86_64-apple-darwin" },
|
||||||
{ "name": "javaw" }
|
{ "name": "javaw", "args": true },
|
||||||
|
{ "name": "which" },
|
||||||
|
{ "name": "where" }
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
|
|||||||
+14
-19
@@ -247,25 +247,20 @@ fn resolve_server_binary(
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Fall back to PATH — covers Nix, distro packages, and any system install.
|
// Fall back to PATH — covers Nix, distro packages, and any system install.
|
||||||
{
|
// Windows always hits the early return above so this block is Linux/macOS only.
|
||||||
#[cfg(target_os = "windows")]
|
#[cfg(not(target_os = "windows"))]
|
||||||
let which_cmd = "where";
|
for name in &["tachidesk-server", "suwayomi-server"] {
|
||||||
#[cfg(not(target_os = "windows"))]
|
if std::process::Command::new("which")
|
||||||
let which_cmd = "which";
|
.arg(name)
|
||||||
|
.output()
|
||||||
for name in &["tachidesk-server", "suwayomi-server"] {
|
.map(|o| o.status.success())
|
||||||
if std::process::Command::new(which_cmd)
|
.unwrap_or(false)
|
||||||
.arg(name)
|
{
|
||||||
.output()
|
return Ok(ServerInvocation {
|
||||||
.map(|o| o.status.success())
|
bin: std::ffi::OsString::from(name),
|
||||||
.unwrap_or(false)
|
prefix_args: vec![],
|
||||||
{
|
working_dir: None,
|
||||||
return Ok(ServerInvocation {
|
});
|
||||||
bin: std::ffi::OsString::from(name),
|
|
||||||
prefix_args: vec![],
|
|
||||||
working_dir: None,
|
|
||||||
});
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -26,7 +26,11 @@
|
|||||||
},
|
},
|
||||||
"bundle": {
|
"bundle": {
|
||||||
"active": true,
|
"active": true,
|
||||||
"targets": ["appimage", "nsis", "deb"],
|
"targets": [
|
||||||
|
"appimage",
|
||||||
|
"nsis",
|
||||||
|
"deb"
|
||||||
|
],
|
||||||
"icon": [
|
"icon": [
|
||||||
"icons/32x32.png",
|
"icons/32x32.png",
|
||||||
"icons/128x128.png",
|
"icons/128x128.png",
|
||||||
@@ -40,7 +44,10 @@
|
|||||||
"installerIcon": "icons/icon.ico",
|
"installerIcon": "icons/icon.ico",
|
||||||
"installMode": "currentUser"
|
"installMode": "currentUser"
|
||||||
}
|
}
|
||||||
}
|
},
|
||||||
|
"resources": [
|
||||||
|
"binaries/suwayomi-bundle/**"
|
||||||
|
]
|
||||||
},
|
},
|
||||||
"plugins": {
|
"plugins": {
|
||||||
"shell": {
|
"shell": {
|
||||||
|
|||||||
Reference in New Issue
Block a user