Skip to content

Commit 869c8ac

Browse files
committed
fix: use latest release assets for installers
1 parent b6da6fb commit 869c8ac

6 files changed

Lines changed: 70 additions & 34 deletions

File tree

.github/workflows/release.yml

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,12 @@ jobs:
3131
run: make test
3232
- run: make package
3333
- name: Upload waza.zip to release
34-
run: gh release upload "${{ github.event.release.tag_name }}" dist/waza.zip --clobber
34+
run: |
35+
gh release upload "${{ github.event.release.tag_name }}" \
36+
dist/waza.zip \
37+
scripts/setup-rule.sh \
38+
scripts/setup-statusline.sh \
39+
--clobber
3540
env:
3641
GH_TOKEN: ${{ github.token }}
3742
publish-npm:

README.md

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -108,6 +108,7 @@ npx skills update -g -y
108108

109109
Marketplace installs use `claude plugin update <skill>`. Claude Desktop users can replace the old skill with the latest [waza.zip](https://github.com/tw93/Waza/releases/latest/download/waza.zip).
110110
Pi users can run `pi update npm:@tw93/waza`, or `pi update --extensions` to update all installed Pi packages.
111+
To hear about new versions, watch [GitHub Releases](https://github.com/tw93/Waza/releases) for Waza.
111112

112113
## Project Context
113114

@@ -143,7 +144,7 @@ A minimal statusline for Claude Code: context window, 5-hour quota, and 7-day qu
143144
</div>
144145

145146
```bash
146-
curl -sL https://raw.githubusercontent.com/tw93/Waza/v3.27.0/scripts/setup-statusline.sh | bash
147+
curl -sL https://github.com/tw93/Waza/releases/latest/download/setup-statusline.sh | bash
147148
```
148149

149150
**Codex** has native statusline items. Add to `~/.codex/config.toml`:
@@ -166,28 +167,28 @@ Optional rule for English practice. When your prompt contains an English mistake
166167

167168
```bash
168169
# Claude Code
169-
curl -sL https://raw.githubusercontent.com/tw93/Waza/v3.27.0/scripts/setup-rule.sh | bash -s -- english claude-code
170+
curl -sL https://github.com/tw93/Waza/releases/latest/download/setup-rule.sh | bash -s -- english claude-code
170171

171172
# Codex
172-
curl -sL https://raw.githubusercontent.com/tw93/Waza/v3.27.0/scripts/setup-rule.sh | bash -s -- english codex
173+
curl -sL https://github.com/tw93/Waza/releases/latest/download/setup-rule.sh | bash -s -- english codex
173174
```
174175

175176
### Anti-Patterns
176177

177178
Optional always-on guardrails for cross-skill behaviors: stop acting before reading, no hallucinated paths, no scope creep, no unsolicited summaries. Skill-agnostic, applies in every session.
178179

179180
```bash
180-
curl -sL https://raw.githubusercontent.com/tw93/Waza/v3.27.0/scripts/setup-rule.sh | bash -s -- anti-patterns claude-code
181+
curl -sL https://github.com/tw93/Waza/releases/latest/download/setup-rule.sh | bash -s -- anti-patterns claude-code
181182
```
182183

183-
Use `codex` instead of `claude-code` for Codex. Curl URLs are pinned to the current release tag for reproducibility; swap `v3.27.0` for `main` if you want bleeding-edge scripts.
184+
Use `codex` instead of `claude-code` for Codex. Curl URLs use the latest GitHub release asset. Set `WAZA_REF=main` before the command if you want bleeding-edge scripts.
184185

185186
### Routing Hint
186187

187188
Optional pointer that tells the host to prefer Waza skills when a request matches their triggers. Useful for Codex, Pi, and other agents that do not auto-route from skill `description`. Claude Code already routes through descriptions, so this is opt-in even there.
188189

189190
```bash
190-
curl -sL https://raw.githubusercontent.com/tw93/Waza/v3.27.0/scripts/setup-rule.sh | bash -s -- waza-routing claude-code
191+
curl -sL https://github.com/tw93/Waza/releases/latest/download/setup-rule.sh | bash -s -- waza-routing claude-code
191192
```
192193

193194
Use `codex` instead of `claude-code` for Codex.

scripts/build_metadata.py

Lines changed: 21 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -194,19 +194,29 @@ def render_dispatcher(template: str, skills: list[dict]) -> str:
194194
return pattern.sub(block, template)
195195

196196

197-
# Matches both pinned (v3.24.0) and unpinned (main) install URLs so the
198-
# generator can rewrite either form to the current VERSION.
197+
# README installer entrypoints should follow the latest GitHub release asset.
198+
# The downloaded scripts themselves still default WAZA_REF to a release tag, so
199+
# users get a stable install without README churn on every version bump.
199200
README_INSTALL_URL_RE = re.compile(
200-
r"raw\.githubusercontent\.com/tw93/Waza/(?:main|v\d+\.\d+\.\d+)/scripts/"
201+
r"https://raw\.githubusercontent\.com/tw93/Waza/"
202+
r"(?:main|v\d+\.\d+\.\d+)/scripts/(setup-(?:rule|statusline)\.sh)"
203+
)
204+
README_SWAP_TAG_RE = re.compile(
205+
r"Curl URLs are pinned to the current release tag for reproducibility; "
206+
r"swap `v\d+\.\d+\.\d+` for `main` if you want bleeding-edge scripts\."
201207
)
202-
README_SWAP_TAG_RE = re.compile(r"swap `v\d+\.\d+\.\d+` for `main`")
203208
WAZA_REF_RE = re.compile(r'WAZA_REF="\$\{WAZA_REF:-(?:main|v\d+\.\d+\.\d+)\}"')
204209

205210

206211
def render_readme(current: str, version: str) -> str:
207-
pinned = f"raw.githubusercontent.com/tw93/Waza/v{version}/scripts/"
208-
current = README_INSTALL_URL_RE.sub(pinned, current)
209-
return README_SWAP_TAG_RE.sub(f"swap `v{version}` for `main`", current)
212+
current = README_INSTALL_URL_RE.sub(
213+
r"https://github.com/tw93/Waza/releases/latest/download/\1", current
214+
)
215+
return README_SWAP_TAG_RE.sub(
216+
"Curl URLs use the latest GitHub release asset. Set `WAZA_REF=main` "
217+
"before the command if you want bleeding-edge scripts.",
218+
current,
219+
)
210220

211221

212222
def render_script_ref(current: str, version: str) -> str:
@@ -284,7 +294,7 @@ def main() -> int:
284294
drift = True
285295
if readme_actual != readme_rendered:
286296
print(
287-
f"DRIFT: README.md install URLs are not pinned to v{version}.\n"
297+
"DRIFT: README.md installer URLs must use latest release assets.\n"
288298
f"Run scripts/build_metadata.py (no flags) to regenerate.",
289299
file=sys.stderr,
290300
)
@@ -322,7 +332,7 @@ def main() -> int:
322332
if drift:
323333
return 1
324334
print(f"ok: {target.relative_to(root)} matches generator")
325-
print(f"ok: README.md install URLs pinned to v{version}")
335+
print("ok: README.md install URLs use latest release assets")
326336
print(f"ok: package.json pinned to v{version}")
327337
print(f"ok: installer defaults pinned to v{version}")
328338
print(f"ok: {dispatcher_target.relative_to(root)} matches generator")
@@ -338,9 +348,9 @@ def main() -> int:
338348
print(f"ok: package.json already pinned to v{version}")
339349
if readme_actual != readme_rendered:
340350
readme.write_text(readme_rendered)
341-
print(f"wrote: README.md (pinned install URLs to v{version})")
351+
print("wrote: README.md (installer URLs use latest release assets)")
342352
else:
343-
print(f"ok: README.md install URLs already pinned to v{version}")
353+
print("ok: README.md install URLs already use latest release assets")
344354
for script, actual, rendered_script in script_pairs:
345355
if actual != rendered_script:
346356
script.write_text(rendered_script)

scripts/skill_checks.py

Lines changed: 18 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -656,7 +656,21 @@ def check_readme_install_command(root: Path):
656656
f"include {command!r}\n"
657657
f" Waza's documented agent support depends on this exact string."
658658
)
659-
print("ok: README installs nested skills, Pi package, Antigravity, and OpenCode")
659+
expected_installers = {
660+
"setup-rule": "https://github.com/tw93/Waza/releases/latest/download/setup-rule.sh",
661+
"setup-statusline": "https://github.com/tw93/Waza/releases/latest/download/setup-statusline.sh",
662+
}
663+
for label, url in expected_installers.items():
664+
if url not in text:
665+
fail(
666+
f"README {label.upper()} URL: README.md must include {url!r}\n"
667+
f" Installer snippets should follow the latest release asset "
668+
f"without per-release README churn."
669+
)
670+
print(
671+
"ok: README installs nested skills, Pi package, Antigravity, OpenCode, "
672+
"and latest installer assets"
673+
)
660674

661675

662676
def check_release_workflow_npm_surface(root: Path):
@@ -674,6 +688,8 @@ def check_release_workflow_npm_surface(root: Path):
674688
"github.event.release.tag_name": "checks the GitHub release tag",
675689
"package.json').pi.skills[0]": "checks Pi package metadata",
676690
"dist-tags.latest": "confirms the npm latest dist-tag",
691+
"scripts/setup-rule.sh": "uploads the rule installer as a latest release asset",
692+
"scripts/setup-statusline.sh": "uploads the statusline installer as a latest release asset",
677693
}
678694
missing = [label for label, reason in required.items() if label not in text]
679695
if missing:
@@ -682,7 +698,7 @@ def check_release_workflow_npm_surface(root: Path):
682698
"must publish and verify @tw93/waza for Pi installs.\n"
683699
+ "\n".join(f" missing {label!r}: {required[label]}" for label in missing)
684700
)
685-
print("ok: release workflow publishes and verifies npm package")
701+
print("ok: release workflow publishes npm package and installer assets")
686702

687703

688704
def check_english_coaching_guard(root: Path):

tests/python/test_build_metadata.py

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -8,22 +8,22 @@
88
import build_metadata as bm
99

1010

11-
def test_render_readme_pins_main_to_version():
11+
def test_render_readme_rewrites_main_to_latest_asset():
1212
body = "curl https://raw.githubusercontent.com/tw93/Waza/main/scripts/setup-rule.sh"
1313
out = bm.render_readme(body, "9.9.9")
14-
assert "tw93/Waza/v9.9.9/scripts/" in out
15-
assert "tw93/Waza/main/scripts/" not in out
14+
assert "https://github.com/tw93/Waza/releases/latest/download/setup-rule.sh" in out
15+
assert "raw.githubusercontent.com" not in out
1616

1717

18-
def test_render_readme_repins_older_version():
18+
def test_render_readme_rewrites_pinned_version_to_latest_asset():
1919
body = "curl https://raw.githubusercontent.com/tw93/Waza/v1.2.3/scripts/setup-rule.sh"
2020
out = bm.render_readme(body, "9.9.9")
21-
assert "tw93/Waza/v9.9.9/scripts/" in out
21+
assert "https://github.com/tw93/Waza/releases/latest/download/setup-rule.sh" in out
2222
assert "v1.2.3" not in out
2323

2424

25-
def test_render_readme_no_change_when_already_pinned():
26-
body = "curl https://raw.githubusercontent.com/tw93/Waza/v9.9.9/scripts/setup-rule.sh"
25+
def test_render_readme_no_change_when_already_latest_asset():
26+
body = "curl https://github.com/tw93/Waza/releases/latest/download/setup-rule.sh"
2727
assert bm.render_readme(body, "9.9.9") == body
2828

2929

tests/test_codegen.sh

Lines changed: 11 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -36,19 +36,23 @@ test "$(jq -r '.name' "$tmpdir/regen/package.json")" = "@tw93/waza"
3636
test "$(jq -r '.pi.skills[0]' "$tmpdir/regen/package.json")" = "./skills"
3737
test "$(jq -r '.publishConfig.access' "$tmpdir/regen/package.json")" = "public"
3838

39-
# README install URLs must be pinned to VERSION, not floating on main.
39+
# README installer URLs should use latest release assets. The installer scripts
40+
# themselves still pin WAZA_REF to VERSION.
4041
copy_repo "$tmpdir/readme"
4142
version=$(cat "$tmpdir/readme/VERSION")
42-
sed -i.bak "s|tw93/Waza/v${version}/scripts/|tw93/Waza/main/scripts/|g" "$tmpdir/readme/README.md"
43+
sed -i.bak \
44+
"s|https://github.com/tw93/Waza/releases/latest/download/setup-rule.sh|https://raw.githubusercontent.com/tw93/Waza/v${version}/scripts/setup-rule.sh|g; s|https://github.com/tw93/Waza/releases/latest/download/setup-statusline.sh|https://raw.githubusercontent.com/tw93/Waza/v${version}/scripts/setup-statusline.sh|g" \
45+
"$tmpdir/readme/README.md"
4346
rm "$tmpdir/readme/README.md.bak"
4447
if (cd "$tmpdir/readme" && python3 scripts/build_metadata.py --check >"$tmpdir/readme.out" 2>"$tmpdir/readme.err"); then
45-
echo "build_metadata --check should detect unpinned README URLs"; exit 1
48+
echo "build_metadata --check should detect raw README installer URLs"; exit 1
4649
fi
47-
grep -q "README.md install URLs are not pinned" "$tmpdir/readme.err"
50+
grep -q "README.md installer URLs must use latest release assets" "$tmpdir/readme.err"
4851
(cd "$tmpdir/readme" && python3 scripts/build_metadata.py >"$tmpdir/readme-regen.out")
49-
grep -q "tw93/Waza/v${version}/scripts/" "$tmpdir/readme/README.md"
50-
if grep -q "tw93/Waza/main/scripts/" "$tmpdir/readme/README.md"; then
51-
echo "README still has unpinned install URLs after regen"; exit 1
52+
grep -q "tw93/Waza/releases/latest/download/setup-rule.sh" "$tmpdir/readme/README.md"
53+
grep -q "tw93/Waza/releases/latest/download/setup-statusline.sh" "$tmpdir/readme/README.md"
54+
if grep -q "raw.githubusercontent.com/tw93/Waza/.*/scripts/setup-" "$tmpdir/readme/README.md"; then
55+
echo "README still has raw installer URLs after regen"; exit 1
5256
fi
5357

5458
# package.json is generated too; package version and Pi metadata must stay

0 commit comments

Comments
 (0)