-
Notifications
You must be signed in to change notification settings - Fork 2
39 lines (32 loc) · 941 Bytes
/
.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
name: Publish to npm
on:
push:
branches:
- main # main 브랜치로 머지될 때 트리거
jobs:
publish:
name: Publish npm Package
runs-on: ubuntu-latest
steps:
# 1. store checkout
- name: Checkout code
uses: actions/checkout@v3
# 2. Node.js install
- name: Setup Node.js
uses: actions/setup-node@v3
with:
node-version: 18 # 원하는 Node.js 버전
cache: 'npm'
# 3. install dependencies
- name: Install dependencies
run: npm ci
# 4. npm login
- name: Authenticate with npm
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
run: echo "//registry.npmjs.org/:_authToken=\${NODE_AUTH_TOKEN}" > ~/.npmrc
# 5. update version and publish
- name: Publish package
run: |
npm version patch -m "Release v%s [skip ci]" # 버전 업데이트
npm publish