How hk-modding/modlinks works
Project type and purpose
• Type: Open-source data repository for mod metadata (no custom application code).
• Purpose:
– Centralize “ModLinks.xml” and “ApiLinks.xml” files that list publicly available mods.
– Validate incoming changes via CI workflows.
– Serve raw XML manifests to mod installers or other downstream tools.
Main components
A. GitHub Repository
– Data Store:
• ModLinks.xml
• ApiLinks.xml
– Schema Folder:
• Schemas/ModLinks.xml (XSD)
• Schemas/ApiLinks.xml (XSD)
– License & Documentation: LICENSE, ReadMe.md
B. CI / Validation Pipeline (GitHub Actions)
– XmlValidation.yml: Ensures XML conforms to XSD.
– VerifySha.yml: Checks SHA256 attributes in links.
– Purge.yml: Removes stale or invalid entries automatically.
C. External Actors
– Contributors: Fork → Branch → Pull Request → CI validation → Merge
– Consumers (Mod Installers or Scripts):
• Fetch raw XML via GitHub “raw” URLs
• Parse and install mods based on manifest entries
Relationships and data flows
1. Contributor submits changes via Pull Request
→ triggers GitHub Actions workflows
→ XmlValidation & VerifySha run
→ if all checks pass, merge to main
2. Purge workflow runs on schedule or on demand
→ updates the XML in-repo to remove outdated entries
3. Consumers poll or fetch raw XML from GitHub
← reads up-to-date mod lists
4. Schema definitions drive the XMLValidation step
← XSD files ensure manifest consistency
Architectural patterns & principles
– Event-driven CI: GitHub events (push, PR) trigger automated validation.
– Single source of truth: XML files in the repo are the canonical data store.
– Separation of concerns:
• Data (XML) vs. Schema (XSD) vs. Validation (CI) vs. Consumption (installers).
– Extensibility: Contributors can add new mods by editing XML; schemas enforce structure.
Technologies & frameworks
– Git & GitHub (repo hosting, forks, PRs)
– GitHub Actions (YAML workflows)
– XML & XSD (manifest definition & schema validation)
– SHA256 (link integrity)