File tree Expand file tree Collapse file tree 2 files changed +35
-8
lines changed
Expand file tree Collapse file tree 2 files changed +35
-8
lines changed Original file line number Diff line number Diff line change 1+ name : Publish to npm
2+
3+ on :
4+ push :
5+ tags :
6+ - ' v*' # Only trigger when a version tag (e.g., v1.0.0) is pushed
7+
8+ jobs :
9+ publish :
10+ runs-on : ubuntu-latest
11+
12+ steps :
13+ - name : Checkout repository
14+ uses : actions/checkout@v4
15+ with :
16+ fetch-depth : 0 # Ensure we fetch all tags
17+
18+ - name : Set up Node.js
19+ uses : actions/setup-node@v4
20+ with :
21+ node-version : 18
22+ registry-url : https://registry.npmjs.org/
23+
24+ - name : Install dependencies
25+ run : npm install
26+
27+ - name : Build package
28+ run : npm run build
29+
30+ - name : Publish to npm
31+ run : npm publish --access public
32+ env :
33+ NODE_AUTH_TOKEN : ${{ secrets.NPM_TOKEN }}
Original file line number Diff line number Diff line change 11name : Run Tests
22
3- # Trigger the workflow on push or pull request
43on :
54 push :
65 branches :
98 branches :
109 - main
1110
12- # Define the jobs to run
1311jobs :
1412 test :
15- # Use the latest Ubuntu environment
1613 runs-on : ubuntu-latest
1714
18- # Define the steps for this job
1915 steps :
20- # Checkout the repository
2116 - name : Checkout code
2217 uses : actions/checkout@v3
2318
24- # Set up Node.js
2519 - name : Set up Node.js
26- uses : actions/setup-node@v3
20+ uses : actions/setup-node@v4
2721 with :
28- node-version : 18 # Specify your required Node.js version
22+ node-version : 18
2923
3024 - name : Install dependencies
3125 run : npm install
You can’t perform that action at this time.
0 commit comments