Skip to content

Commit

Permalink
refactor npm-publish workflow.
Browse files Browse the repository at this point in the history
  • Loading branch information
mehdikhody committed Oct 8, 2024
1 parent 728a9fa commit 692012d
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 10 deletions.
14 changes: 6 additions & 8 deletions .github/workflows/npm-publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -40,20 +40,18 @@ 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
with:
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}}
1 change: 0 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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 ."
Expand Down
2 changes: 1 addition & 1 deletion tsconfig.build.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{
"extends": "./tsconfig.json",
"exclude": ["test"]
"exclude": ["tests"]
}

0 comments on commit 692012d

Please sign in to comment.