diff --git a/.github/workflows/context7-refresh.yml b/.github/workflows/context7-refresh.yml new file mode 100644 index 0000000..05732b2 --- /dev/null +++ b/.github/workflows/context7-refresh.yml @@ -0,0 +1,41 @@ +name: Context7 refresh + +on: + push: + branches: + - main + paths: + - "README.md" + - "context7.json" + - "docs/**" + - "examples/**" + +permissions: + contents: read + +jobs: + refresh: + runs-on: ubuntu-latest + timeout-minutes: 5 + steps: + - name: Trigger a Context7 refresh + env: + CONTEXT7_API_KEY: ${{ secrets.CONTEXT7_API_KEY }} + LIBRARY_NAME: /${{ github.repository }} + run: | + status=$(curl --silent --show-error --max-time 180 --output response.json --write-out '%{http_code}' \ + -X POST https://context7.com/api/v1/refresh \ + -H "Content-Type: application/json" \ + -H "Authorization: Bearer $CONTEXT7_API_KEY" \ + -d "{\"libraryName\": \"$LIBRARY_NAME\"}") + cat response.json + echo + if [ "$status" = "200" ]; then + exit 0 + fi + if [ "$status" = "400" ] && grep -q '"error":"too-early"' response.json; then + echo "::notice::Context7 refreshed $LIBRARY_NAME recently, so it skipped this refresh." + exit 0 + fi + echo "::error::Context7 refresh failed with HTTP $status." + exit 1 diff --git a/AGENTS.md b/AGENTS.md index ed53cbb..bfccd95 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -57,8 +57,9 @@ Before you tag, read `docs/virtual-actors.md` and `docs/agents.md` against the release and correct any requirement, compatibility, or guarantee statement that changed. After the tag publishes, refresh the solidobjects.dev documentation snapshot from the tag and redeploy the site; its `check:release` step refuses a -snapshot that is not the latest published tag. Then trigger a Context7 refresh -for this repository. +snapshot that is not the latest published tag. The Context7 refresh workflow +refreshes the index after each push to `main` that changes the documentation. +Confirm that its run succeeded. ## Security & Configuration diff --git a/CHANGELOG.md b/CHANGELOG.md index 5760f87..4cd14c1 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,13 @@ # Changelog +## Unreleased + +- Claim the Context7 library: `context7.json` now carries the library `url` and + the maintainer `public_key`. +- Add the Context7 refresh workflow. A push to `main` that changes the README, + `context7.json`, `docs/`, or `examples/` asks Context7 to refresh the index. + It uses the `CONTEXT7_API_KEY` repository secret. + ## 0.17.1 - 2026-10-08 - Name the category in the gem metadata and the README: Solid Objects is a diff --git a/context7.json b/context7.json index e3dd132..abee3e8 100644 --- a/context7.json +++ b/context7.json @@ -1,5 +1,7 @@ { "$schema": "https://context7.com/schema/context7.json", + "url": "https://context7.com/cardmagic/solid-objects-ruby", + "public_key": "pk_veEo2smPvGYMwP1MncN1A", "projectTitle": "Solid Objects for Rails (solid_objects)", "description": "SQL-backed virtual actor library for Ruby on Rails. Actors have stable identities, durable JSON state in SQLite, PostgreSQL, or MySQL, ordered per-identity mailboxes, fenced activation, durable reminders, and transactional effects. Requires Ruby 3.3+ and Rails 7.1+.", "folders": [