Skip to content

Commit d9320f3

Browse files
Add script for publishing to npm
1 parent 78b33d8 commit d9320f3

File tree

2 files changed

+48
-0
lines changed

2 files changed

+48
-0
lines changed

.github/workflows/publish.yml

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
# From https://docs.github.com/en/actions/tutorials/publish-packages/publish-nodejs-packages#publishing-packages-to-the-npm-registry
2+
3+
name: Publish Package to npmjs
4+
on:
5+
release:
6+
types: [published]
7+
jobs:
8+
build:
9+
runs-on: ubuntu-latest
10+
permissions:
11+
contents: read
12+
id-token: write
13+
steps:
14+
- uses: actions/checkout@v5
15+
- uses: actions/setup-node@v4
16+
with:
17+
node-version: '20.x'
18+
registry-url: 'https://registry.npmjs.org'
19+
- run: npm ci
20+
- run: npm publish --provenance --access public
21+
env:
22+
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}

package.json

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
{
2+
"name": "@samuelbradshaw/highlight-helper-js",
3+
"version": "0.7.0",
4+
"description": "JavaScript tool that enables highlighting or underlining text in an HTML page.",
5+
"main": "highlight-helper.js",
6+
"repository": {
7+
"type": "git",
8+
"url": "git+https://github.com/samuelbradshaw/highlight-helper-js.git"
9+
},
10+
"keywords": [
11+
"css",
12+
"svg",
13+
"marking",
14+
"colors",
15+
"highlighting",
16+
"text-selection",
17+
"underlined-text",
18+
"highlight-api"
19+
],
20+
"author": "Samuel Bradshaw <[email protected]>",
21+
"license": "MIT",
22+
"bugs": {
23+
"url": "https://github.com/samuelbradshaw/highlight-helper-js/issues"
24+
},
25+
"homepage": "https://github.com/samuelbradshaw/highlight-helper-js#readme"
26+
}

0 commit comments

Comments
 (0)