chore: import upstream snapshot with attribution

This commit is contained in:
wehub-resource-sync
2026-07-13 13:05:52 +08:00
commit d436a5e4ff
254 changed files with 73714 additions and 0 deletions
+79
View File
@@ -0,0 +1,79 @@
name: check
on:
push:
branches: [main]
pull_request:
workflow_dispatch:
jobs:
lint-and-test:
name: lint and test
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: '3.12'
- name: Install test extras
run: python3 -m pip install Pygments
- name: Lint templates and check token sync
run: python3 scripts/build.py --check
- name: Check generated Codex plugin metadata
run: python3 scripts/build_metadata.py --check
- name: Run test suite
run: python3 scripts/tests/test_build.py
- name: Build and audit skill package
run: bash scripts/package-skill.sh /tmp/kami-ci.zip
verify-render:
name: render and verify
runs-on: ubuntu-latest
needs: lint-and-test
steps:
- uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: '3.12'
- name: Install WeasyPrint system libs and CJK fallback fonts
# libcairo2 / libpango / libharfbuzz are required by WeasyPrint at
# runtime; fonts-noto-cjk provides a serif CJK fallback so the Chinese
# templates render with embedded glyphs even though TsangerJinKai02 is
# commercial and not shipped in CI. The verify step accepts Noto as a
# recognized fallback (see scripts/build.py fallback_present).
run: |
sudo apt-get update
sudo apt-get install -y --no-install-recommends \
libcairo2 libpango-1.0-0 libpangoft2-1.0-0 libharfbuzz0b \
fonts-noto-cjk fonts-noto-cjk-extra
- name: Install Python deps
run: python3 -m pip install weasyprint pypdf Pygments
- name: Verify strict page-count targets
# Only the six hard-invariant templates (resume == 2, one-pager == 1
# across CN/EN/KO) run in CI. The KO pair also exercises the Korean
# render path on Linux (fonts-noto-cjk supplies the glyphs). The
# long-doc / portfolio / slides ceilings are soft and checked visually.
# KAMI_ALLOW_FALLBACK_ONLY=1: CI does not ship commercial fonts
# (TsangerJinKai02, Charter). Treat fallback-only embedding as a
# warning instead of a failure so CI can still gate page counts.
env:
KAMI_ALLOW_FALLBACK_ONLY: '1'
run: |
python3 scripts/build.py --verify one-pager
python3 scripts/build.py --verify one-pager-en
python3 scripts/build.py --verify one-pager-ko
python3 scripts/build.py --verify resume
python3 scripts/build.py --verify resume-en
python3 scripts/build.py --verify resume-ko
+64
View File
@@ -0,0 +1,64 @@
name: release
on:
push:
tags: ['V*']
workflow_dispatch:
inputs:
tag:
description: 'Tag to attach kami.zip to (e.g. V1.4.1)'
required: true
jobs:
attach-archive:
name: build kami.zip and attach to release
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- uses: actions/checkout@v4
with:
ref: ${{ github.event.inputs.tag || github.ref }}
- name: Resolve tag name
id: tag
run: |
if [[ "${{ github.event_name }}" == "workflow_dispatch" ]]; then
TAG="${{ github.event.inputs.tag }}"
else
TAG="${GITHUB_REF#refs/tags/}"
fi
echo "name=$TAG" >> "$GITHUB_OUTPUT"
echo "Resolved tag: $TAG"
- name: Build kami.zip
run: |
bash scripts/package-skill.sh dist/kami.zip
ls -lah dist/kami.zip
- name: Ensure release exists, then attach archive
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
TAG: ${{ steps.tag.outputs.name }}
run: |
if ! gh release view "$TAG" >/dev/null 2>&1; then
echo "Release $TAG does not exist, creating placeholder"
gh release create "$TAG" --title "$TAG" --notes "Release notes pending. Edit on GitHub."
fi
gh release upload "$TAG" dist/kami.zip --clobber
echo "OK: kami.zip attached to release $TAG"
- name: Add release reactions
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
TAG: ${{ steps.tag.outputs.name }}
run: |
# Match the house style every release carries: one of each positive
# reaction. Idempotent (re-running adds nothing) and non-fatal so a
# reaction hiccup never fails an otherwise-good release.
rid="$(gh api "repos/${{ github.repository }}/releases/tags/$TAG" --jq .id)"
for r in +1 eyes heart hooray laugh rocket; do
gh api -X POST "repos/${{ github.repository }}/releases/$rid/reactions" \
-f content="$r" --jq .content || echo "skip reaction $r"
done
echo "OK: reactions ensured on release $TAG"