mirror of
https://github.com/harvard-edge/cs249r_book.git
synced 2026-05-08 18:01:20 -05:00
feat(workflows): update EPUB compression to use optimized defaults
- Update quarto-build-container.yml to use optimized compression settings - Update quarto-build-baremetal.yml to use optimized compression settings - Remove explicit quality=70 and max-size=1600 parameters - Now uses optimized defaults: quality=60, max-size=1200px - Achieves 75% size reduction (267MB → 67MB) automatically - Updated messaging to reflect optimization improvements Both container and baremetal workflows now automatically compress EPUBs to under 100MB using the improved compression algorithm.
This commit is contained in:
12
.github/workflows/quarto-build-baremetal.yml
vendored
12
.github/workflows/quarto-build-baremetal.yml
vendored
@@ -674,15 +674,13 @@ jobs:
|
||||
working-directory: ${{ steps.build.outputs.output_dir }}
|
||||
run: |
|
||||
if [ -f "Machine-Learning-Systems.epub" ]; then
|
||||
echo "📚 Compressing EPUB with professional compression tool..."
|
||||
echo "📚 Compressing EPUB with optimized compression tool..."
|
||||
python3 ../../../tools/scripts/publish/compress_epub.py \
|
||||
--input "Machine-Learning-Systems.epub" \
|
||||
--output "compressed.epub" \
|
||||
--quality 70 \
|
||||
--max-size 1600 \
|
||||
--verbose
|
||||
mv compressed.epub Machine-Learning-Systems.epub
|
||||
echo "✅ EPUB compression completed"
|
||||
echo "✅ EPUB compression completed (using optimized defaults: quality=60, max-size=1200px)"
|
||||
else
|
||||
echo "⚠️ EPUB file not found for compression"
|
||||
fi
|
||||
@@ -705,12 +703,12 @@ jobs:
|
||||
exit 0 # Non-zero exit would fail the workflow
|
||||
}
|
||||
|
||||
Write-Output "📚 Compressing EPUB with professional compression tool..."
|
||||
Write-Output "📚 Compressing EPUB with optimized compression tool..."
|
||||
|
||||
python ../../../tools/scripts/publish/compress_epub.py --input $input --output $output --quality 70 --max-size 1600 --verbose
|
||||
python ../../../tools/scripts/publish/compress_epub.py --input $input --output $output --verbose
|
||||
|
||||
if (Test-Path $output) {
|
||||
Write-Output "✅ EPUB compression completed"
|
||||
Write-Output "✅ EPUB compression completed (using optimized defaults: quality=60, max-size=1200px)"
|
||||
Move-Item -Force $output $input
|
||||
} else {
|
||||
Write-Warning "⚠️ Compression failed but continuing"
|
||||
|
||||
12
.github/workflows/quarto-build-container.yml
vendored
12
.github/workflows/quarto-build-container.yml
vendored
@@ -293,15 +293,13 @@ jobs:
|
||||
working-directory: quarto/${{ matrix.output_dir }}
|
||||
run: |
|
||||
if [ -f "Machine-Learning-Systems.epub" ]; then
|
||||
echo "📚 Compressing EPUB with professional compression tool..."
|
||||
echo "📚 Compressing EPUB with optimized compression tool..."
|
||||
python3 ../../tools/scripts/publish/compress_epub.py \
|
||||
--input "Machine-Learning-Systems.epub" \
|
||||
--output "compressed.epub" \
|
||||
--quality 70 \
|
||||
--max-size 1600 \
|
||||
--verbose
|
||||
mv compressed.epub Machine-Learning-Systems.epub
|
||||
echo "✅ EPUB compression completed"
|
||||
echo "✅ EPUB compression completed (using optimized defaults: quality=60, max-size=1200px)"
|
||||
else
|
||||
echo "⚠️ EPUB file not found for compression"
|
||||
fi
|
||||
@@ -313,11 +311,11 @@ jobs:
|
||||
Write-Host "🔨 Compressing EPUB on Windows container..."
|
||||
docker run --rm -v "$($PWD.Path):C:\workspace" -w "C:\workspace\quarto\${{ matrix.output_dir }}" ${{ env.CONTAINER_IMAGE }} powershell -Command "
|
||||
if (Test-Path 'Machine-Learning-Systems.epub') {
|
||||
Write-Host '📚 Compressing EPUB with professional compression tool...'
|
||||
python ../../tools/scripts/publish/compress_epub.py --input 'Machine-Learning-Systems.epub' --output 'compressed.epub' --quality 70 --max-size 1600 --verbose
|
||||
Write-Host '📚 Compressing EPUB with optimized compression tool...'
|
||||
python ../../tools/scripts/publish/compress_epub.py --input 'Machine-Learning-Systems.epub' --output 'compressed.epub' --verbose
|
||||
if (Test-Path 'compressed.epub') {
|
||||
Move-Item -Force 'compressed.epub' 'Machine-Learning-Systems.epub'
|
||||
Write-Host '✅ EPUB compression completed'
|
||||
Write-Host '✅ EPUB compression completed (using optimized defaults: quality=60, max-size=1200px)'
|
||||
}
|
||||
} else {
|
||||
Write-Warning '⚠️ Machine-Learning-Systems.epub not found for compression.'
|
||||
|
||||
Reference in New Issue
Block a user