Skip to content

Commit

Permalink
feat: add semantic versioning to Github actions (#13)
Browse files Browse the repository at this point in the history
* feat: add commitlint

* feat: add semantic-release
  • Loading branch information
krshnpatel committed Sep 29, 2023
1 parent cfcc6df commit 30a87bd
Show file tree
Hide file tree
Showing 5 changed files with 6,157 additions and 1,633 deletions.
6 changes: 3 additions & 3 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ jobs:
registry-url: 'https://registry.npmjs.org'
- run: yarn
- run: yarn build
- run: npm version ${{ github.event.release.tag_name }}
- run: yarn npm publish
- run: npx semantic-release
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
4 changes: 4 additions & 0 deletions .husky/commit-msg
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
#!/usr/bin/env sh
. "$(dirname -- "$0")/_/husky.sh"

yarn commitlint ${1}
3 changes: 3 additions & 0 deletions commitlint.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
module.exports = {
extends: ['@commitlint/config-conventional'],
};
6 changes: 5 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,13 +23,16 @@
"start": "watch 'yarn update:local' ./src",
"lint": "eslint src/",
"lint:fix": "eslint src/ --fix",
"prepare": "husky install"
"prepare": "husky install",
"commitlint": "commitlint --edit"
},
"lint-staged": {
"*.{ts,tsx}": "yarn lint:fix",
"*.{ts,tsx,js,css,md}": "prettier --write"
},
"devDependencies": {
"@commitlint/cli": "^17.7.2",
"@commitlint/config-conventional": "^17.7.0",
"@types/eslint": "^8",
"@types/watch": "^1",
"@typescript-eslint/eslint-plugin": "latest",
Expand All @@ -41,6 +44,7 @@
"husky": "^8.0.3",
"lint-staged": "^13.2.3",
"prettier": "^3.0.0",
"semantic-release": "^22.0.5",
"typescript": "^5.1.6",
"watch": "^1.0.2"
},
Expand Down

0 comments on commit 30a87bd

Please sign in to comment.