Skip to content

Commit

Permalink
ci(github-action): improve and deploy npm package to directly to npm
Browse files Browse the repository at this point in the history
  • Loading branch information
susanta96 committed Jun 8, 2023
1 parent a0b590a commit c1885bb
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 1 deletion.
16 changes: 16 additions & 0 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,3 +25,19 @@ jobs:
cache: "npm"
- run: npm ci
- run: npm test --if-present
publish:
runs-on: ubuntu-latest
if: ${{github.ref == 'refs/heads/main'}}
needs: [quality]
steps:
- uses: actions/checkout@v3
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node-version }}
cache: "npm"
- run: npm ci
- run: npm run semantic-release
env:
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,8 @@
"lint:fix": "eslint . --fix",
"lint:watch": "esw -w lib/**",
"publish": "npm publish",
"semantic-release": "semantic-release --branches main"
"semantic-release": "semantic-release --branches main",
"acp": "git add . && npm run commit && git push"
},
"config": {
"commitizen": {
Expand Down

0 comments on commit c1885bb

Please sign in to comment.