From 692012da3936d4df06859a0ea4bb90f14ad61a2c Mon Sep 17 00:00:00 2001 From: Mehdikhody Date: Tue, 8 Oct 2024 14:35:50 +0330 Subject: [PATCH] refactor npm-publish workflow. --- .github/workflows/npm-publish.yml | 14 ++++++-------- package.json | 1 - tsconfig.build.json | 2 +- 3 files changed, 7 insertions(+), 10 deletions(-) diff --git a/.github/workflows/npm-publish.yml b/.github/workflows/npm-publish.yml index 8e69432..16f3179 100644 --- a/.github/workflows/npm-publish.yml +++ b/.github/workflows/npm-publish.yml @@ -40,6 +40,8 @@ jobs: echo "$output" webBasePath=$(echo "$output" | grep -oP 'webBasePath: \K\S+' | sed 's|^/||;s|/$||') sed -i "s|const webBasePath = \".*\";|const webBasePath = \"$webBasePath\";|g" tests/utils/api.ts + + echo "Web Path: $webBasePath" - name: Setup Node.js uses: actions/setup-node@v3 @@ -47,13 +49,9 @@ jobs: node-version: 18 registry-url: 'https://registry.npmjs.org/' - - name: Install Dependencies - run: npm ci - - - name: Run Tests - run: npm test - - - name: Publish to NPM - run: npm publish + - run: npm ci + - run: npm test + - run: npm run build + - run: npm publish env: NODE_AUTH_TOKEN: ${{secrets.npm_token}} diff --git a/package.json b/package.json index 0e457d4..fa85b17 100644 --- a/package.json +++ b/package.json @@ -11,7 +11,6 @@ "url": "https://github.com/mehdikhody" }, "scripts": { - "prepublish": "npm run build", "build": "tsc -p tsconfig.build.json && resolve-tspaths", "format": "prettier --write .", "test": "vitest ." diff --git a/tsconfig.build.json b/tsconfig.build.json index 86f95f3..65641ad 100644 --- a/tsconfig.build.json +++ b/tsconfig.build.json @@ -1,4 +1,4 @@ { "extends": "./tsconfig.json", - "exclude": ["test"] + "exclude": ["tests"] }