Skip to content

Commit

Permalink
feat: add husky & add release automation
Browse files Browse the repository at this point in the history
  • Loading branch information
swiiny committed Jan 1, 2024
1 parent aca9d08 commit fd23338
Show file tree
Hide file tree
Showing 12 changed files with 145 additions and 36,541 deletions.
29 changes: 29 additions & 0 deletions .github/workflows/.releaserc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
{
"branches": ["main", { "name": "develop", "prerelease": true }],
"plugins": [
[
"@semantic-release/commit-analyzer",
{
"preset": "angular",
"releaseRules": [
{ "type": "feat", "section": "✨ Features", "release": "minor" },
{ "type": "fix", "section": "🐛 Bug Fixes", "release": "patch" },
{ "type": "chore", "section": "🧹 Maintenance", "release": "patch" },
{ "type": "docs", "hidden": true, "release": "patch" },
{ "type": "style", "hidden": true, "release": "patch" },
{ "type": "refactor", "section": "♻️ Refactor", "release": "patch" },
{ "type": "perf", "hidden": true, "release": "patch" },
{ "type": "test", "hidden": true, "release": "patch" }
],
"parserOpts": {
"noteKeywords": ["BREAKING CHANGE", "BREAKING CHANGES"]
}
}
],
"@semantic-release/release-notes-generator",
"@semantic-release/changelog",
"@semantic-release/npm",
"@semantic-release/git",
"@semantic-release/github"
]
}
37 changes: 37 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
name: Release

on:
push:
branches:
- main
- develop

permissions:
contents: write
pull-requests: write

jobs:
create-release:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4

- name: Semantic Release
uses: cycjimmy/semantic-release-action@v4
id: semantic
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

- name: Set up Node.js
uses: actions/setup-node@v3
with:
node-version: '18'

- name: Install dependencies
run: npm install @octokit/rest

- name: Rename release
run: node scripts/rename_release.js
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -34,3 +34,5 @@ yarn-error.log*

# typescript
*.tsbuildinfo

package-lock.json
3 changes: 2 additions & 1 deletion .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -44,5 +44,6 @@
},
"[css]": {
"editor.defaultFormatter": "esbenp.prettier-vscode"
}
},
"cSpell.words": ["nextjs", "swiiny"]
}
3 changes: 3 additions & 0 deletions commitlint.config.cjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
module.exports = {
extends: ['@commitlint/config-conventional']
};
11 changes: 10 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,15 @@
"dev:tailwind": "cd ./packages/tailwind && npm run dev",
"dev:sc": "npm run dev:styled-components",
"dev:styled-components": "cd ./packages/styled-components && npm run dev",
"build": "node scripts/build.js"
"build": "node scripts/build.js",
"husky": "husky install"
},
"devDependencies": {
"@commitlint/cli": "^17.8.1",
"@commitlint/config-conventional": "^17.8.0",
"@semantic-release/changelog": "^6.0.3",
"@semantic-release/github": "^9.2.6",
"husky": "^8.0.3",
"semantic-release": "^22.0.12"
}
}
Loading

0 comments on commit fd23338

Please sign in to comment.