Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -50,4 +50,4 @@ jobs:
./archive.zip
./NumberGuessingGame-windows.zip
./NumberGuessingGame-macos.zip
./NumberGuessingGame-linux.tar.gz
./NumberGuessingGame-linux.tar.xz
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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:

Expand Down Expand Up @@ -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.
11 changes: 6 additions & 5 deletions package-linux.sh
Original file line number Diff line number Diff line change
@@ -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
Expand All @@ -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
Expand Down Expand Up @@ -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 ""
4 changes: 2 additions & 2 deletions package-macos.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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}
Expand Down
4 changes: 2 additions & 2 deletions package-win.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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}
Expand Down
4 changes: 2 additions & 2 deletions package-zip.bat
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions package-zip.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Loading