diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index bbcdabf..400bc78 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -50,4 +50,4 @@ jobs: ./archive.zip ./NumberGuessingGame-windows.zip ./NumberGuessingGame-macos.zip - ./NumberGuessingGame-linux.tar.gz + ./NumberGuessingGame-linux.tar.xz diff --git a/README.md b/README.md index 17449f6..e652861 100644 --- a/README.md +++ b/README.md @@ -47,7 +47,7 @@ Download the platform-specific package with bundled JRE from the [latest release - **Windows**: `NumberGuessingGame-windows.zip` (no Java installation required) - **macOS**: `NumberGuessingGame-macos.zip` (no Java installation required) -- **Linux**: `NumberGuessingGame-linux.tar.gz` (no Java installation required) +- **Linux**: `NumberGuessingGame-linux.tar.xz` (no Java installation required) Extract the downloaded archive and run: @@ -183,7 +183,7 @@ Run the following scripts to create platform-specific packages with bundled JRE: ```bash ./package-win.sh # Creates NumberGuessingGame-windows.zip ./package-macos.sh # Creates NumberGuessingGame-macos.zip -./package-linux.sh # Creates NumberGuessingGame-linux.tar.gz +./package-linux.sh # Creates NumberGuessingGame-linux.tar.xz ``` These packages include a bundled JRE and do not require Java to be installed on the target system. They are automatically built and uploaded to GitHub Releases via GitHub Actions. diff --git a/package-linux.sh b/package-linux.sh index 26d452a..6dc54f6 100755 --- a/package-linux.sh +++ b/package-linux.sh @@ -1,7 +1,7 @@ #!/bin/sh # Script to create a Linux package with bundled JRE for Number Guessing Game # This creates a self-contained package that doesn't require Java to be installed -# Output: NumberGuessingGame-linux.tar.gz +# Output: NumberGuessingGame-linux.tar.xz # Exit immediately if any command fails set -e @@ -16,6 +16,7 @@ ADOPTIUM_BASE_URL="https://api.adoptium.net/v3/binary/latest/8/ga" # Clean up any previous builds rm -rf ${PACKAGE_NAME} rm -rf ${JRE_DIR} +rm -f ${PACKAGE_NAME}.tar.xz rm -f ${PACKAGE_NAME}.tar.gz # Build the application using Gradle @@ -58,14 +59,14 @@ EOF # Make the run script executable chmod +x ${PACKAGE_NAME}/run.sh -# Create the final tar.gz archive -echo "Creating tar.gz archive..." -tar -czf ${PACKAGE_NAME}.tar.gz ${PACKAGE_NAME}/ +# Create the final tar.xz archive with maximum compression +echo "Creating tar.xz archive..." +tar -cJf ${PACKAGE_NAME}.tar.xz ${PACKAGE_NAME}/ # Clean up temporary directories rm -rf ${PACKAGE_NAME} rm -rf ${JRE_DIR} echo "" -echo "✓ Linux package with bundled JRE created: ${PACKAGE_NAME}.tar.gz" +echo "✓ Linux package with bundled JRE created: ${PACKAGE_NAME}.tar.xz" echo "" diff --git a/package-macos.sh b/package-macos.sh index b87bc2e..da7e747 100755 --- a/package-macos.sh +++ b/package-macos.sh @@ -58,9 +58,9 @@ EOF # Make the run script executable chmod +x ${PACKAGE_NAME}/run.sh -# Create the final zip archive +# Create the final zip archive with maximum compression echo "Creating zip archive..." -zip -r ${PACKAGE_NAME}.zip ${PACKAGE_NAME}/ +zip -9 -r ${PACKAGE_NAME}.zip ${PACKAGE_NAME}/ # Clean up temporary directories rm -rf ${PACKAGE_NAME} diff --git a/package-win.sh b/package-win.sh index 5f9d671..c2f55da 100755 --- a/package-win.sh +++ b/package-win.sh @@ -54,9 +54,9 @@ jre\bin\java.exe -jar game.jar @pause EOF -# Create the final zip archive +# Create the final zip archive with maximum compression echo "Creating zip archive..." -zip -r ${PACKAGE_NAME}.zip ${PACKAGE_NAME}/ +zip -9 -r ${PACKAGE_NAME}.zip ${PACKAGE_NAME}/ # Clean up temporary directories rm -rf ${PACKAGE_NAME} diff --git a/package-zip.bat b/package-zip.bat index bdc0e6a..5baaeaa 100644 --- a/package-zip.bat +++ b/package-zip.bat @@ -17,8 +17,8 @@ copy scripts\run.sh NumberGuessingGame\run.sh copy README.md NumberGuessingGame\README.txt copy LICENSE NumberGuessingGame\LICENSE -REM Create the ZIP archive using PowerShell -powershell -command "Compress-Archive -Path NumberGuessingGame -DestinationPath archive.zip -Force" +REM Create the ZIP archive using PowerShell with maximum compression +powershell -command "Compress-Archive -Path NumberGuessingGame -DestinationPath archive.zip -CompressionLevel Optimal -Force" REM Clean up temporary directory rmdir /s /q NumberGuessingGame diff --git a/package-zip.sh b/package-zip.sh index 712ed00..f4cb1f6 100755 --- a/package-zip.sh +++ b/package-zip.sh @@ -22,8 +22,8 @@ cp -r scripts/run.sh NumberGuessingGame/run.sh cp -r README.md NumberGuessingGame/README.txt cp -r LICENSE NumberGuessingGame/LICENSE -# Create the ZIP archive -zip -r archive.zip NumberGuessingGame/ +# Create the ZIP archive with maximum compression +zip -9 -r archive.zip NumberGuessingGame/ # Clean up temporary directory rm -rf NumberGuessingGame