Skip to content

Commit c467933

Browse files
committed
Created publish workflow
1 parent deee620 commit c467933

File tree

2 files changed

+33
-1
lines changed

2 files changed

+33
-1
lines changed

.github/workflows/publish.yml

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
name: Publish to npm
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
8+
jobs:
9+
publish:
10+
runs-on: ubuntu-latest
11+
steps:
12+
- name: Checkout Repository
13+
uses: actions/checkout@v4
14+
15+
- name: Use Node.js
16+
uses: actions/setup-node@v4
17+
with:
18+
node-version: '22'
19+
registry-url: 'https://registry.npmjs.org/'
20+
cache: 'npm'
21+
22+
- name: Install Dependencies
23+
run: npm ci
24+
25+
- name: Build package
26+
run: npm run build
27+
28+
- name: Publish to npm
29+
run: npm publish
30+
env:
31+
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}

package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,8 @@
2626
],
2727
"scripts": {
2828
"build": "tsc -b && vite build",
29-
"format": "prettier --write ."
29+
"format": "prettier --write .",
30+
"prepublishOnly": "npm run build"
3031
},
3132
"dependencies": {
3233
"parse5": "^7.3.0"

0 commit comments

Comments
 (0)