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
53 changes: 53 additions & 0 deletions .github/workflows/publish-dsh-plugin.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
name: Publish DSH plugin

# Publishes plugins/dsh-agent-looper (@dancingteeth/dsh-agent-looper).
# Tag `dsh-plugin-v<version>` (matching plugins/dsh-agent-looper/package.json) or run manually.
on:
push:
tags:
- 'dsh-plugin-v*'
workflow_dispatch:

permissions:
contents: read
id-token: write # required for npm OIDC trusted publishing

jobs:
publish:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4

- uses: pnpm/action-setup@v4
with:
version: 9

- uses: actions/setup-node@v4
with:
node-version: '22.15'
registry-url: 'https://registry.npmjs.org'
cache: pnpm
package-manager-cache: false

# Trusted publishing needs npm ≥ 11.5.1 (Node 22.14+).
- run: npm install -g npm@^11.5.1

- name: Tag matches package version
if: startsWith(github.ref, 'refs/tags/')
run: |
version=$(node -p "require('./plugins/dsh-agent-looper/package.json').version")
test "${GITHUB_REF_NAME}" = "dsh-plugin-v${version}" || {
echo "tag ${GITHUB_REF_NAME} does not match package version ${version}"; exit 1; }

- run: pnpm install --frozen-lockfile
- run: pnpm test:dsh-plugin:deps
- run: pnpm exec vitest run plugins/dsh-agent-looper
# The plugin has no TypeScript of its own; the root tsc emits plugins/dsh-agent-looper/dist/.
- run: pnpm exec tsc -p plugins/dsh-agent-looper/tsconfig.json

# OIDC trusted publishing — do not set NODE_AUTH_TOKEN (see publish.yml).
- run: npm publish --access public --ignore-scripts
working-directory: plugins/dsh-agent-looper
env:
NODE_AUTH_TOKEN: ''
NPM_CONFIG_REGISTRY: https://registry.npmjs.org
11 changes: 11 additions & 0 deletions docs/dsh-plugin.md
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,17 @@ Offline (CI — no live `dsh web`):

Live (manual): `pnpm exec tsc -p plugins/dsh-agent-looper/tsconfig.json` then `dsh plugin --profile web add ./plugins/dsh-agent-looper`. Freeze loops in the **same** workspace as the product repo. Start `dsh web` from that cwd. Before a `runtime: dsh` grind, set the session to **Full Access** (see runtime doc above).

## Publishing

[`.github/workflows/publish-dsh-plugin.yml`](../.github/workflows/publish-dsh-plugin.yml) publishes `@dancingteeth/dsh-agent-looper` with npm trusted publishing (OIDC, no token). Bump `plugins/dsh-agent-looper/package.json`, merge to `main`, then push a matching tag:

```bash
git tag dsh-plugin-v0.1.2
git push origin dsh-plugin-v0.1.2
```

Or **Actions → Publish DSH plugin → Run workflow**. The tag must match the package version or the job fails. One-time setup: on npm, the package's **Settings → Trusted Publisher** must name GitHub Actions, `dancingteeth` / `agent-looper`, workflow `publish-dsh-plugin.yml` (same steps as [`releasing.md`](./releasing.md)).

## Related

- Cursor marketplace companion: [`docs/cursor-marketplace-plugin.md`](./cursor-marketplace-plugin.md)
Expand Down
Loading