Release Management
Relevant source files
The following files were used as context for generating this wiki page:
Release Management in the WHK project encompasses the automated build, optimization, and deployment pipelines, as well as the maintenance of GitHub versioned artifacts. The system is designed to provide high-quality static assets (HTML/JS/CSS) and portable PDF versions of the educational content.
The lifecycle involves continuous integration (CI) for site deployment and specialized workflows for generating release artifacts when version tags are created. Maintenance is supported by specialized scripts to manage remote release history.
Sources: README.md:155-168, dev/Cleanup-GitHubReleases.ps1
Release Workflows
The project utilizes GitHub Actions to manage two primary release-related flows: the deployment of the static site and the generation of PDF exports for GitHub Releases.
CI/CD Pipeline
The core CI pipeline handles the construction of the static site using MkDocs and the Material for MkDocs framework. It supports multi-environment parallel builds and deploys to both GitHub Pages and Cloudflare Pages.
Sources: README.md:158-163
PDF Export and Versioned Releases
A dedicated export workflow is triggered specifically when tags matching the v* pattern are created. This process uses Puppeteer to convert rendered web pages into PDF format and LaTeX to generate detailed bookmark indices. The resulting PDF is then automatically uploaded to GitHub Releases for offline distribution.
Sources: README.md:165-168, README.md:52-53
The diagram above illustrates the automated path from a version tag to a published PDF release.
Sources: README.md:165-168
Build Optimization
Before a release is finalized, the static assets undergo a rigorous optimization process via a custom Bun-based build script (build.ts). This ensures the final release is performant and SEO-optimized.
Asset Processing
The build script performs deep optimization on three main asset types:
| Asset Type | Optimization Actions |
|---|---|
| HTML | PostHTML processing (de-duplication, reordering <head>, merging styles, minification) |
| CSS | PostCSS with Autoprefixer, cssnano compression, and sourcemap generation |
| JS | Terser deep compression (2 passes), mangling, and sourcemap generation |
Sources: build.ts:6-14, build.ts:401-411
Head Optimization Logic
The system implements a structured reordering of the HTML <head> to improve browser rendering performance during a release.
This hierarchy ensures critical rendering path elements are loaded first.
Sources: build.ts:167-224
Release Maintenance
A PowerShell utility is provided to manage the accumulation of GitHub releases, allowing for bulk cleanup based on age and tag patterns.
GitHub Release Cleanup
The tool Cleanup-GitHubReleases.ps1 allows maintainers to purge old releases that do not follow the standard versioning pattern (e.g., releases not starting with v*). It utilizes the GitHub CLI (gh) and supports parallel execution in PowerShell 7+ to increase deletion speed.
Sources: dev/Cleanup-GitHubReleases.ps1:10-45
Cleanup Process Logic
- Selection: Scans releases and filters those older than a user-defined cutoff date.
- Filtering: Explicitly excludes tags starting with
v*to protect official versions. - Execution: Performs a multi-threaded deletion of the release and its associated tag.
Sources: dev/Cleanup-GitHubReleases.ps1:31-33, dev/Cleanup-GitHubReleases.ps1:68-87
The sequence shows the interaction between the maintainer and the GitHub API during release maintenance.
Sources: dev/Cleanup-GitHubReleases.ps1:48-95
Dependency Management
Release stability is maintained through strict versioning of the underlying technology stack.
- Python Requirements: Managed via
uv, requiring Python 3.14+. - Node.js Requirements: Targeted at version 20+.
- Build Toolchain: Utilizes
Bunfor fast asset processing andPostCSS/PostHTMLfor transformation.
Sources: pyproject.toml:6-25, README.md:104-106, build.ts:1-4
The WHK Release Management system ensures that every versioned tag results in a high-quality, optimized PDF and a synchronized web deployment, supported by automated maintenance tools to keep the repository's release history organized.