Skip to content
Merged
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
7 changes: 7 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -120,6 +120,13 @@ jobs:
- name: Cache dependencies
uses: Swatinem/rust-cache@v2

# A cargo build quietly rewrites a Cargo.lock that disagrees with the crate
# manifests, so a stale one fails nothing by itself. release-refresh.yml
# updates it on the release branch; this catches a crate version changed
# anywhere else without its lock entry.
- name: Check Cargo.lock matches the crate manifests
run: cargo metadata --locked --format-version 1 > /dev/null

# Confirms every binary named in a plugin's hooks.json / .mcp.json is a
# [[bin]] target this workspace builds. Those are plain strings that no
# compiler or test validates.
Expand Down
30 changes: 26 additions & 4 deletions .github/workflows/release-refresh.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,11 @@ name: Release Refresh
# INSTALL.md, the Antigravity and Qwen READMEs). Without a refresh, every
# release PR fails `gen-marketplaces.sh --check` and `check-install-pins.sh`
# on its first CI run - red through no fault of the release content.
# Footprint documents no longer carry a version stamp, so they need no refresh.
# It also does not update the workspace Cargo.lock at the repository root (it
# looks for a lock file inside each package folder), so the lock file kept the
# old version of every crate a release bumped, and the next cargo build
# rewrote a tracked file. Footprint documents no longer carry a version stamp,
# so they need no refresh.
#
# This job runs both against the release branch and commits the
# result back to it when it changes anything. It converges: the push
Expand Down Expand Up @@ -63,15 +67,26 @@ jobs:
continue-on-error: true
run: bash scripts/check-install-pins.sh --write

# Sets the version of each workspace crate in Cargo.lock to the one its
# Cargo.toml now carries, and changes nothing else (no dependency moves).
# It needs the registry index, so it needs the network: --offline fails
# on a runner with an empty cargo home. continue-on-error for the same
# reason as the step above; CI's `--locked` step catches a lock file this
# could not update.
- name: Refresh Cargo.lock
id: lock
continue-on-error: true
run: cargo update --workspace

- name: Commit refresh
env:
# Passed through env, never spliced into the script text: head_ref is
# attacker-influenced input, and the job guard is the only thing
# standing between it and the shell.
HEAD_REF: ${{ github.head_ref }}
run: |
# Only the generated marketplace manifests and the install
# documents whose pins the step above rewrites. A release branch never
# Only the generated marketplace manifests, the install documents
# whose pins a step above rewrites, and Cargo.lock. A release branch never
# carries hand-written changes, but an unrestricted `git add -A`
# would commit them silently if it ever did - and a refresh commit
# must never smuggle content into a release.
Expand All @@ -82,7 +97,8 @@ jobs:
.opencode-plugin/marketplace.json \
opencode/plugins/*/INSTALL.md \
antigravity/plugins/*/README.md \
qwen/plugins/*/README.md
qwen/plugins/*/README.md \
Cargo.lock
if git diff --cached --quiet; then
echo "Derived files already fresh; nothing to commit."
else
Expand All @@ -99,3 +115,9 @@ jobs:
run: |
echo "::error::The step 'Refresh install-document pins' failed: scripts/check-install-pins.sh --write found a problem that needs a hand edit. Its log lists each one."
exit 1

- name: Fail when Cargo.lock could not be refreshed
if: steps.lock.outcome == 'failure'
run: |
echo "::error::The step 'Refresh Cargo.lock' failed: cargo update --workspace did not complete. Its log has the reason; re-run this workflow once it is resolved."
exit 1
8 changes: 7 additions & 1 deletion Justfile
Original file line number Diff line number Diff line change
Expand Up @@ -391,9 +391,15 @@ site-preview:
@echo 'Check: 1) 320 px and desktop widths; 2) light, dark and the theme toggle; 3) a sparse card (todov2 has three greyed tabs); 4) a Qwen card shows Not measured; 5) an OpenCode card shows the setup bar and resident 0 B; 6) every copy button, and the page with JavaScript disabled'
python3 -m http.server --bind 127.0.0.1 --directory target/preview 8000

# Check that Cargo.lock agrees with every crate's Cargo.toml. It runs first in `check`: any
# later cargo command would quietly rewrite a stale lock file and hide the problem.
# `cargo update --workspace` fixes it and changes no dependency.
lock:
cargo metadata --locked --format-version 1 > /dev/null

# Run all pre-flight checks (what CI and lefthook run; see ci.yml — `links`
# is hook-only and `gen-* --check` + opencode suites run in CI but not here)
check: fmt lint test deny spellcheck links versions wiring marketplace qwen-marketplace agy-marketplace dispatch smoke footprint opencode-wiring bump-opencode-plugin-test rerun-runner-failures-test doc-paths-test doc-paths gate-wiring-test gate-wiring install-pins-test install-pins readme-coverage-test readme-coverage agy-wiring agy-validate footprint-budgets devtools-skills skills-bundles skills-release-wiring site-check
check: lock fmt lint test deny spellcheck links versions wiring marketplace qwen-marketplace agy-marketplace dispatch smoke footprint opencode-wiring bump-opencode-plugin-test rerun-runner-failures-test doc-paths-test doc-paths gate-wiring-test gate-wiring install-pins-test install-pins readme-coverage-test readme-coverage agy-wiring agy-validate footprint-budgets devtools-skills skills-bundles skills-release-wiring site-check

# Build the example Claude Code plugin's binaries into its bin/ directory.
# Windows developers run this locally; CI produces the other platforms.
Expand Down
2 changes: 1 addition & 1 deletion docs/PLUGIN_GUIDELINES.md
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ Release tags are never pushed by hand; see `HACK.md`.

| File | What to do | Generated | What fails if you skip it |
|---|---|---|---|
| `Cargo.lock` | Run `cargo metadata --format-version 1 > /dev/null`; it adds the crate to `Cargo.lock`. Commit that change. | yes | Nothing: no build here passes `--locked`, so the next contributor's build rewrites it. |
| `Cargo.lock` | Run `cargo metadata --format-version 1 > /dev/null`; it adds the crate to `Cargo.lock`. Commit that change. On a release the release branch updates each crate's version in it for you. | yes | `just lock`, and the CI step "Check Cargo.lock matches the crate manifests". |
| `scripts/check-package-versions.sh` | As in 3.1, and add the crate's `Cargo.toml` to the list of crates that must not inherit the workspace version. | no | Nothing: the list is hardcoded. |
| `<plugin folder>/.gitignore` | Claude Code and Antigravity: a file holding the line `/bin/`, with the leading slash, so that the binary sources inside the crate stay tracked; copy `claude-code/plugins/repo-tasks-mcp-cc/.gitignore`. The root `.gitignore` already covers the Qwen and OpenCode staging folders. | no | Nothing: a built binary shows as untracked. |
| `Cargo.toml` release metadata | Copy the exemplar's `[package.metadata.release]`, which rewrites the version in the host manifest in the same commit as a crate version bump, and `[package.metadata.dist.binaries]`. | no | Nothing in this repository checks either. |
Expand Down
Loading