This commit is contained in:
2026-02-08 02:49:35 +01:00
parent 3e0c13a77b
commit 0abb0b6f38
2 changed files with 84 additions and 58 deletions

View File

@@ -1 +1 @@
lfs.https://git.dapa.hu/dapa/assetto.git/info/lfs.locksverify true lfs.https://git.dapa.hu/dapa/assetto.git/info/lfs.locksverify true

View File

@@ -14,76 +14,102 @@ env:
jobs: jobs:
prepare-server-content: prepare-server-content:
runs-on: ubuntu-latest runs-on: ubuntu-latest
steps: steps:
- name: Checkout Master Branch (LFS) - name: Pre-initialize Repository with SHA-256
run: |
mkdir -p ${{ github.workspace }}
git init --object-format=sha256 ${{ github.workspace }}
- name: Checkout Main Branch (No LFS)
uses: actions/checkout@v4 uses: actions/checkout@v4
with: with:
ref: master ref: main
lfs: true lfs: false # <--- Turn this OFF
fetch-depth: 0 fetch-depth: 1
clean: false
- name: Install 7-Zip - name: Manual LFS Fetch with Debugging
env:
GIT_TRACE: 1
GIT_TRANSFER_TRACE: 1
GIT_CURL_VERBOSE: 1
run: | run: |
sudo apt-get update git lfs install
sudo apt-get install -y p7zip-full # Try to pull the specific missing files to see the real error message
git lfs fetch origin main
git lfs checkout
- name: Process Archives # steps:
run: | # - name: Checkout Master Branch (LFS)
# 1. Define Paths # uses: actions/checkout@v4
SOURCE_ROOT="./cars" # with:
# This is where the server expects the files # ref: master
DEST_ROOT="./server-data/content/cars" # lfs: true
mkdir -p "$DEST_ROOT" # fetch-depth: 0
echo "🔍 Searching for archives in $SOURCE_ROOT..." # - name: Install 7-Zip
# run: |
# sudo apt-get update
# sudo apt-get install -y p7zip-full
# 2. Find all archives recursively (zip, 7z, rar) # - name: Process Archives
find "$SOURCE_ROOT" -type f \( -name "*.zip" -o -name "*.7z" -o -name "*.rar" \) | while read archive; do # run: |
# # 1. Define Paths
# Get the filename without extension (e.g., "cars/groupA/my_car.zip" -> "my_car") # SOURCE_ROOT="./cars"
filename=$(basename -- "$archive") # # This is where the server expects the files
car_name="${filename%.*}" # DEST_ROOT="./server-data/content/cars"
# mkdir -p "$DEST_ROOT"
echo "--------------------------------------"
echo "Processing: $car_name"
# # Create a temp directory for extraction # echo "🔍 Searching for archives in $SOURCE_ROOT..."
# temp_dir=$(mktemp -d)
# # 3. Extract contents # # 2. Find all archives recursively (zip, 7z, rar)
# # -y: assume yes on all queries # find "$SOURCE_ROOT" -type f \( -name "*.zip" -o -name "*.7z" -o -name "*.rar" \) | while read archive; do
# # -o: output directory (no space after -o)
# 7z x "$archive" -o"$temp_dir" -y > /dev/null
# # 4. FILTERING LOGIC (The "Server" optimization) # # Get the filename without extension (e.g., "cars/groupA/my_car.zip" -> "my_car")
# echo "Cleaning up unnecessary server files..." # filename=$(basename -- "$archive")
# car_name="${filename%.*}"
# # Remove heavy textures and previews (recursive) # echo "--------------------------------------"
# find "$temp_dir" -type f \( -name "*.png" -o -name "*.jpg" -o -name "*.jpeg" -o -name "*.dds" -o -name "*.kn5" -o -name "*.bmp" \) -delete # echo "Processing: $car_name"
# # Remove the 'physics/csp' folder if standard physics are preferred (Optional - comment out if needed)
# # rm -rf "$temp_dir/physics/csp"
# # 5. Move to final Server Directory # # # Create a temp directory for extraction
# target_dir="$DEST_ROOT/$car_name" # # temp_dir=$(mktemp -d)
# # Clean old version if exists
# if [ -d "$target_dir" ]; then
# rm -rf "$target_dir"
# fi
# mkdir -p "$target_dir"
# # Move files # # # 3. Extract contents
# cp -r "$temp_dir"/* "$target_dir"/ # # # -y: assume yes on all queries
# # # -o: output directory (no space after -o)
# # 7z x "$archive" -o"$temp_dir" -y > /dev/null
# # Cleanup temp # # # 4. FILTERING LOGIC (The "Server" optimization)
# rm -rf "$temp_dir" # # echo "Cleaning up unnecessary server files..."
echo "✅ Installed to: $target_dir"
done
- name: Verify Installation # # # Remove heavy textures and previews (recursive)
run: | # # find "$temp_dir" -type f \( -name "*.png" -o -name "*.jpg" -o -name "*.jpeg" -o -name "*.dds" -o -name "*.kn5" -o -name "*.bmp" \) -delete
echo "📁Final Server Directory Structure:"
# Show directory tree 3 levels deep to verify structure without spamming files # # # Remove the 'physics/csp' folder if standard physics are preferred (Optional - comment out if needed)
find ./server-data -maxdepth 3 -not -path '*/.*' # # # rm -rf "$temp_dir/physics/csp"
# # # 5. Move to final Server Directory
# # target_dir="$DEST_ROOT/$car_name"
# # # Clean old version if exists
# # if [ -d "$target_dir" ]; then
# # rm -rf "$target_dir"
# # fi
# # mkdir -p "$target_dir"
# # # Move files
# # cp -r "$temp_dir"/* "$target_dir"/
# # # Cleanup temp
# # rm -rf "$temp_dir"
# echo "✅ Installed to: $target_dir"
# done
# - name: Verify Installation
# run: |
# echo "📁Final Server Directory Structure:"
# # Show directory tree 3 levels deep to verify structure without spamming files
# find ./server-data -maxdepth 3 -not -path '*/.*'