Skip to content

Commit c71cf65

Browse files
authored
Docs: CLI release filled in at build time; GitHub Actions example triggers once per PR commit (#174)
* Docs: the CLI release comes from the newest GitHub release at build time; the GitHub Actions example runs once per PR commit * Docs CLI release: fill it in public/ci.md too; get_skill golden
1 parent 95cdc93 commit c71cf65

40 files changed

Lines changed: 194 additions & 86 deletions

File tree

‎.claude-plugin/marketplace.json‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
"plugins": [
66
{
77
"name": "visualci",
8-
"version": "0.1.59",
8+
"version": "0.1.61",
99
"description": "Visual regression and snapshot review for PDFs, screenshots, JSON, HTML and text: VisualCI's MCP server and its skills for each CI provider and test tool.",
1010
"author": { "name": "DocSpring", "url": "https://visualci.com" },
1111
"homepage": "https://visualci.com/docs/skills/",

‎.claude-plugin/plugin.json‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "visualci",
3-
"version": "0.1.59",
3+
"version": "0.1.61",
44
"description": "Visual regression and snapshot review for PDFs, screenshots, JSON, HTML and text: VisualCI's MCP server and its skills for each CI provider and test tool.",
55
"author": { "name": "DocSpring", "url": "https://visualci.com" },
66
"homepage": "https://visualci.com/docs/skills/",

‎.cursor-plugin/plugin.json‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "visualci",
33
"displayName": "VisualCI",
4-
"version": "0.1.59",
4+
"version": "0.1.61",
55
"description": "Visual regression and snapshot review for PDFs, screenshots, JSON, HTML and text: VisualCI's MCP server and its skills for each CI provider and test tool.",
66
"author": {
77
"name": "DocSpring"

‎.github/workflows/ci.yml‎

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -214,6 +214,8 @@ jobs:
214214
working-directory: frontend
215215
- run: pnpm install --frozen-lockfile && pnpm build
216216
working-directory: frontend
217+
env:
218+
GITHUB_TOKEN: ${{ github.token }} # the docs' CLI release (scripts/cli-version.mjs)
217219
- uses: ./.github/actions/playwright
218220
with:
219221
save: ${{ github.ref == 'refs/heads/main' }}
@@ -437,6 +439,8 @@ jobs:
437439
# The production site: with the Plausible snippets (analytics.ts) and, required, the WebAssembly.
438440
- run: pnpm install --frozen-lockfile && VISUALCI_ANALYTICS=1 VISUALCI_REQUIRE_WASM=1 pnpm build
439441
working-directory: frontend
442+
env:
443+
GITHUB_TOKEN: ${{ github.token }} # the docs' CLI release (scripts/cli-version.mjs)
440444
# visualci.com's static site: assembled from the build and checked (every docs page has its Markdown copy, and
441445
# llms.txt links each one), then deployed by the site job.
442446
- run: VISUALCI_ANALYTICS=1 node scripts/site.mjs
@@ -539,7 +543,13 @@ jobs:
539543
steps:
540544
- uses: actions/checkout@v4
541545
- id: version
542-
run: echo "renderer=$(cat docker/renderer.version)" >>"$GITHUB_OUTPUT"
546+
env:
547+
GH_TOKEN: ${{ github.token }}
548+
run: |
549+
echo "renderer=$(cat docker/renderer.version)" >>"$GITHUB_OUTPUT"
550+
# The CLI release the app's add-to-CI snippets install (frontend/scripts/cli-version.mjs): a build arg, so a
551+
# new release rebuilds the cached frontend layer
552+
echo "cli=$(gh api repos/DocSpring/visualci/releases/latest --jq .tag_name)" >>"$GITHUB_OUTPUT"
543553
- uses: actions/download-artifact@v4
544554
with:
545555
name: release-bins
@@ -564,6 +574,7 @@ jobs:
564574
BUILD_SHA=${{ github.sha }}
565575
RENDERER_VERSION=${{ steps.version.outputs.renderer }}
566576
VISUALCI_ANALYTICS=1
577+
VISUALCI_CLI_VERSION=${{ steps.version.outputs.cli }}
567578
tags: ghcr.io/docspring/visualci-app:${{ github.sha }}
568579
cache-from: ${{ env.S3_CACHE }},name=visualci-app
569580
cache-to: ${{ env.PUSH == 'true' && format('{0},name=visualci-app,mode=max,ignore-error=true', env.S3_CACHE) || '' }}

‎AGENTS.md‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -43,9 +43,9 @@ design is in `docs/design.md`; read it before changing the architecture, and upd
4343
`.claude-plugin/plugin.json` and `marketplace.json` when a skill changes.
4444
- A change to the CLI (crates/visualci-cli or crates/visualci-core) bumps the workspace version in Cargo.toml and
4545
Cargo.lock's visualci-* entries. CI's `cli-version` job fails without the bump; once CI passes on main, the release
46-
workflow publishes it. The docs' `VISUALCI_VERSION=` lines pin a published release (`scripts/site.mjs` checks it
47-
exists): move them to the new version in a commit after its release is out. The docs must never describe a CLI
48-
nobody can download.
46+
workflow publishes it. The docs never name a CLI version: they write `{{cli_version}}`
47+
(`VISUALCI_VERSION={{cli_version}}`, `github-action@v{{cli_version}}`), which the site build fills in with the newest
48+
published release (`frontend/scripts/cli-version.mjs`), so they never pin an old CLI or one nobody can download yet.
4949
- Fixtures are test data only: synthetic values, or blank template PDFs someone has checked. Never commit a real
5050
customer's document or data.
5151
- Build Rust in CI or on a build machine (docspring-dev), not on small agent VMs. The server is app/ (Laravel Rust,

‎app/tests/golden/mcp/get_skill_lists_the_skills_and_returns_one/get_skill-2.json‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
"result": {
66
"content": [
77
{
8-
"text": "---\nname: visualci-jenkins\ndescription: \"Sets up VisualCI in a Jenkins pipeline (Jenkinsfile): the token as a credential, installing the CLI, creating the build, uploading snapshots and finalizing, including parallel stages. Use when the user wants visual or snapshot review in Jenkins, or a project has a Jenkinsfile and VisualCI. Not for other CI providers, or for writing the tests themselves.\"\nlicense: Apache-2.0\nmetadata:\n docs: https://visualci.com/docs/ci/jenkins.md\n---\n\n<!-- Generated from frontend/content/docs/ci/jenkins.md by frontend/scripts/skills.mjs. Edit the page. -->\n\n# Jenkins\n\nStore a project token as a **Secret text** credential, say `visualci-token`. The CLI reads the commit from `GIT_COMMIT`, the branch from `CHANGE_BRANCH`, `BRANCH_NAME` or `GIT_BRANCH`, and the pull request from `CHANGE_ID`.\n\n```groovy\npipeline {\n agent any\n environment {\n VISUALCI_TOKEN = credentials('visualci-token')\n }\n stages {\n stage('Test') {\n steps {\n sh 'curl -fsSL https://visualci.com/install.sh | VISUALCI_VERSION=0.2.23 VISUALCI_INSTALL_DIR=\"$WORKSPACE/bin\" sh'\n sh '''\n export PATH=\"$WORKSPACE/bin:$PATH\"\n export VISUALCI_BUILD_ID=$(visualci build create)\n npm test -- -u # write snapshots instead of failing; see the snapshot guides\n visualci upload --from auto src tests\n visualci build finalize\n '''\n }\n }\n }\n}\n```\n\nEach `sh` step is its own shell, so keep the build's commands in one step, or pass `VISUALCI_BUILD_ID` on with `withEnv`.\n\n## Parallel stages\n\nCreate the build once, then give each parallel stage a shard number:\n\n```groovy\nstage('Start VisualCI') {\n steps {\n script {\n env.VISUALCI_BUILD_ID = sh(script: 'bin/visualci build create --shards 2', returnStdout: true).trim()\n }\n }\n}\nstage('Tests') {\n parallel {\n stage('Unit') { steps { sh 'npm run test:unit -- -u && bin/visualci upload --from auto src && bin/visualci build finalize --shard 0' } }\n stage('Browser') { steps { sh 'npm run test:e2e && bin/visualci upload screenshots && bin/visualci build finalize --shard 1' } }\n }\n}\n```\n\nSee [Other CI providers](https://visualci.com/docs/ci/other.md) for the environment variables and how shards work.\n\nThis skill is the page https://visualci.com/docs/ci/jenkins.md. All of VisualCI's documentation: https://visualci.com/llms.txt\n",
8+
"text": "---\nname: visualci-jenkins\ndescription: \"Sets up VisualCI in a Jenkins pipeline (Jenkinsfile): the token as a credential, installing the CLI, creating the build, uploading snapshots and finalizing, including parallel stages. Use when the user wants visual or snapshot review in Jenkins, or a project has a Jenkinsfile and VisualCI. Not for other CI providers, or for writing the tests themselves.\"\nlicense: Apache-2.0\nmetadata:\n docs: https://visualci.com/docs/ci/jenkins.md\n---\n\n<!-- Generated from frontend/content/docs/ci/jenkins.md by frontend/scripts/skills.mjs. Edit the page. -->\n\n# Jenkins\n\nReplace x.y.z below with the newest release of the VisualCI CLI: https://github.com/DocSpring/visualci/releases/latest\n\nStore a project token as a **Secret text** credential, say `visualci-token`. The CLI reads the commit from `GIT_COMMIT`, the branch from `CHANGE_BRANCH`, `BRANCH_NAME` or `GIT_BRANCH`, and the pull request from `CHANGE_ID`.\n\n```groovy\npipeline {\n agent any\n environment {\n VISUALCI_TOKEN = credentials('visualci-token')\n }\n stages {\n stage('Test') {\n steps {\n sh 'curl -fsSL https://visualci.com/install.sh | VISUALCI_VERSION=x.y.z VISUALCI_INSTALL_DIR=\"$WORKSPACE/bin\" sh'\n sh '''\n export PATH=\"$WORKSPACE/bin:$PATH\"\n export VISUALCI_BUILD_ID=$(visualci build create)\n npm test -- -u # write snapshots instead of failing; see the snapshot guides\n visualci upload --from auto src tests\n visualci build finalize\n '''\n }\n }\n }\n}\n```\n\nEach `sh` step is its own shell, so keep the build's commands in one step, or pass `VISUALCI_BUILD_ID` on with `withEnv`.\n\n## Parallel stages\n\nCreate the build once, then give each parallel stage a shard number:\n\n```groovy\nstage('Start VisualCI') {\n steps {\n script {\n env.VISUALCI_BUILD_ID = sh(script: 'bin/visualci build create --shards 2', returnStdout: true).trim()\n }\n }\n}\nstage('Tests') {\n parallel {\n stage('Unit') { steps { sh 'npm run test:unit -- -u && bin/visualci upload --from auto src && bin/visualci build finalize --shard 0' } }\n stage('Browser') { steps { sh 'npm run test:e2e && bin/visualci upload screenshots && bin/visualci build finalize --shard 1' } }\n }\n}\n```\n\nSee [Other CI providers](https://visualci.com/docs/ci/other.md) for the environment variables and how shards work.\n\nThis skill is the page https://visualci.com/docs/ci/jenkins.md. All of VisualCI's documentation: https://visualci.com/llms.txt\n",
99
"type": "text"
1010
}
1111
],

‎docker/app.Dockerfile‎

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,9 @@ ARG VISUALCI_ANALYTICS=0
1313
ENV VISUALCI_ANALYTICS=${VISUALCI_ANALYTICS}
1414
# The site's Compare two PDFs page (and its WebAssembly) is served by the site's Worker, never by the app.
1515
ENV VISUALCI_SKIP_WASM=1
16+
# The CLI release the add-to-CI snippets install (frontend/scripts/cli-version.mjs); CI passes the newest release.
17+
ARG VISUALCI_CLI_VERSION=
18+
ENV VISUALCI_CLI_VERSION=${VISUALCI_CLI_VERSION}
1619
RUN if [ -f pnpm-lock.yaml ]; then pnpm build; else npm run build; fi
1720

1821
# cargo-chef: the dependencies build in a layer of their own, rebuilt only when a Cargo.toml or Cargo.lock changes.

‎frontend/content/docs/ci/bitbucket.md‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ pipelines:
1414
name: Test
1515
image: node:24
1616
script:
17-
- curl -fsSL https://visualci.com/install.sh | VISUALCI_VERSION=0.2.23 VISUALCI_INSTALL_DIR=/usr/local/bin sh
17+
- curl -fsSL https://visualci.com/install.sh | VISUALCI_VERSION={{cli_version}} VISUALCI_INSTALL_DIR=/usr/local/bin sh
1818
- export VISUALCI_BUILD_ID=$(visualci build create)
1919
- npm test -- -u # write snapshots instead of failing; see the snapshot guides
2020
- visualci upload --from auto src tests

‎frontend/content/docs/ci/buildkite.md‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ The CLI reads the commit from `BUILDKITE_COMMIT`, the branch from `BUILDKITE_BRA
1111
steps:
1212
- label: ":test_tube: Tests"
1313
command: |
14-
curl -fsSL https://visualci.com/install.sh | VISUALCI_VERSION=0.2.23 VISUALCI_INSTALL_DIR="$$HOME/bin" sh
14+
curl -fsSL https://visualci.com/install.sh | VISUALCI_VERSION={{cli_version}} VISUALCI_INSTALL_DIR="$$HOME/bin" sh
1515
export PATH="$$HOME/bin:$$PATH"
1616
export VISUALCI_BUILD_ID=$$(visualci build create)
1717
npm test -- -u

‎frontend/content/docs/ci/circleci.md‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ jobs:
1616
- checkout
1717
- run:
1818
name: Install VisualCI
19-
command: curl -fsSL https://visualci.com/install.sh | VISUALCI_VERSION=0.2.23 VISUALCI_INSTALL_DIR="$HOME/bin" sh
19+
command: curl -fsSL https://visualci.com/install.sh | VISUALCI_VERSION={{cli_version}} VISUALCI_INSTALL_DIR="$HOME/bin" sh
2020
- run:
2121
name: Start a VisualCI build
2222
command: echo "export VISUALCI_BUILD_ID=$($HOME/bin/visualci build create)" >> "$BASH_ENV"

0 commit comments

Comments
 (0)