diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index f274f5f..b6d8f36 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -9,6 +9,7 @@ jobs: runs-on: ubuntu-latest permissions: contents: read + id-token: write # npm trusted publishing (OIDC): no npm token anywhere steps: - uses: actions/checkout@v7 - uses: pnpm/action-setup@v6 @@ -16,7 +17,8 @@ jobs: with: node-version: 22 cache: pnpm - registry-url: 'https://registry.npmjs.org' + # Trusted publishing needs npm >= 11.5.1 (Node 22's bundled npm is 10). + - run: npm install -g npm@11 - run: pnpm install --frozen-lockfile - run: pnpm typecheck - run: pnpm test @@ -27,6 +29,7 @@ jobs: run: test -z "$(git status --porcelain -- lib)" - name: Tag matches package version run: test "v$(node -p "require('./package.json').version")" = "${GITHUB_REF_NAME}" + # @refkit/dsh-plugin lists this repo and `release.yml` as its trusted publisher on + # npmjs.com, so npm exchanges the job's OIDC token here and signs provenance. + # No registry-url / NODE_AUTH_TOKEN: an `_authToken` in .npmrc would bypass OIDC. - run: npm publish --access public - env: - NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} diff --git a/CHANGELOG.md b/CHANGELOG.md index dce4054..c314866 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,9 @@ # Changelog +## 0.3.2 + +- **Published with provenance.** Releases now go out from GitHub Actions through npm trusted publishing instead of a long-lived npm token, so each version carries a signed provenance statement that links it to the commit and workflow run that built it. No code changes. + ## 0.3.1 - **dsh 0.2.1.** Runs on dsh 0.2.1-rc.2 as well as 0.1.7-rc.2: `engines.dsh` and the dsh peers are `^0.1.7-rc.2 || ^0.2.1-rc.2`. dsh 0.2.1 refuses 0.2.0 and 0.3.0, which only declare `^0.1.7-rc.2`; if you upgraded dsh with one of them installed, remove the plugin and add it again. diff --git a/lib/index.js b/lib/index.js index 4090ab5..3aac372 100644 --- a/lib/index.js +++ b/lib/index.js @@ -22,7 +22,7 @@ import { wikimediaCommons } from "@refkit/provider-wikimedia-commons"; import { defineTool } from "@deepseek-ai/dsh-tools"; //#region src/config.ts /** Kept in sync with package.json by tests/config.test.ts. */ -const PLUGIN_VERSION = "0.3.1"; +const PLUGIN_VERSION = "0.3.2"; const KEY_FIELDS = [ "unsplashAccessKey", "pexelsApiKey", @@ -85,7 +85,7 @@ function resolveConfig(config, env = process.env) { timeoutMs: clampInt(config.timeoutMs, DEFAULTS.timeoutMs, 1e3, 6e4), rerank: config.rerank ?? DEFAULTS.rerank, sourceConfidence: config.sourceConfidence ?? DEFAULTS.sourceConfidence, - userAgent: nonEmpty(config.userAgent) ?? `refkit-dsh-plugin/0.3.1` + userAgent: nonEmpty(config.userAgent) ?? `refkit-dsh-plugin/0.3.2` }; } const k = (cfg, field) => cfg.keys[field] ?? ""; diff --git a/lib/types/config.d.ts b/lib/types/config.d.ts index 808c15c..b3fd8c9 100644 --- a/lib/types/config.d.ts +++ b/lib/types/config.d.ts @@ -11,7 +11,7 @@ import z from '@deepseek-ai/schemastery'; import { type ReferenceProvider, type RefkitClient, type RefkitOptions } from '@refkit/core'; import type { Modality } from './core/outcome.ts'; /** Kept in sync with package.json by tests/config.test.ts. */ -export declare const PLUGIN_VERSION = "0.3.1"; +export declare const PLUGIN_VERSION = "0.3.2"; export declare const KEY_FIELDS: readonly ["unsplashAccessKey", "pexelsApiKey", "pixabayKey", "flickrApiKey", "smithsonianApiKey", "braveToken", "freesoundToken", "jamendoClientId", "europeanaApiKey", "openverseToken"]; export type KeyField = (typeof KEY_FIELDS)[number]; /** Environment names per key, first match wins. The nine keyed sources mirror @refkit/mcp's CLI. */ diff --git a/package.json b/package.json index 6503e5a..a5c022c 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@refkit/dsh-plugin", - "version": "0.3.1", + "version": "0.3.2", "description": "DeepSeek Harness plugin for refkit: license-normalized creative reference search across 24 sources from 19 provider packages and 4 modalities, a strict-deny use-gate, and a web card with license and use-verdict badges (refkit_search / refkit_rights).", "icon": "./icon.svg", "type": "module", diff --git a/src/config.ts b/src/config.ts index 1c86fa0..d4f8ef9 100644 --- a/src/config.ts +++ b/src/config.ts @@ -32,7 +32,7 @@ import { wikimediaCommons } from '@refkit/provider-wikimedia-commons' import type { Modality } from './core/outcome.ts' /** Kept in sync with package.json by tests/config.test.ts. */ -export const PLUGIN_VERSION = '0.3.1' +export const PLUGIN_VERSION = '0.3.2' export const KEY_FIELDS = [ 'unsplashAccessKey', 'pexelsApiKey', 'pixabayKey', 'flickrApiKey', 'smithsonianApiKey',