Skip to content

Commit a771abf

Browse files
committed
Automate publishing to npm
1 parent bf1581a commit a771abf

File tree

3 files changed

+30
-1
lines changed

3 files changed

+30
-1
lines changed

.github/workflows/build.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,11 @@
11
name: Build
2+
23
on:
34
pull_request:
45
branches: [main]
56
push:
67
branches: [main]
8+
79
jobs:
810
build:
911
name: Lint and tests

.github/workflows/publish.yml

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
name: Publish
2+
3+
on:
4+
push:
5+
tags:
6+
- 'v*'
7+
8+
permissions:
9+
id-token: write
10+
contents: read
11+
12+
jobs:
13+
publish:
14+
runs-on: ubuntu-latest
15+
steps:
16+
- uses: actions/checkout@v6
17+
- uses: actions/setup-node@v6
18+
with:
19+
node-version: lts/*
20+
registry-url: https://registry.npmjs.org
21+
- run: npm ci
22+
- run: npm run lint
23+
- run: npm test
24+
- run: npm publish

package.json

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,10 @@
88
"version": "4.0.0",
99
"author": "Domenic Denicola <d@domenic.me> (https://domenic.me/)",
1010
"license": "MIT",
11-
"repository": "jsdom/html-encoding-sniffer",
11+
"repository": {
12+
"type": "git",
13+
"url": "git+https://github.com/jsdom/html-encoding-sniffer.git"
14+
},
1215
"main": "lib/html-encoding-sniffer.js",
1316
"files": [
1417
"lib/"

0 commit comments

Comments
 (0)