-
Notifications
You must be signed in to change notification settings - Fork 0
48 lines (37 loc) · 1.14 KB
/
publish.yml
File metadata and controls
48 lines (37 loc) · 1.14 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
name: Publish to npm
on:
push:
tags:
- 'v*' # Triggers on version tags like v1.0.0, v0.1.1, etc.
workflow_dispatch: # Allows manual triggering
permissions:
contents: read
id-token: write # Required for OIDC authentication with npm
jobs:
publish:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: '18'
registry-url: 'https://registry.npmjs.org'
- name: Install dependencies
run: npm ci
- name: Run linting
run: npm run lint
- name: Run type checking
run: npm run type-check
- name: Build package
run: npm run build
- name: Test CLI functionality
run: |
# Create a minimal test export file
echo '{"id":1,"name":"Test","type":"personal_chat","messages":[]}' > test-export.json
npm run parse-export test-export.json --stats-only
- name: Publish to npm
run: npm publish --provenance --access public
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}