Skip to content

Commit be0336e

Browse files
committed
feat\!: integrate semantic-release using github actions ci/cd
1 parent 0ebf053 commit be0336e

File tree

3 files changed

+67
-3
lines changed

3 files changed

+67
-3
lines changed

.github/workflows/release.yml

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
name: 🚀 Semantic Release
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
8+
permissions:
9+
contents: write
10+
issues: write
11+
pull-requests: write
12+
13+
jobs:
14+
release:
15+
runs-on: ubuntu-latest
16+
17+
steps:
18+
- name: Checkout
19+
uses: actions/checkout@v4
20+
with:
21+
fetch-depth: 0 # semantic-release needs full commit history
22+
23+
- name: Setup Node
24+
uses: actions/setup-node@v4
25+
with:
26+
node-version: 20
27+
28+
- name: Run Semantic Release
29+
run: yarn dlx semantic-release
30+
env:
31+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

.releaserc.json

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
{
2+
"branches": ["main"],
3+
"plugins": [
4+
"@semantic-release/commit-analyzer",
5+
"@semantic-release/release-notes-generator",
6+
"@semantic-release/changelog",
7+
[
8+
"@semantic-release/npm",
9+
{
10+
"npmPublish": false
11+
}
12+
],
13+
[
14+
"@semantic-release/git",
15+
{
16+
"assets": ["CHANGELOG.md", "package.json"],
17+
"message": "🔖 release: ${nextRelease.version} [skip ci]"
18+
}
19+
],
20+
"@semantic-release/github"
21+
]
22+
}

package.json

Lines changed: 14 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,20 +8,31 @@
88
"github": "https://github.com/Rahad-Ullah"
99
},
1010
"license": "ISC",
11-
"keywords": ["node", "express", "typescript", "mongodb", "mongoose", "rest api", "template"],
11+
"keywords": [
12+
"node",
13+
"express",
14+
"typescript",
15+
"mongodb",
16+
"mongoose",
17+
"rest api",
18+
"template"
19+
],
1220
"main": "index.js",
1321
"scripts": {
1422
"dev": "ts-node-dev --respawn --transpile-only src/dev-server.ts",
1523
"start": "node dist/server.js",
1624
"build": "tsc",
1725
"cm": "ts-node ./src/cm.ts",
1826
"lint:check": "eslint --ignore-path .eslintignore --ext .js,.ts",
19-
"lint:fix": "lint . --fix",
27+
"lint:fix": "eslint --fix",
2028
"prettier:check": "prettier --ignore-path .gitignore --write \"**/*.+(js|ts|json)\"",
2129
"prettier:fix": "prettier --write .",
2230
"test": "echo \"Error: no test specified\" && exit 1"
2331
},
2432
"devDependencies": {
33+
"@semantic-release/changelog": "^6.0.3",
34+
"@semantic-release/git": "^10.0.1",
35+
"@semantic-release/github": "^12.0.1",
2536
"@types/bcrypt": "^5.0.2",
2637
"@types/bcryptjs": "^2.4.6",
2738
"@types/cors": "^2.8.17",
@@ -34,6 +45,7 @@
3445
"@typescript-eslint/parser": "^7.15.0",
3546
"eslint": "^8.56.0",
3647
"eslint-config-prettier": "^9.1.0",
48+
"semantic-release": "^24.2.9",
3749
"ts-node-dev": "^2.0.0",
3850
"typescript": "^5.5.3"
3951
},
@@ -50,7 +62,6 @@
5062
"morgan": "^1.10.0",
5163
"multer": "^1.4.5-lts.1",
5264
"nodemailer": "^7.0.10",
53-
"npm": "^10.8.1",
5465
"socket.io": "^4.7.5",
5566
"winston": "^3.13.0",
5667
"winston-daily-rotate-file": "^5.0.0",

0 commit comments

Comments
 (0)