name: Publish plugin-sdk to npm # Publishes trek-plugin-sdk when a tag like `plugin-sdk-v1.2.0` is pushed. # One-time setup: add an npm automation token as the repo secret NPM_TOKEN. # The package's prepublishOnly hook builds + tests before publishing. on: push: tags: - 'plugin-sdk-v*' permissions: contents: read jobs: publish: runs-on: ubuntu-latest defaults: run: working-directory: plugin-sdk steps: - uses: actions/checkout@v4 - uses: actions/setup-node@v4 with: # 22 matches the TREK server runtime and has node:sqlite, which the # dev-server tests exercise. node-version: 22 registry-url: 'https://registry.npmjs.org' - run: npm ci - run: npm publish env: NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}