Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion .dockerignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ node_modules
.svelte-kit
.env*
*.md
!patch-notes/**
.git
.gitignore
build
build
150 changes: 150 additions & 0 deletions .github/workflows/patch-notes.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,150 @@
name: Patch notes

on:
push:
branches:
- main
paths:
- "patch-notes/**/*.md"
- "patch-notes/*.md"

permissions:
contents: write

jobs:
publish:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v7
with:
fetch-depth: 2

- name: Publish new / changed notes
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
DISCORD_PATCH_WEBHOOK_URL: ${{ secrets.DISCORD_PATCH_WEBHOOK_URL }}
SITE_ORIGIN: https://lightkeepers.moe
run: |
python3 <<'PY'
import json, os, re, subprocess, urllib.request
from pathlib import Path

root = Path("patch-notes")
note_re = re.compile(r"^\d{4}-\d{2}-\d{2}-.+\.md$", re.I)

def changed_note_files() -> list[Path]:
before = subprocess.check_output(
["git", "rev-parse", "HEAD^"], text=True
).strip()
out = subprocess.check_output(
["git", "diff", "--name-only", "--diff-filter=AM", before, "HEAD", "--", "patch-notes"],
text=True,
)
files = []
for line in out.splitlines():
p = Path(line.strip())
if p.name == "README.md":
continue
if note_re.match(p.name):
files.append(p)
return files

def parse(path: Path) -> dict:
text = path.read_text(encoding="utf-8").lstrip("\ufeff").replace("\r\n", "\n")
m = re.match(r"^---\n([\s\S]*?)\n---\n([\s\S]*)$", text)
if not m:
raise SystemExit(f"{path}: missing frontmatter")
fields = {}
for line in m.group(1).split("\n"):
if ":" not in line:
continue
k, v = line.split(":", 1)
fields[k.strip()] = v.strip().strip("\"'")
for key in ("title", "date", "summary"):
if not fields.get(key):
raise SystemExit(f"{path}: missing {key}")
slug = path.stem
return {
"slug": slug,
"title": fields["title"],
"date": fields["date"],
"summary": fields["summary"],
"body": m.group(2).strip(),
}

site = os.environ["SITE_ORIGIN"].rstrip("/")
webhook = os.environ.get("DISCORD_PATCH_WEBHOOK_URL", "").strip()
files = changed_note_files()
if not files:
print("No dated patch-note files changed.")
raise SystemExit(0)

for path in sorted(files):
note = parse(path)
tag = f"patch-notes/{note['slug']}"
site_url = f"{site}/patch-notes/{note['slug']}"
notes = f"{note['summary']}\n\n{note['body']}\n\n---\nSite: {site_url}"

existing = subprocess.run(
["gh", "release", "view", tag],
capture_output=True,
text=True,
)
if existing.returncode == 0:
print(f"Updating release {tag}")
subprocess.check_call(
[
"gh",
"release",
"edit",
tag,
"--title",
note["title"],
"--notes",
notes,
]
)
else:
print(f"Creating release {tag}")
subprocess.check_call(
[
"gh",
"release",
"create",
tag,
"--title",
note["title"],
"--notes",
notes,
"--target",
os.environ.get("GITHUB_SHA", "main"),
]
)

if webhook:
embed = {
"title": note["title"],
"description": note["summary"],
"url": site_url,
"color": 0xC9A227,
"fields": [
{"name": "Date", "value": note["date"], "inline": True},
{
"name": "Links",
"value": f"[Site]({site_url}) · [GitHub]({os.environ.get('GITHUB_SERVER_URL', 'https://github.com')}/{os.environ.get('GITHUB_REPOSITORY', '')}/releases/tag/{tag})",
"inline": False,
},
],
}
req = urllib.request.Request(
webhook,
data=json.dumps({"embeds": [embed]}).encode(),
headers={"Content-Type": "application/json"},
method="POST",
)
with urllib.request.urlopen(req) as resp:
print(f"Discord webhook status {resp.status} for {tag}")
else:
print("DISCORD_PATCH_WEBHOOK_URL unset — skipped Discord post")
PY
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
"check:watch": "svelte-kit sync && svelte-check --tsconfig ./tsconfig.json --watch",
"format": "prettier --write .",
"format:check": "prettier --check .",
"test:unit": "tsx --test src/lib/tierlist.test.ts src/lib/server/cache.test.ts src/lib/server/request-validation.test.ts src/lib/character-teams.test.ts src/lib/character-builds.test.ts src/lib/investment-teams.test.ts src/lib/solver.test.ts src/lib/roster-snapshot.test.ts src/lib/upgrade-priority.test.ts src/lib/query-state.test.ts src/lib/nav-history.test.ts src/lib/utils.traveler.test.ts src/lib/traveler-kits.test.ts src/lib/crimson-witch.test.ts",
"test:unit": "tsx --test src/lib/tierlist.test.ts src/lib/server/cache.test.ts src/lib/server/request-validation.test.ts src/lib/character-teams.test.ts src/lib/character-builds.test.ts src/lib/investment-teams.test.ts src/lib/solver.test.ts src/lib/roster-snapshot.test.ts src/lib/upgrade-priority.test.ts src/lib/query-state.test.ts src/lib/nav-history.test.ts src/lib/utils.traveler.test.ts src/lib/traveler-kits.test.ts src/lib/crimson-witch.test.ts src/lib/patch-notes.test.ts src/lib/patch-notes-seen.test.ts",
"test": "pnpm test:unit && pnpm exec playwright test",
"sync:schedules": "tsx scripts/workflows/sync-schedules.ts",
"sync:character-assets": "tsx scripts/workflows/sync-character-assets.ts",
Expand Down
15 changes: 15 additions & 0 deletions patch-notes/2026-08-10-roster-hotfix-and-patch-notes.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
---
title: Roster sync hotfix & patch notes
date: 2026-08-10
summary: Fixed cloud roster sync for logged-in accounts — resave your roster if it didn’t stick. Also: this Patch notes feed.
---

## Roster sync hotfix

Roster upload schema changed to fit requirements.

**What to do:** open Settings → Roster and change one character once so the cloud copy catches up.

## Patch notes

There’s now a Patch notes page on the site (as well as GitHub and Discord). You’ll get a short popup when something new ships.
21 changes: 21 additions & 0 deletions patch-notes/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
# Patch notes

Markdown in this folder is the **source of truth** for Lightkeepers updates.

## Authoring

1. Add `YYYY-MM-DD-short-slug.md` (see existing files).
2. Frontmatter:

```yaml
---
title: Short title
date: 2026-08-10
summary: One-line blurb for the index, Discord embed, and GitHub Release.
---
```

3. Body is GitHub-flavored markdown (headings, lists, links, bold/italic).
4. Merge to `main`. The **Patch notes** workflow creates a GitHub Release and posts to Discord when files here change (requires `DISCORD_PATCH_WEBHOOK_URL` secret).

The website reads these files at `/patch-notes`.
Loading