Skip to content

Commit 2bd85b6

Browse files
committed
chore(ci): add NPM auto-publish workflow
1 parent 51a7fba commit 2bd85b6

2 files changed

Lines changed: 39 additions & 0 deletions

File tree

.github/workflows/npm-publish.yml

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
name: Publish to NPM
2+
3+
on:
4+
push:
5+
branches: [main]
6+
7+
jobs:
8+
publish:
9+
runs-on: ubuntu-latest
10+
permissions:
11+
contents: write
12+
id-token: write
13+
steps:
14+
- uses: actions/checkout@v4
15+
with:
16+
token: ${{ secrets.GITHUB_TOKEN }}
17+
18+
- uses: actions/setup-node@v4
19+
with:
20+
node-version: '20'
21+
registry-url: 'https://registry.npmjs.org'
22+
23+
- run: npm ci
24+
- run: npm run postinstall
25+
26+
- name: Bump patch version
27+
run: |
28+
git config user.name "github-actions[bot]"
29+
git config user.email "github-actions[bot]@users.noreply.github.com"
30+
npm version patch -m "chore: bump version to %s [skip ci]"
31+
32+
- name: Build with remote save enabled
33+
run: VITE_REMOTE_SERVER_URL= VITE_ENABLE_REMOTE_SAVE=true npm run build
34+
35+
- run: npm publish --provenance --access public
36+
37+
- name: Push version bump
38+
run: git push --follow-tags

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
"name": "volview",
33
"version": "4.4.0",
44
"type": "module",
5+
"files": ["dist", "src"],
56
"scripts": {
67
"dev": "cross-env VITE_SHOW_SAMPLE_DATA=true vite",
78
"preview": "vite preview",

0 commit comments

Comments
 (0)