get-reading-time 1.3.3 → 1.3.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,58 @@
1
+ name: Publish get-reading-time to npm
2
+
3
+ on:
4
+ # Trigger automatically when pushing to main or master
5
+ push:
6
+ branches:
7
+ - main
8
+ - master
9
+ # Trigger when a GitHub Release is created
10
+ release:
11
+ types: [created]
12
+ # Allow manual trigger from the GitHub Actions tab
13
+ workflow_dispatch:
14
+
15
+ jobs:
16
+ publish:
17
+ runs-on: ubuntu-latest
18
+ permissions:
19
+ contents: read
20
+ packages: write
21
+
22
+ steps:
23
+ - name: Checkout repository
24
+ uses: actions/checkout@v4
25
+
26
+ - name: Setup Node.js
27
+ uses: actions/setup-node@v4
28
+ with:
29
+ node-version: '20' # the node version to use
30
+ registry-url: 'https://registry.npmjs.org'
31
+
32
+ - name: Install dependencies
33
+ run: npm install --legacy-peer-deps --force
34
+
35
+ - name: Build the package
36
+ run: npm run build
37
+
38
+ - name: Publish to NPM
39
+ run: |
40
+ npm publish --access public
41
+ env:
42
+ # This connects the step to the token we'll create in GitHub secrets
43
+ NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
44
+
45
+ - name: Setup Node.js for GitHub Packages
46
+ uses: actions/setup-node@v4
47
+ with:
48
+ node-version: '20'
49
+ registry-url: 'https://npm.pkg.github.com'
50
+
51
+ - name: Publish to GitHub Packages
52
+ run: |
53
+ # GitHub Packages requires the package name to be scoped to the repository owner
54
+ npm pkg set name="@nurahmed123/get-reading-time"
55
+ npm publish
56
+ env:
57
+ # The GITHUB_TOKEN is automatically provided by GitHub Actions!
58
+ NODE_AUTH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "get-reading-time",
3
- "version": "1.3.3",
3
+ "version": "1.3.5",
4
4
  "main": "/dist/index.js",
5
5
  "module": "/dist/index.mjs",
6
6
  "types": "/dist/index.d.ts",
@@ -9,14 +9,14 @@
9
9
  "start": "node dist/test.js",
10
10
  "lint": "tsc",
11
11
  "prepare": "npm run build"
12
- },
12
+ },
13
13
  "repository": {
14
14
  "type": "git",
15
15
  "url": "git+https://github.com/nurahmed123/get-reading-time.git",
16
16
  "license": "https://github.com/nurahmed123/get-reading-time/blob/main/LICENSE"
17
17
  },
18
18
  "publishConfig": {
19
- "registry": "https://www.npmjs.com/package/get-reading-time"
19
+ "access": "public"
20
20
  },
21
21
  "keywords": [
22
22
  "get-reading-time",