Skip to content

Commit e5c9aec

Browse files
authored
Merge pull request #2 from code-yeongyu/npm-publish
Github Release 시에 NPM 에 배포되도록 설정합니다.
2 parents a342fd8 + 8e11d39 commit e5c9aec

File tree

3 files changed

+26
-0
lines changed

3 files changed

+26
-0
lines changed

.github/workflows/ci.yml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,9 +20,15 @@ jobs:
2020

2121
- name: Install Dependencies
2222
run: yarn --immutable
23+
env:
24+
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
25+
# because of .npmrc for supporting npm publish using github action
2326

2427
- name: Test
2528
run: yarn test:cov
29+
env:
30+
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
31+
# because of .npmrc for supporting npm publish using github action
2632

2733
- name: Upload Code Coverage
2834
run: bash <(curl -s https://codecov.io/bash)

.github/workflows/publish.yml

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
name: Publish Package to npmjs
2+
on:
3+
release:
4+
types: [created]
5+
jobs:
6+
build:
7+
runs-on: ubuntu-latest
8+
steps:
9+
- uses: actions/checkout@v2
10+
- uses: actions/setup-node@v2
11+
with:
12+
node-version: '16.x'
13+
registry-url: 'https://registry.npmjs.org'
14+
- run: yarn
15+
- run: yarn publish
16+
env:
17+
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}

.npmrc

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
//registry.npmjs.org/:_authToken=${NODE_AUTH_TOKEN}
2+
registry=https://registry.npmjs.org/
3+
always-auth=true

0 commit comments

Comments
 (0)