Skip to content

Commit 0f28d8c

Browse files
committed
Fix: 배포 문제 해결중
1 parent fc3163f commit 0f28d8c

File tree

2 files changed

+27
-4
lines changed

2 files changed

+27
-4
lines changed

.github/workflows/npm-publish.yml

Lines changed: 26 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,10 @@ name: Node.js Package
33
on:
44
release:
55
types: [created]
6+
push:
7+
branches: [ main ]
8+
tags: [ 'v*' ]
9+
workflow_dispatch: # 수동으로 워크플로우 실행 가능
610

711
jobs:
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}}

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
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",

0 commit comments

Comments
 (0)