From 74494da39c02a6e6160d8a115546c003767e6f92 Mon Sep 17 00:00:00 2001 From: Connor Yoh Date: Fri, 11 Jul 2025 10:02:24 +0100 Subject: [PATCH] Refine sign process --- .github/workflows/tauri-test.yml | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/.github/workflows/tauri-test.yml b/.github/workflows/tauri-test.yml index 6e6143a3f..d28f1d759 100644 --- a/.github/workflows/tauri-test.yml +++ b/.github/workflows/tauri-test.yml @@ -276,9 +276,13 @@ jobs: fi done - # Repackage the nested JAR with signed .dylib files + # Repackage the nested JAR with signed .dylib files (preserve manifest) echo "📦 Repacking $nested_jar with signed libraries..." - jar -cf "$SIGNING_DIR/$nested_jar" -C . . + if [ -f "META-INF/MANIFEST.MF" ]; then + jar -cfm "$SIGNING_DIR/$nested_jar" META-INF/MANIFEST.MF -C . . + else + jar -cf "$SIGNING_DIR/$nested_jar" -C . . + fi # Clean up cd "$SIGNING_DIR" @@ -290,8 +294,8 @@ jobs: echo "ℹ️ No BOOT-INF/lib structure found" fi - # Also check for .dylib files directly in the main JAR - MAIN_DYLIBS=$(jar -tf "../$MAIN_JAR" | grep '\.dylib$' || true) + # Also check for .dylib files directly in the main JAR (already extracted) + MAIN_DYLIBS=$(find . -name "*.dylib" -not -path "./BOOT-INF/lib/*" || true) if [ -n "$MAIN_DYLIBS" ]; then echo "📦 Found .dylib files directly in main JAR:" echo "$MAIN_DYLIBS" @@ -303,16 +307,13 @@ jobs: --sign "$CERT_ID" \ "$dylib_path" echo "✅ Signed: $dylib_path" - DYLIB_COUNT=$((DYLIB_COUNT + 1)) fi done fi # Repackage the main JAR preserving Spring Boot structure echo "📦 Repacking main JAR with Spring Boot structure preserved..." - # First, extract and preserve the original manifest - jar -xf "../$MAIN_JAR" META-INF/MANIFEST.MF - # Create new JAR with explicit manifest preservation + # The manifest is already extracted in the current directory, use it directly jar -cfm "../$MAIN_JAR.new" META-INF/MANIFEST.MF -C . . cd .. mv "$MAIN_JAR.new" "$MAIN_JAR"