.
This commit is contained in:
@@ -60,7 +60,7 @@ jobs:
|
|||||||
- name: Install 7-Zip
|
- name: Install 7-Zip
|
||||||
run: |
|
run: |
|
||||||
sudo apt-get update
|
sudo apt-get update
|
||||||
sudo apt-get install -y p7zip-full
|
sudo apt-get install -y p7zip-full tree
|
||||||
|
|
||||||
- name: Process Archives
|
- name: Process Archives
|
||||||
run: |
|
run: |
|
||||||
@@ -75,47 +75,54 @@ jobs:
|
|||||||
# 2. Find all archives recursively (zip, 7z, rar)
|
# 2. Find all archives recursively (zip, 7z, rar)
|
||||||
find "$SOURCE_ROOT" -type f \( -name "*.zip" -o -name "*.7z" -o -name "*.rar" \) | while read archive; do
|
find "$SOURCE_ROOT" -type f \( -name "*.zip" -o -name "*.7z" -o -name "*.rar" \) | while read archive; do
|
||||||
|
|
||||||
# Get the filename without extension (e.g., "cars/groupA/my_car.zip" -> "my_car")
|
# Get the filename without extension (e.g., "cars/groupA/my_car.zip" -> "my_car")
|
||||||
filename=$(basename -- "$archive")
|
filename=$(basename -- "$archive")
|
||||||
car_name="${filename%.*}"
|
car_name="${filename%.*}"
|
||||||
|
|
||||||
echo "--------------------------------------"
|
echo "--------------------------------------"
|
||||||
echo "Processing: $car_name"
|
echo "Processing: $car_name"
|
||||||
|
|
||||||
# # Create a temp directory for extraction
|
# Create a temp directory for extraction
|
||||||
# temp_dir=$(mktemp -d)
|
temp_dir=$(mktemp -d)
|
||||||
|
|
||||||
# # 3. Extract contents
|
# 3. Extract contents
|
||||||
# # -y: assume yes on all queries
|
# -y: assume yes on all queries
|
||||||
# # -o: output directory (no space after -o)
|
# -o: output directory (no space after -o)
|
||||||
# 7z x "$archive" -o"$temp_dir" -y > /dev/null
|
|
||||||
|
|
||||||
# # 4. FILTERING LOGIC (The "Server" optimization)
|
7z x "$archive" -o"$temp_dir" -y > /dev/null
|
||||||
# echo "Cleaning up unnecessary server files..."
|
|
||||||
|
|
||||||
# # Remove heavy textures and previews (recursive)
|
# 4. FILTERING LOGIC
|
||||||
# find "$temp_dir" -type f \( -name "*.png" -o -name "*.jpg" -o -name "*.jpeg" -o -name "*.dds" -o -name "*.kn5" -o -name "*.bmp" \) -delete
|
|
||||||
|
|
||||||
# # Remove the 'physics/csp' folder if standard physics are preferred (Optional - comment out if needed)
|
# remove skins that are not livery.png, preview.jpeg, or ui_skin.json
|
||||||
# # rm -rf "$temp_dir/physics/csp"
|
find "$temp_dir" -type f -not -name "skins/*/livery.png" \
|
||||||
|
-not -name "skins/*/preview.jpeg" \
|
||||||
|
-not -name "skins/*/ui_skin.json" \
|
||||||
|
-not -name "ui/badge.png" \
|
||||||
|
-not -name "ui/ui_car.json" \
|
||||||
|
-not -name "data.acd" \
|
||||||
|
-not -name "physics/standard/data.acd" \
|
||||||
|
-not -name "physics/csp/data.acd" \
|
||||||
|
-delete
|
||||||
|
|
||||||
# # 5. Move to final Server Directory
|
tree "$temp_dir"
|
||||||
# target_dir="$DEST_ROOT/$car_name"
|
|
||||||
|
|
||||||
# # Clean old version if exists
|
# # 5. Move to final Server Directory
|
||||||
# if [ -d "$target_dir" ]; then
|
# target_dir="$DEST_ROOT/$car_name"
|
||||||
# rm -rf "$target_dir"
|
|
||||||
# fi
|
|
||||||
# mkdir -p "$target_dir"
|
|
||||||
|
|
||||||
# # Move files
|
# # Clean old version if exists
|
||||||
# cp -r "$temp_dir"/* "$target_dir"/
|
# if [ -d "$target_dir" ]; then
|
||||||
|
# rm -rf "$target_dir"
|
||||||
|
# fi
|
||||||
|
# mkdir -p "$target_dir"
|
||||||
|
|
||||||
# # Cleanup temp
|
# # Move files
|
||||||
# rm -rf "$temp_dir"
|
# cp -r "$temp_dir"/* "$target_dir"/
|
||||||
|
|
||||||
echo "✅ Installed to: $target_dir"
|
# # Cleanup temp
|
||||||
done
|
# rm -rf "$temp_dir"
|
||||||
|
|
||||||
|
echo "✅ Installed to: $target_dir"
|
||||||
|
done
|
||||||
|
|
||||||
# - name: Verify Installation
|
# - name: Verify Installation
|
||||||
# run: |
|
# run: |
|
||||||
|
|||||||
Reference in New Issue
Block a user