Skip to content

Commit dde66dc

Browse files
authored
feat: add GitHub Actions workflow for npm publishing (#2)
- Add .github/workflows/publish.yml triggered on v* tags - Add files array to package.json for explicit npm publish contents - Uses npm provenance for supply chain security - Requires NPM_TOKEN secret in repository
1 parent d3dd4e2 commit dde66dc

2 files changed

Lines changed: 33 additions & 0 deletions

File tree

.github/workflows/publish.yml

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
name: Publish to npm
2+
3+
on:
4+
push:
5+
tags:
6+
- 'v*'
7+
8+
jobs:
9+
publish:
10+
runs-on: ubuntu-latest
11+
12+
permissions:
13+
contents: read
14+
id-token: write
15+
16+
steps:
17+
- name: Checkout repository
18+
uses: actions/checkout@v4
19+
20+
- name: Setup Node.js
21+
uses: actions/setup-node@v4
22+
with:
23+
node-version: '20'
24+
registry-url: 'https://registry.npmjs.org'
25+
26+
- name: Publish to npm
27+
run: npm publish --provenance --access public
28+
env:
29+
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}

package.json

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,10 @@
2020
"import": "./lib/schema.js"
2121
}
2222
},
23+
"files": [
24+
"bin/",
25+
"lib/"
26+
],
2327
"repository": {
2428
"type": "git",
2529
"url": "https://github.com/techdivision/opencode-cli.git"

0 commit comments

Comments
 (0)