Skip to content

Commit 17ba18a

Browse files
authored
Merge pull request #2 from DopplerHQ/mike/add-npm-publishing
Add NPM publishing
2 parents cca7560 + c30a512 commit 17ba18a

3 files changed

Lines changed: 21 additions & 6 deletions

File tree

.github/workflows/publish.yml

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
name: Publish Package
22

33
on:
4-
# push:
5-
# tags:
6-
# - 'v*'
4+
push:
5+
tags:
6+
- 'v*'
77

88
permissions:
99
id-token: write # Required for OIDC publishing
@@ -18,3 +18,13 @@ jobs:
1818
with:
1919
node-version: "24"
2020
registry-url: "https://registry.npmjs.org"
21+
- name: Set version from tag
22+
run: |
23+
VERSION=${GITHUB_REF#refs/tags/v}
24+
npm pkg set version="$VERSION"
25+
npm pkg set private=false --json
26+
- run: npm ci
27+
- run: npm run build
28+
- name: Verify startup
29+
run: node dist/index.js --help
30+
- run: npm publish --provenance

README.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -235,3 +235,9 @@ pnpm run build
235235
# Run locally
236236
DOPPLER_TOKEN=dp.xxx pnpm start
237237
```
238+
239+
## Branch and Release Flow
240+
241+
New work should branch from main and target main in PRs.
242+
243+
To release, push a tag in the format `vX.X.X` following semantic versioning. This triggers the publish workflow which builds and publishes to NPM.

package.json

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
"main": "dist/index.js",
77
"type": "module",
88
"bin": {
9-
"doppler-mcp": "./bin/doppler-mcp"
9+
"doppler-mcp": "bin/doppler-mcp"
1010
},
1111
"scripts": {
1212
"fetch-openapi": "curl -s https://docs.doppler.com/openapi/core.json -o doppler-openapi.json",
@@ -15,8 +15,7 @@
1515
"dev": "tsx --esm src/index.ts",
1616
"start": "node dist/index.js",
1717
"test": "vitest run",
18-
"test:watch": "vitest",
19-
"prepublishOnly": "npm run build"
18+
"test:watch": "vitest"
2019
},
2120
"files": [
2221
"dist/",

0 commit comments

Comments
 (0)