Skip to content

Commit e316938

Browse files
authored
Create release.yml
1 parent f7299c9 commit e316938

File tree

1 file changed

+34
-0
lines changed

1 file changed

+34
-0
lines changed

.github/workflows/release.yml

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
name: Release
2+
3+
on:
4+
push:
5+
tags:
6+
- 'v*.*.*'
7+
8+
jobs:
9+
release:
10+
runs-on: ubuntu-latest
11+
permissions:
12+
id-token: write # Grant write access to id-token permission
13+
14+
env:
15+
NODE_VERSION: '20' # Directly set to your current Node.js version
16+
17+
steps:
18+
- uses: actions/checkout@v4
19+
20+
- name: Set up Node.js
21+
uses: actions/setup-node@v4
22+
with:
23+
node-version: ${{ env.NODE_VERSION }} # Use the environment variable for the Node version
24+
25+
- name: Authenticate with npm
26+
run: npm set //registry.npmjs.org/:_authToken=${{ secrets.NPM_TOKEN }}
27+
28+
- name: Install dependencies
29+
run: npm install
30+
31+
- name: Publish to npm
32+
run: npm publish
33+
env:
34+
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}

0 commit comments

Comments
 (0)