Skip to content

Commit 1dd7bce

Browse files
fix: completely remove all artifact optimization that was corrupting files
Removed ALL file modification logic from the CI workflow: - No more source map deletion - No more file permissions changes - No more backups or temporary directories - No more find commands that could corrupt files The workflow now only verifies the build without touching any files. This should resolve the persistent file truncation issue.
1 parent 1f9f3d1 commit 1dd7bce

1 file changed

Lines changed: 4 additions & 45 deletions

File tree

.github/workflows/ci.yml

Lines changed: 4 additions & 45 deletions
Original file line numberDiff line numberDiff line change
@@ -136,9 +136,9 @@ jobs:
136136
fi
137137
done
138138
139-
- name: Check artifact size
139+
- name: Verify build artifacts
140140
run: |
141-
echo "🔍 Analyzing artifact size and structure..."
141+
echo "🔍 Verifying build artifacts..."
142142
du -sh dist/
143143
144144
echo "📊 Largest files in artifact:"
@@ -147,53 +147,12 @@ jobs:
147147
echo "📦 File count by type:"
148148
find dist/ -type f | sed 's/.*\.//' | sort | uniq -c | sort -nr
149149
150-
echo "🔧 Preparing artifact for upload..."
151-
152-
# Create backup of original files
153-
mkdir -p dist-backup
154-
cp -r dist/* dist-backup/
155-
156-
# Check total artifact size and warn if too large
150+
# Check total artifact size
157151
TOTAL_SIZE=$(du -sb dist/ | cut -f1)
158152
TOTAL_SIZE_MB=$((TOTAL_SIZE / 1024 / 1024))
159153
echo "📏 Total artifact size: ${TOTAL_SIZE_MB}MB"
160154
161-
# Always apply optimizations to prevent buffer overflow
162-
echo "🔧 Applying artifact optimizations to prevent buffer overflow..."
163-
164-
# Remove source maps completely to reduce size
165-
find dist/ -name "*.map" -delete
166-
echo "✅ Removed source maps"
167-
168-
# DISABLED: Don't split files as it breaks module loading
169-
echo "🔧 Skipping aggressive optimizations (preserving file integrity)"
170-
171-
# DISABLED: Don't remove large files as it breaks the app
172-
# The main bundle needs to be preserved intact
173-
echo "✅ Skipping large file removal (preserving main bundle)"
174-
175-
# DISABLED: Don't use sed on minified JS as it can corrupt the code
176-
echo "✅ Skipping JS comment removal (files already minified)"
177-
178-
# Remove any temporary or cache files
179-
find dist/ -name "*.tmp" -o -name "*.cache" -o -name "*.log" -delete
180-
echo "✅ Removed temporary files"
181-
182-
# Ensure proper file permissions
183-
chmod -R 755 dist/
184-
echo "✅ Set proper file permissions"
185-
186-
OPTIMIZED_SIZE=$(du -sb dist/ | cut -f1)
187-
OPTIMIZED_SIZE_MB=$((OPTIMIZED_SIZE / 1024 / 1024))
188-
echo "📊 Optimized size: ${OPTIMIZED_SIZE_MB}MB (reduced from ${TOTAL_SIZE_MB}MB)"
189-
190-
if [ $OPTIMIZED_SIZE_MB -gt 200 ]; then
191-
echo "⚠️ Warning: Artifact size is still large (${OPTIMIZED_SIZE_MB}MB), may cause upload issues"
192-
else
193-
echo "✅ Artifact size is acceptable for upload"
194-
fi
195-
196-
echo "✅ Artifact preparation completed"
155+
echo "✅ Build artifacts verified - no modifications applied"
197156
198157
# ✅ Upload complete artifact without modifications
199158
- name: ⚡ Upload Pages artifact

0 commit comments

Comments
 (0)