Skip to content

Commit

Permalink
chore: set up semantic release (#183)
Browse files Browse the repository at this point in the history
* chore: set up semantic release

* chore: set up conventional commits
  • Loading branch information
kettanaito committed Jan 3, 2022
1 parent 3e78b88 commit 7037677
Show file tree
Hide file tree
Showing 6 changed files with 986 additions and 24 deletions.
7 changes: 7 additions & 0 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -42,3 +42,10 @@ jobs:

- name: Tests (typings)
run: yarn test:ts

- name: Release
if: contains(github.ref, 'refs/heads/main')
uses: cycjimmy/semantic-release-action@v2
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
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'],
}
11 changes: 11 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,24 +13,30 @@
"test:ts": "tsc -p test/tsconfig.test-d.json",
"clean": "rimraf ./lib",
"build": "yarn clean && tsc",
"postinstall": "yarn simple-git-hooks init",
"prepublishOnly": "yarn build && yarn test:ts && yarn test"
},
"files": [
"lib",
"README.md"
],
"devDependencies": {
"@commitlint/cli": "^16.0.1",
"@commitlint/config-conventional": "^16.0.0",
"@types/debug": "^4.1.5",
"@types/faker": "^5.5.3",
"@types/jest": "^26.0.22",
"@types/node-fetch": "^2.5.10",
"commitizen": "^4.2.4",
"cz-conventional-changelog": "3.3.0",
"faker": "^5.5.3",
"jest": "^26.6.0",
"msw": "latest",
"node-fetch": "^2.6.1",
"page-with": "^0.4.1",
"prettier": "^2.2.1",
"rimraf": "^3.0.2",
"simple-git-hooks": "^2.7.0",
"ts-jest": "^26.5.5",
"ts-node": "^9.1.1",
"typescript": "4.3.5"
Expand All @@ -52,5 +58,10 @@
},
"optionalDependencies": {
"msw": "latest"
},
"config": {
"commitizen": {
"path": "./node_modules/cz-conventional-changelog"
}
}
}
3 changes: 3 additions & 0 deletions release.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
module.exports = {
branches: ['main'],
}
4 changes: 4 additions & 0 deletions simple-git-hooks.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
module.exports = {
'prepare-commit-msg': `grep -qE '^[^#]' .git/COMMIT_EDITMSG || (exec < /dev/tty && yarn cz --hook || true)`,
'commit-msg': 'yarn commitlint --edit $1',
}
Loading

0 comments on commit 7037677

Please sign in to comment.