From fb1b3d9789d45d33653fd05d93a0cf581226d9ac Mon Sep 17 00:00:00 2001 From: Shozikan <142514207+Youwes09@users.noreply.github.com> Date: Sun, 22 Mar 2026 16:11:13 -0700 Subject: [PATCH 1/2] Fix: Patch to Create latest.json --- .github/workflows/build-windows.yml | 33 +++++++++-------------------- 1 file changed, 10 insertions(+), 23 deletions(-) diff --git a/.github/workflows/build-windows.yml b/.github/workflows/build-windows.yml index 79e6315..48ec25c 100644 --- a/.github/workflows/build-windows.yml +++ b/.github/workflows/build-windows.yml @@ -93,8 +93,6 @@ jobs: else cp -r suwayomi-raw/. suwayomi-extracted/ fi - echo "Extracted bundle contents (top-level):" - ls -la suwayomi-extracted/ - name: Stage Suwayomi bundle shell: bash @@ -103,17 +101,15 @@ jobs: JAVA=$(find suwayomi-extracted -path "*/jre/bin/java.exe" | head -1) JAR=$(find suwayomi-extracted -name "Suwayomi-Server.jar" | head -1) if [ -z "$JAVA" ]; then - echo "ERROR: jre/bin/java.exe not found. Bundle contents:" + echo "ERROR: jre/bin/java.exe not found" find suwayomi-extracted -type f | head -50 exit 1 fi if [ -z "$JAR" ]; then - echo "ERROR: Suwayomi-Server.jar not found. Bundle contents:" + echo "ERROR: Suwayomi-Server.jar not found" find suwayomi-extracted -type f | head -50 exit 1 fi - echo "Found java: $JAVA" - echo "Found jar: $JAR" cp -r suwayomi-extracted src-tauri/binaries/suwayomi-bundle - name: Validate staging @@ -129,28 +125,19 @@ jobs: shell: bash run: | sed -i 's/"beforeBuildCommand": "pnpm build"/"beforeBuildCommand": ""/' src-tauri/tauri.conf.json - echo "tauri.conf.json patched:" - cat src-tauri/tauri.conf.json - - name: Build Tauri app (Windows x64) + - name: Build Tauri app + create GitHub release uses: tauri-apps/tauri-action@v0 env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} TAURI_SIGNING_PRIVATE_KEY: ${{ secrets.TAURI_SIGNING_PRIVATE_KEY }} TAURI_SIGNING_PRIVATE_KEY_PASSWORD: ${{ secrets.TAURI_SIGNING_PRIVATE_KEY_PASSWORD }} with: + tagName: v${{ github.event.inputs.version }} + releaseName: Moku v${{ github.event.inputs.version }} + releaseBody: | + Windows installer for Moku v${{ github.event.inputs.version }}. + Download the `.exe` file below to install or update. + releaseDraft: true + prerelease: false args: --target x86_64-pc-windows-msvc --config src-tauri/tauri.windows.conf.json - - - name: Upload Windows installer - uses: actions/upload-artifact@v4 - with: - name: moku-windows-x64 - path: src-tauri/target/x86_64-pc-windows-msvc/release/bundle/nsis/*.exe - retention-days: 7 - - - name: Upload latest.json (updater endpoint) - uses: actions/upload-artifact@v4 - with: - name: moku-windows-latest-json - path: src-tauri/target/x86_64-pc-windows-msvc/release/bundle/nsis/latest.json - retention-days: 7 From db9ff33c64fa1b61519aa41122c22c8abf2915a6 Mon Sep 17 00:00:00 2001 From: Shozikan <142514207+Youwes09@users.noreply.github.com> Date: Sun, 22 Mar 2026 16:23:43 -0700 Subject: [PATCH 2/2] Fix: Updated Drafting Stage (Build-Windows) --- .github/workflows/build-windows.yml | 21 ++++++++++++++++++++- 1 file changed, 20 insertions(+), 1 deletion(-) diff --git a/.github/workflows/build-windows.yml b/.github/workflows/build-windows.yml index 48ec25c..48f1931 100644 --- a/.github/workflows/build-windows.yml +++ b/.github/workflows/build-windows.yml @@ -7,6 +7,9 @@ on: description: "Version to build (e.g. 0.4.0)" required: true +permissions: + contents: write + jobs: frontend: name: Build frontend @@ -126,7 +129,23 @@ jobs: run: | sed -i 's/"beforeBuildCommand": "pnpm build"/"beforeBuildCommand": ""/' src-tauri/tauri.conf.json - - name: Build Tauri app + create GitHub release + - name: Delete existing draft release if present + shell: bash + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + run: | + RELEASE_ID=$(curl -s -H "Authorization: Bearer $GITHUB_TOKEN" "https://api.github.com/repos/Youwes09/Moku/releases" | jq -r '.[] | select(.tag_name == "v${{ github.event.inputs.version }}" and .draft == true) | .id') + if [ -n "$RELEASE_ID" ]; then + echo "Deleting existing draft release $RELEASE_ID" + curl -s -X DELETE -H "Authorization: Bearer $GITHUB_TOKEN" "https://api.github.com/repos/Youwes09/Moku/releases/$RELEASE_ID" + # Also delete the tag so tauri-action can recreate it + curl -s -X DELETE -H "Authorization: Bearer $GITHUB_TOKEN" "https://api.github.com/repos/Youwes09/Moku/git/refs/tags/v${{ github.event.inputs.version }}" + echo "Deleted draft release and tag" + else + echo "No existing draft release found" + fi + + - name: Build Tauri app + create draft release uses: tauri-apps/tauri-action@v0 env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}