From 202e1a58ec60e590a67f960abd4d246b8f8ac988 Mon Sep 17 00:00:00 2001 From: Nico Verbruggen Date: Sun, 22 Mar 2026 15:00:45 +0100 Subject: [PATCH] Set up assets in build process --- .github/workflows/build.yml | 19 +++++++++++++++---- kobopatch-wasm/setup.sh | 11 ++++++++++- 2 files changed, 25 insertions(+), 5 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index d4fc50b..0a18a27 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -104,10 +104,6 @@ jobs: include: - os: ubuntu-latest platform: linux - - os: macos-latest - platform: mac - - os: windows-latest - platform: win runs-on: ${{ matrix.os }} steps: - name: Checkout @@ -118,6 +114,21 @@ jobs: with: node-version: '22' + - name: Build WASM binary + run: | + cd kobopatch-wasm + ./setup.sh + ./build.sh + + - name: Set up NickelMenu assets + run: nickelmenu/setup.sh + + - name: Set up KOReader assets + run: koreader/setup.sh + + - name: Set up Readerly assets + run: readerly/setup.sh + - name: Build frontend run: | cd web diff --git a/kobopatch-wasm/setup.sh b/kobopatch-wasm/setup.sh index 3a55161..fc54740 100755 --- a/kobopatch-wasm/setup.sh +++ b/kobopatch-wasm/setup.sh @@ -16,6 +16,9 @@ elif [ -x "$LOCAL_GO_DIR/bin/go" ] && "$LOCAL_GO_DIR/bin/go" version 2>/dev/null else # Detect platform and architecture OS="$(uname -s | tr '[:upper:]' '[:lower:]')" + case "$OS" in + msys*|mingw*) OS="windows" ;; + esac ARCH="$(uname -m)" case "$ARCH" in x86_64) ARCH="amd64" ;; @@ -28,7 +31,13 @@ else echo "Downloading Go ${GO_VERSION} for ${OS}/${ARCH}..." rm -rf "$LOCAL_GO_DIR" - curl -fsSL "https://go.dev/dl/go${GO_VERSION}.${OS}-${ARCH}.tar.gz" | tar -xz -C "$SCRIPT_DIR" + if [ "$OS" = "windows" ]; then + curl -fsSL "https://go.dev/dl/go${GO_VERSION}.${OS}-${ARCH}.zip" -o "$SCRIPT_DIR/go.zip" + unzip -q "$SCRIPT_DIR/go.zip" -d "$SCRIPT_DIR" + rm "$SCRIPT_DIR/go.zip" + else + curl -fsSL "https://go.dev/dl/go${GO_VERSION}.${OS}-${ARCH}.tar.gz" | tar -xz -C "$SCRIPT_DIR" + fi export GOROOT="$LOCAL_GO_DIR" export PATH="$LOCAL_GO_DIR/bin:$PATH" fi