File tree Expand file tree Collapse file tree 2 files changed +27
-4
lines changed
Expand file tree Collapse file tree 2 files changed +27
-4
lines changed Original file line number Diff line number Diff line change @@ -3,6 +3,10 @@ name: Node.js Package
33on :
44 release :
55 types : [created]
6+ push :
7+ branches : [ main ]
8+ tags : [ 'v*' ]
9+ workflow_dispatch : # 수동으로 워크플로우 실행 가능
610
711jobs :
812 build :
@@ -19,14 +23,33 @@ jobs:
1923 publish-npm :
2024 needs : build
2125 runs-on : ubuntu-latest
26+
27+ # 태그 푸시나 릴리스 생성 또는 수동 트리거에서만 배포
28+ if : github.event_name == 'release' || github.event_name == 'workflow_dispatch' || startsWith(github.ref, 'refs/tags/v')
29+
2230 steps :
2331 - uses : actions/checkout@v3
2432 - uses : actions/setup-node@v3
2533 with :
2634 node-version : 18
2735 registry-url : https://registry.npmjs.org/
28- - run : npm ci
29- - run : npm run build
30- - run : npm publish --access=public
36+ cache : ' npm'
37+
38+ # 의존성 설치 및 빌드
39+ - name : Install dependencies
40+ run : npm ci
41+
42+ - name : Build
43+ run : npm run build
44+
45+ # 배포 전 버전 확인 및 로그
46+ - name : Version check
47+ run : |
48+ echo "Deploying version $(npm pkg get version | tr -d '\"')"
49+ npm pkg get version | tr -d '\"' | grep -E '^[0-9]+\.[0-9]+\.[0-9]+$' || (echo "Invalid version format" && exit 1)
50+
51+ # NPM에 배포
52+ - name : Publish to npm
53+ run : npm publish --access=public
3154 env :
3255 NODE_AUTH_TOKEN : ${{secrets.NPM_TOKEN}}
Original file line number Diff line number Diff line change 1111 "build" : " tsc" ,
1212 "start" : " node dist/index.js" ,
1313 "dev" : " tsx src/index.ts" ,
14- "test" : " echo \" Error: no test specified\" && exit 1 "
14+ "test" : " echo \" No tests specified\" && exit 0 "
1515 },
1616 "keywords" : [
1717 " ccxt" ,
You can’t perform that action at this time.
0 commit comments