Skip to content

Commit

Permalink
feat(ci): add commitizen and husky
Browse files Browse the repository at this point in the history
  • Loading branch information
javierguzman committed Jun 23, 2023
1 parent 328a393 commit 3b7df61
Show file tree
Hide file tree
Showing 4 changed files with 335 additions and 44 deletions.
22 changes: 14 additions & 8 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ jobs:
run: yarn install --frozen-lockfile --network-timeout 300000 # sometimes yarn takes time, therefore, we increase the timeout
- run: yarn run test

release:
build:
runs-on: ${{ matrix.os }}
needs: [testing]
permissions:
Expand Down Expand Up @@ -116,13 +116,19 @@ jobs:
APPLE_TEAM_ID: ${{ secrets.APPLE_TEAM_ID }}
run: yarn run make

release:
needs: [build]
runs-on: ubuntu-latest
permissions:
contents: write # to be able to publish a GitHub release
issues: write # to be able to comment on released issues
pull-requests: write # to be able to comment on released pull requests

strategy:
fail-fast: false

steps:
- name: Run semantic-release
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: npx semantic-release
# - name:
# env:
# GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
# run: yarn run semantic-release

# we need another job to deploy the release
run: npx semantic-release --branches main
4 changes: 4 additions & 0 deletions .husky/prepare-commit-msg
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
#!/usr/bin/env sh
. "$(dirname -- "$0")/_/husky.sh"

exec < /dev/tty && npx cz --hook || true
11 changes: 10 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,9 @@
"publish": "electron-forge publish",
"lint": "eslint --ext .ts,.tsx,.js,.jsx .",
"prettier": "prettier --write \"./**/*.{js,json,css,scss,md}\"",
"test": "vitest run"
"test": "vitest run",
"commit": "cz",
"prepare": "husky install"
},
"keywords": [
"dygma",
Expand Down Expand Up @@ -66,6 +68,7 @@
"babel-loader": "^9.1.2",
"copy-webpack-plugin": "^11.0.0",
"css-loader": "^6.0.0",
"cz-conventional-changelog": "^3.3.0",
"electron": "^25.1.1",
"electron-devtools-installer": "^3.2.0",
"eslint": "^8.0.1",
Expand All @@ -82,6 +85,7 @@
"fork-ts-checker-webpack-plugin": "^7.2.13",
"glob": "^10.2.7",
"html-webpack-plugin": "^5.5.1",
"husky": "^8.0.3",
"node-loader": "^2.0.0",
"prettier": "^2.8.8",
"semantic-release": "^21.0.5",
Expand Down Expand Up @@ -140,5 +144,10 @@
}
]
}
},
"config": {
"commitizen": {
"path": "./node_modules/cz-conventional-changelog"
}
}
}
Loading

0 comments on commit 3b7df61

Please sign in to comment.