Skip to content

Commit b2d38ae

Browse files
committed
Merge branch 'dev' into polish/vol2-final-polish-continued
2 parents 25d243b + 149a37a commit b2d38ae

101 files changed

Lines changed: 3751 additions & 1870 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.github/workflows/book-build-container.yml

Lines changed: 57 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,13 +61,15 @@ on:
6161
default: true
6262
type: boolean
6363
build_target:
64-
description: '📦 Build target (vol1, vol2, all)'
64+
description: '📦 Build target (vol1, vol2, vol3, vol4, all)'
6565
required: false
6666
type: choice
6767
default: 'all'
6868
options:
6969
- vol1
7070
- vol2
71+
- vol3
72+
- vol4
7173
- all
7274
target:
7375
description: 'Target branch (dev/main)'
@@ -289,6 +291,60 @@ jobs:
289291
artifact_name: ${{ inputs.target }}-epub-vol2-linux
290292
output_dir: _build/epub-vol2
291293
# =================================================================
294+
# Volume III builds (Linux)
295+
# =================================================================
296+
- platform: linux
297+
platform_name: Linux
298+
platform_emoji: '🐧'
299+
runner: ubuntu-latest
300+
format_name: HTML
301+
format_emoji: '📄'
302+
volume: vol3
303+
config: _quarto-html-vol3.yml
304+
render_target: html
305+
enabled: ${{ inputs.build_linux && inputs.build_html && (inputs.build_target == 'vol3' || inputs.build_target == 'all') }}
306+
artifact_name: ${{ inputs.target }}-html-vol3-linux
307+
output_dir: _build/html-vol3
308+
# =================================================================
309+
# Volume IV builds (Linux)
310+
# =================================================================
311+
- platform: linux
312+
platform_name: Linux
313+
platform_emoji: '🐧'
314+
runner: ubuntu-latest
315+
format_name: HTML
316+
format_emoji: '📄'
317+
volume: vol4
318+
config: _quarto-html-vol4.yml
319+
render_target: html
320+
enabled: ${{ inputs.build_linux && inputs.build_html && (inputs.build_target == 'vol4' || inputs.build_target == 'all') }}
321+
artifact_name: ${{ inputs.target }}-html-vol4-linux
322+
output_dir: _build/html-vol4
323+
- platform: linux
324+
platform_name: Linux
325+
platform_emoji: '🐧'
326+
runner: ubuntu-latest
327+
format_name: PDF
328+
format_emoji: '📑'
329+
volume: vol4
330+
config: _quarto-pdf-vol4.yml
331+
render_target: titlepage-pdf
332+
enabled: ${{ inputs.build_linux && inputs.build_pdf && (inputs.build_target == 'vol4' || inputs.build_target == 'all') }}
333+
artifact_name: ${{ inputs.target }}-pdf-vol4-linux
334+
output_dir: _build/pdf-vol4
335+
- platform: linux
336+
platform_name: Linux
337+
platform_emoji: '🐧'
338+
runner: ubuntu-latest
339+
format_name: EPUB
340+
format_emoji: '📚'
341+
volume: vol4
342+
config: _quarto-epub-vol4.yml
343+
render_target: epub
344+
enabled: ${{ inputs.build_linux && inputs.build_epub && (inputs.build_target == 'vol4' || inputs.build_target == 'all') }}
345+
artifact_name: ${{ inputs.target }}-epub-vol4-linux
346+
output_dir: _build/epub-vol4
347+
# =================================================================
292348
# Volume I builds (Windows)
293349
# =================================================================
294350
- platform: windows

.github/workflows/book-validate-dev.yml

Lines changed: 62 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,18 @@ on:
6868
options:
6969
- dev
7070
- main
71+
# Target selection
72+
build_target:
73+
description: '📦 Build target (vol1, vol2, vol3, vol4, all)'
74+
required: true
75+
default: 'all'
76+
type: choice
77+
options:
78+
- all
79+
- vol1
80+
- vol2
81+
- vol3
82+
- vol4
7183
# Format & OS selection
7284
build_formats:
7385
description: '📦 Build formats (all, html, pdf, epub)'
@@ -191,39 +203,69 @@ jobs:
191203
build_epub: ${{ steps.config.outputs.build_epub }}
192204
build_linux: ${{ steps.config.outputs.build_linux }}
193205
build_windows: ${{ steps.config.outputs.build_windows }}
206+
build_target: ${{ steps.config.outputs.build_target }}
194207
container_registry: ${{ steps.config.outputs.container_registry }}
195208
container_tag: ${{ steps.config.outputs.container_tag }}
196209
target: ${{ steps.config.outputs.target }}
197210

198211
steps:
212+
- name: 📥 Checkout repository
213+
uses: actions/checkout@v6
214+
with:
215+
fetch-depth: 2
216+
199217
- name: 🎯 Determine build configuration
200218
id: config
201219
run: |
202220
echo "🎯 === BUILD CONFIGURATION ==="
203221
204222
# Determine what to build based on inputs (individual format flags)
205-
if [ "${{ github.event_name }}" = "push" ]; then
206-
# Auto-trigger: build Linux only. Windows validate-dev is temporarily
207-
# disabled on push — the Windows container itself is still built by
208-
# infra-container-windows.yml on its own schedule/path triggers.
209-
# Re-enable by flipping BUILD_WINDOWS back to "true" below.
223+
if [ "${{ github.event_name }}" = "push" ] || [ "${{ github.event_name }}" = "pull_request" ]; then
210224
BUILD_HTML="true"
211225
BUILD_PDF="true"
212226
BUILD_EPUB="true"
213227
BUILD_LINUX="true"
214228
BUILD_WINDOWS="false"
215-
TARGET="dev" # For push events, always target dev
216-
echo "📊 Trigger: Automatic (dev branch push)"
217-
echo "📊 HTML: $BUILD_HTML (mandatory)"
218-
echo "📊 PDF: $BUILD_PDF (mandatory)"
219-
echo "📊 EPUB: $BUILD_EPUB (mandatory)"
220-
echo "📊 Linux: $BUILD_LINUX (mandatory)"
221-
echo "📊 Windows: $BUILD_WINDOWS (temporarily disabled on dev push)"
222-
echo "📊 Method: container-only"
223-
echo "📊 Target: $TARGET"
229+
TARGET="dev"
230+
231+
# Selective auto-detection of modified volume paths
232+
CHANGED_FILES=$(git diff --name-only HEAD~1 HEAD 2>/dev/null || echo "")
233+
echo "📝 Changed files: $CHANGED_FILES"
234+
235+
HAS_VOL1=false
236+
HAS_VOL2=false
237+
HAS_VOL3=false
238+
HAS_VOL4=false
239+
HAS_SHARED=false
240+
241+
while IFS= read -r file; do
242+
[ -z "$file" ] && continue
243+
if [[ "$file" =~ ^books/vol1/ ]]; then HAS_VOL1=true; fi
244+
if [[ "$file" =~ ^books/vol2/ ]]; then HAS_VOL2=true; fi
245+
if [[ "$file" =~ ^books/vol3/ ]]; then HAS_VOL3=true; fi
246+
if [[ "$file" =~ ^books/vol4/ ]]; then HAS_VOL4=true; fi
247+
if [[ "$file" =~ ^publishing/ || "$file" =~ ^shared/ || "$file" =~ ^\.github/ ]]; then HAS_SHARED=true; fi
248+
done <<< "$CHANGED_FILES"
249+
250+
if [ "$HAS_SHARED" = true ]; then
251+
BUILD_TARGET="all"
252+
elif [ "$HAS_VOL1" = true ] && [ "$HAS_VOL2" = false ] && [ "$HAS_VOL3" = false ] && [ "$HAS_VOL4" = false ]; then
253+
BUILD_TARGET="vol1"
254+
elif [ "$HAS_VOL2" = true ] && [ "$HAS_VOL1" = false ] && [ "$HAS_VOL3" = false ] && [ "$HAS_VOL4" = false ]; then
255+
BUILD_TARGET="vol2"
256+
elif [ "$HAS_VOL3" = true ] && [ "$HAS_VOL1" = false ] && [ "$HAS_VOL2" = false ] && [ "$HAS_VOL4" = false ]; then
257+
BUILD_TARGET="vol3"
258+
elif [ "$HAS_VOL4" = true ] && [ "$HAS_VOL1" = false ] && [ "$HAS_VOL2" = false ] && [ "$HAS_VOL3" = false ]; then
259+
BUILD_TARGET="vol4"
260+
else
261+
BUILD_TARGET="all"
262+
fi
263+
264+
echo "📊 Trigger: Automatic ($BUILD_TARGET detected)"
224265
else
225266
# Manual trigger: respect choices
226-
echo "📊 Trigger: Manual workflow dispatch"
267+
BUILD_TARGET="${{ inputs.build_target || 'all' }}"
268+
echo "📊 Trigger: Manual workflow dispatch ($BUILD_TARGET)"
227269
BUILD_HTML="false"
228270
if [[ "${{ inputs.build_formats }}" == "all" || "${{ inputs.build_formats }}" == "html" ]]; then
229271
BUILD_HTML="true"
@@ -247,28 +289,25 @@ jobs:
247289
fi
248290
249291
TARGET="${{ inputs.target }}"
250-
251-
echo "📊 Formats: ${{ inputs.build_formats }} (HTML: $BUILD_HTML, PDF: $BUILD_PDF)"
252-
echo "📊 OS: ${{ inputs.build_os }} (Linux: $BUILD_LINUX, Windows: $BUILD_WINDOWS)"
253-
echo "📊 Method: container-only"
254-
echo "📊 Target: $TARGET"
255292
fi
256293
257294
# Container configuration
258295
CONTAINER_REGISTRY="${{ inputs.container_registry || 'ghcr.io' }}"
259296
CONTAINER_TAG="${{ inputs.container_tag || 'latest' }}"
260297
261298
echo "📊 Final Configuration:"
299+
echo " Target Volume: $BUILD_TARGET"
262300
echo " HTML: $BUILD_HTML"
263301
echo " PDF: $BUILD_PDF"
302+
echo " EPUB: $BUILD_EPUB"
264303
echo " Linux: $BUILD_LINUX"
265304
echo " Windows: $BUILD_WINDOWS"
266-
echo " Method: container"
267305
echo " Registry: $CONTAINER_REGISTRY"
268306
echo " Tag: $CONTAINER_TAG"
269307
echo " Target: $TARGET"
270308
271-
# Set outputs (individual format flags for matrix-driven approach)
309+
# Set outputs
310+
echo "build_target=$BUILD_TARGET" >> $GITHUB_OUTPUT
272311
echo "build_html=$BUILD_HTML" >> $GITHUB_OUTPUT
273312
echo "build_pdf=$BUILD_PDF" >> $GITHUB_OUTPUT
274313
echo "build_epub=$BUILD_EPUB" >> $GITHUB_OUTPUT
@@ -278,7 +317,6 @@ jobs:
278317
echo "container_tag=$CONTAINER_TAG" >> $GITHUB_OUTPUT
279318
echo "target=$TARGET" >> $GITHUB_OUTPUT
280319
281-
282320
# Step 4: Matrix-driven build calls (clean and simple!)
283321
build-container:
284322
name: '🐳 Container Build Matrix'
@@ -293,7 +331,7 @@ jobs:
293331
build_html: ${{ needs.build-config.outputs.build_html == 'true' }}
294332
build_pdf: ${{ needs.build-config.outputs.build_pdf == 'true' }}
295333
build_epub: ${{ needs.build-config.outputs.build_epub == 'true' }}
296-
build_target: all
334+
build_target: ${{ needs.build-config.outputs.build_target }}
297335
target: ${{ needs.build-config.outputs.target }}
298336
container_registry: ${{ needs.build-config.outputs.container_registry }}
299337
container_tag: ${{ needs.build-config.outputs.container_tag }}

.github/workflows/vol3-validate-dev.yml

Lines changed: 0 additions & 94 deletions
This file was deleted.

0 commit comments

Comments
 (0)