Skip to content

Commit

Permalink
chore: add versioning and changelog generator (#5)
Browse files Browse the repository at this point in the history
* chore: setup changelog and release tags versioning

* chore: PR checklist workflows

* chore: commitlint json
  • Loading branch information
althafdaa authored Jul 7, 2024
1 parent eac4699 commit 5484d81
Show file tree
Hide file tree
Showing 6 changed files with 2,793 additions and 6 deletions.
4 changes: 4 additions & 0 deletions .commitlintrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{
"extends": ["@commitlint/config-conventional"],
"rules": {}
}
77 changes: 77 additions & 0 deletions .github/workflows/pr-checklist.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,77 @@
name: 'PR Checklist'

on:
pull_request:
types:
- opened
- edited
- reopened
- synchronize

permissions:
pull-requests: read

concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true

jobs:
validate-pr-title:
name: Validate PR title
runs-on: ubuntu-latest
steps:
- uses: amannn/action-semantic-pull-request@v5
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
types: |
sync
fix
feat
docs
refactor
perf
test
build
ci
chore
revert
requireScope: false

subjectPattern: ^(?![A-Z]).+$
subjectPatternError: |
The pull request title "{title}" didn't match the required format.
This format won't affect build or deployment (for now).
But it helps maintainers understand changes and commit history in this repo.
Valid formats:
`type: subject`
`type!: subject` <- Use `!` to indicate important/breaking changes
Where subject is: A short description of the change
Where type is: `sync`, `feat`, `fix`, `docs`, `refactor`, `perf`, `test`, `build`, `ci`, `chore`, `revert`
Refer to: https://github.com/commitizen/conventional-commit-types
Examples:
Merging/Syncing between branches:
- `sync: sync dev into master`
Fixing, adding features, or tests:
- `fix: error panic on null`
- `feat: add new migration script`
- `feat: add new module`
- `refactor: refactor circle service`
Other non-production-code changes:
- `test: add new test`
No package-specific changes, or chore/build changes
- `build: update dependencies`
- `ci: add new workflow`
- `chore: update lint caching`
Reversion of a previous commit:
- `revert: revert commit 123456` <- Use the scope of the original commit
4 changes: 4 additions & 0 deletions .husky/commit-msg
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
#!/bin/sh
. "$(dirname "$0")/_/husky.sh"

npx commitlint --edit
67 changes: 66 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,8 @@
"build": "next build",
"start": "next start",
"lint": "next lint",
"typecheck": "tsc --noEmit --incremental"
"typecheck": "tsc --noEmit --incremental",
"release": "release-it"
},
"dependencies": {
"@hookform/resolvers": "^3.6.0",
Expand Down Expand Up @@ -40,6 +41,9 @@
"zustand": "^4.5.2"
},
"devDependencies": {
"@commitlint/cli": "^19.3.0",
"@commitlint/config-conventional": "^19.2.2",
"@release-it/conventional-changelog": "^8.0.1",
"@tanstack/react-query-devtools": "^5.40.1",
"@types/node": "^20",
"@types/qs": "^6.9.15",
Expand All @@ -51,10 +55,71 @@
"eslint-config-prettier": "^9.1.0",
"eslint-plugin-prettier": "^5.1.3",
"eslint-plugin-svg-jsx": "^1.2.4",
"husky": "^9.0.11",
"postcss": "^8",
"prettier": "^3.3.1",
"prettier-plugin-tailwindcss": "^0.6.2",
"release-it": "^17.4.1",
"tailwindcss": "^3.4.1",
"typescript": "^5"
},
"release-it": {
"git": {
"commitMessage": "chore: release v${version}",
"tagName": "v${version}"
},
"github": {
"release": true
},
"npm": {
"publish": false
},
"plugins": {
"@release-it/conventional-changelog": {
"preset": {
"name": "conventionalcommits",
"types": [
{
"type": "feat",
"section": "🔥 Features"
},
{
"type": "fix",
"section": "🪲 Bug Fixes"
},
{
"type": "docs",
"section": "📝 Documentation"
},
{
"type": "refactor",
"section": "📝 Refactors"
},
{
"type": "perf",
"section": "⚡ Performance Improvements"
},
{
"type": "test",
"section": "🧪 Tests"
},
{
"type": "build",
"section": "🛠️ Build System"
},
{
"type": "ci",
"section": "🏃 Continuous Integration"
}
]
},
"infile": "CHANGELOG.md",
"header": "# Changelog\n\nAll notable changes to this project will be documented in this file. See [Conventional Commits](https://www.conventionalcommits.org) for commit guidelines."
}
}
},
"repository": {
"type": "git",
"url": "https://github.com/comimafun/catalog-ui"
}
}
Loading

0 comments on commit 5484d81

Please sign in to comment.