Skip to content

Commit 04310b1

Browse files
authored
Create publish.yaml
1 parent f94c123 commit 04310b1

File tree

1 file changed

+39
-0
lines changed

1 file changed

+39
-0
lines changed

.github/workflows/publish.yaml

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
name: Publish to npm
2+
3+
on:
4+
release:
5+
types:
6+
- created
7+
8+
jobs:
9+
publish:
10+
runs-on: ubuntu-latest
11+
12+
steps:
13+
- name: Checkout repository
14+
uses: actions/checkout@v4
15+
16+
- name: Set up Node.js
17+
uses: actions/setup-node@v4
18+
with:
19+
node-version: "20.x"
20+
21+
- name: Install yarn
22+
run: npm install -g yarn
23+
24+
- name: Check cache for packages already installed
25+
uses: actions/cache@v3
26+
with:
27+
path: "**/node_modules"
28+
key: yarn-${{ runner.os }}-${{ hashFiles('**/yarn.lock') }}
29+
30+
- name: Install dependencies
31+
run: yarn install
32+
33+
- name: Build package
34+
run: yarn build
35+
36+
- name: Publish to npm
37+
run: npm publish
38+
env:
39+
NODE_AUTH_TOKEN: ${{ secrets.NPM_PUBLISH_TOKEN }}

0 commit comments

Comments
 (0)