This commit is contained in:
2026-02-08 03:02:33 +01:00
parent 35b99553ef
commit 1ba99c19fc

View File

@@ -17,116 +17,105 @@ jobs:
runs-on: ubuntu-latest runs-on: ubuntu-latest
steps: steps:
- name: Pre-initialize Repository with SHA-256 - name: Pre-initialize Repository with SHA-1
run: | run: |
mkdir -p ${{ github.workspace }} mkdir -p ${{ github.workspace }}
git init --object-format=sha1 ${{ github.workspace }} git init --object-format=sha1 ${{ github.workspace }}
- name: Manual Checkout (SHA-1 Force) # - name: Manual Checkout (SHA-1 Force)
env: # env:
# This token is automatically provided by Gitea/GitHub Actions # # This token is automatically provided by Gitea/GitHub Actions
TOKEN: ${{ secrets.GITHUB_TOKEN }} # TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
# 1. Clean workspace explicitly to be safe
rm -rf ./* ./.git
# 2. Initialize specifically with SHA-1
git init --object-format=sha1
# 3. Add remote with authentication embedded
# Use the environment variable to keep the log clean
git remote add origin "https://$TOKEN@git.dapa.hu/dapa/assetto.git"
# 4. Fetch the specific branch (depth 1 for speed)
git fetch --depth=1 origin master
# 5. Checkout the branch
git checkout master
# 6. Initialize LFS and pull files
# Note: If this fails, it confirms the files are missing from the server (see below)
git lfs install
git lfs pull
- name: Manual LFS Fetch with Debugging
env:
GIT_TRACE: 1
GIT_TRANSFER_TRACE: 1
GIT_CURL_VERBOSE: 1
run: |
git lfs install
# Try to pull the specific missing files to see the real error message
git lfs fetch origin master
git lfs checkout
# steps:
# - name: Checkout Master Branch (LFS)
# uses: actions/checkout@v4
# with:
# ref: master
# lfs: true
# fetch-depth: 0
# - name: Install 7-Zip
# run: | # run: |
# sudo apt-get update # # 1. Clean workspace explicitly to be safe
# sudo apt-get install -y p7zip-full # rm -rf ./* ./.git
# - name: Process Archives # # 2. Initialize specifically with SHA-1
# run: | # git init --object-format=sha1
# # 1. Define Paths
# SOURCE_ROOT="./cars"
# # This is where the server expects the files
# DEST_ROOT="./server-data/content/cars"
# mkdir -p "$DEST_ROOT"
# echo "🔍 Searching for archives in $SOURCE_ROOT..." # # 3. Add remote with authentication embedded
# # Use the environment variable to keep the log clean
# git remote add origin "https://$TOKEN@git.dapa.hu/dapa/assetto.git"
# # 2. Find all archives recursively (zip, 7z, rar) # # 4. Fetch the specific branch (depth 1 for speed)
# find "$SOURCE_ROOT" -type f \( -name "*.zip" -o -name "*.7z" -o -name "*.rar" \) | while read archive; do # git fetch --depth=1 origin master
# # Get the filename without extension (e.g., "cars/groupA/my_car.zip" -> "my_car") # # 5. Checkout the branch
# filename=$(basename -- "$archive") # git checkout master
# car_name="${filename%.*}"
# echo "--------------------------------------" # # 6. Initialize LFS and pull files
# echo "Processing: $car_name" # # Note: If this fails, it confirms the files are missing from the server (see below)
# git lfs install
# git lfs pull
# # # Create a temp directory for extraction - name: Checkout Master Branch (LFS)
# # temp_dir=$(mktemp -d) uses: actions/checkout@v4
with:
ref: master
lfs: true
fetch-depth: 0
clean: false
# # # 3. Extract contents - name: Install 7-Zip
# # # -y: assume yes on all queries run: |
# # # -o: output directory (no space after -o) sudo apt-get update
# # 7z x "$archive" -o"$temp_dir" -y > /dev/null sudo apt-get install -y p7zip-full
# # # 4. FILTERING LOGIC (The "Server" optimization) - name: Process Archives
# # echo "Cleaning up unnecessary server files..." run: |
# 1. Define Paths
SOURCE_ROOT="./cars"
# This is where the server expects the files
DEST_ROOT="./server-data/content/cars"
mkdir -p "$DEST_ROOT"
# # # Remove heavy textures and previews (recursive) echo "Searching for archives in $SOURCE_ROOT..."
# # 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) # 2. Find all archives recursively (zip, 7z, rar)
# # # rm -rf "$temp_dir/physics/csp" find "$SOURCE_ROOT" -type f \( -name "*.zip" -o -name "*.7z" -o -name "*.rar" \) | while read archive; do
# # # 5. Move to final Server Directory # Get the filename without extension (e.g., "cars/groupA/my_car.zip" -> "my_car")
# # target_dir="$DEST_ROOT/$car_name" filename=$(basename -- "$archive")
car_name="${filename%.*}"
# # # Clean old version if exists echo "--------------------------------------"
# # if [ -d "$target_dir" ]; then echo "Processing: $car_name"
# # rm -rf "$target_dir"
# # fi
# # mkdir -p "$target_dir"
# # # Move files # # Create a temp directory for extraction
# # cp -r "$temp_dir"/* "$target_dir"/ # temp_dir=$(mktemp -d)
# # # Cleanup temp # # 3. Extract contents
# # rm -rf "$temp_dir" # # -y: assume yes on all queries
# # -o: output directory (no space after -o)
# 7z x "$archive" -o"$temp_dir" -y > /dev/null
# echo "✅ Installed to: $target_dir" # # 4. FILTERING LOGIC (The "Server" optimization)
# done # echo "Cleaning up unnecessary server files..."
# # Remove heavy textures and previews (recursive)
# 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)
# # 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 # - name: Verify Installation
# run: | # run: |