Skip to content

v1.0.01

v1.0.01 #37

Workflow file for this run

name: Create Release with LFS Files
on:
release:
types: [created]
workflow_dispatch:
permissions:
contents: write
actions: read
jobs:
create-release-zips:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
fetch-depth: 0
lfs: true
# Setup Git LFS properly
- name: Setup Git LFS
run: |
git lfs install
echo "Git LFS version: $(git lfs version)"
echo "=== LFS files in repository ==="
git lfs ls-files --long
echo "=== Pulling LFS files ==="
git lfs pull
echo "=== LFS pull completed ==="
# Verify LFS files are downloaded
- name: Verify LFS files are downloaded
run: |
echo "=== Final verification ==="
# Dynamically find all video files in media/video directory
if [ -d "media/video" ]; then
video_files=$(find media/video -type f -name "*.mp4")
if [ -z "$video_files" ]; then
echo "WARNING: No .mp4 files found in media/video/"
else
echo "Found video files:"
echo "$video_files"
echo ""
has_error=false
for file in $video_files; do
if [ -f "$file" ]; then
size=$(stat -c%s "$file" 2>/dev/null || stat -f%z "$file")
echo "$file: $size bytes"
if [ "$size" -lt 10000000 ]; then # Less than 10MB
echo "ERROR: $file is too small ($size bytes) - likely still a pointer"
echo "File content:"
head -3 "$file"
has_error=true
else
echo "SUCCESS: $file downloaded correctly"
fi
fi
done
if [ "$has_error" = true ]; then
exit 1
fi
fi
else
echo "WARNING: media/video directory not found"
fi
# Create ZIP files
- name: Create ZIP files
run: |
mkdir -p zip
echo "=== Creating ZIP files ==="
# Docs ZIP
if [ -d "docs" ] && [ "$(ls -A docs)" ]; then
zip -r zip/tutorial-docs.zip docs
echo "Docs ZIP: $(du -h zip/tutorial-docs.zip | cut -f1)"
fi
# Assets ZIP
if [ -d "src" ] && [ "$(ls -A src)" ]; then
zip -r zip/tutorial-assets.zip src
echo "Assets ZIP: $(du -h zip/tutorial-assets.zip | cut -f1)"
fi
# Videos ZIP - this is critical
if [ -d "media" ] && [ "$(ls -A media)" ]; then
# Dynamically find and check all video files before zipping
if [ -d "media/video" ]; then
video_files=$(find media/video -type f -name "*.mp4")
if [ -n "$video_files" ]; then
echo "Checking video files before zipping:"
has_error=false
for video_file in $video_files; do
if [ -f "$video_file" ]; then
size=$(stat -c%s "$video_file" 2>/dev/null || stat -f%z "$video_file")
echo "$video_file: $size bytes"
if [ "$size" -lt 10000000 ]; then # Less than 10MB
echo "CRITICAL ERROR: Video file $video_file too small before zipping: $size bytes"
has_error=true
fi
fi
done
if [ "$has_error" = true ]; then
exit 1
fi
fi
fi
zip -r zip/tutorial-videos.zip media
video_zip_size=$(stat -c%s "zip/tutorial-videos.zip" 2>/dev/null || stat -f%z "zip/tutorial-videos.zip")
echo "Videos ZIP: $(du -h zip/tutorial-videos.zip | cut -f1) ($video_zip_size bytes)"
# Verify ZIP is not too small
if [ "$video_zip_size" -lt 1000000 ]; then # Less than 1MB
echo "CRITICAL ERROR: Videos ZIP too small: $video_zip_size bytes"
exit 1
fi
fi
# Complete ZIP
zip -r zip/tutorial-complete.zip . -x '*.git*' 'zip/*' '.DS_Store'
echo "Complete ZIP: $(du -h zip/tutorial-complete.zip | cut -f1)"
# Show detailed ZIP information
- name: Analyze ZIP contents
run: |
echo "=== ZIP Analysis ==="
for zip_file in zip/*.zip; do
echo "=== $(basename $zip_file) ==="
echo "Size: $(du -h $zip_file | cut -f1)"
echo "Byte size: $(stat -c%s $zip_file 2>/dev/null || stat -f%z $zip_file)"
echo "Video files in ZIP:"
unzip -l "$zip_file" | grep -E '\.(mp4|avi|mov)' || echo "No video files found"
echo "Large files (>1MB) in ZIP:"
unzip -l "$zip_file" | awk '$1 > 1048576 {print $1, $4}' | head -5
echo ""
done
# Upload to release
- name: Upload to Release
if: github.event_name == 'release'
uses: softprops/action-gh-release@v1
with:
files: zip/*.zip
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
# Upload as artifacts
- name: Upload as Artifacts
uses: actions/upload-artifact@v4
with:
name: release-zips-fixed
path: zip/*.zip