diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml new file mode 100644 index 0000000..3561ef3 --- /dev/null +++ b/.github/workflows/publish.yml @@ -0,0 +1,38 @@ +name: Publish + +# Publishes the package to npm when a GitHub Release is published. +# Requires an NPM_TOKEN repo secret (npm automation token with publish rights). + +on: + release: + types: [published] + workflow_dispatch: + +permissions: + contents: read + id-token: write # for npm provenance + +jobs: + publish: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + + - uses: pnpm/action-setup@v4 + + - uses: actions/setup-node@v4 + with: + node-version: 22 + registry-url: 'https://registry.npmjs.org' + cache: pnpm + + - name: Install dependencies + run: pnpm install --frozen-lockfile + + - name: Build + run: pnpm build + + - name: Publish to npm + run: pnpm publish --no-git-checks --provenance --access public + env: + NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} diff --git a/README.md b/README.md index 8390f82..e2df1a5 100644 --- a/README.md +++ b/README.md @@ -42,10 +42,13 @@ to clear the token. ## API reference -Every Lichess endpoint is exposed as a named function (`accountMe`, -`apiUsersStatus`, `challengeCreate`, …), fully typed with inline docs from the -spec. See the [Lichess API documentation](https://lichess.org/api) for endpoint -details. +Every Lichess endpoint is exposed as a named function. The name is the +operation's `operationId` from the spec (e.g. `accountMe`, `apiUsersStatus`, +`challengeCreate`), and each function carries the endpoint's summary and +description as JSDoc. + +For a full, searchable index of every generated function and its types, see +[`src/client/sdk.gen.ts`](./src/client/sdk.gen.ts). ## How it stays current diff --git a/package.json b/package.json index 53e2a42..a59d6b9 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "equine", - "version": "1.0.0-alpha.0", + "version": "0.3.0", "description": "Minimal Lichess API Client for Node.js", "main": "./dist/index.js", "types": "./dist/index.d.ts",