Skip to content

Commit 0fefde2

Browse files
author
Renato Pozzi
committed
ci: add semantic-release
1 parent 6a4a0ad commit 0fefde2

4 files changed

Lines changed: 1302 additions & 15 deletions

File tree

.github/workflows/release.yml

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
name: Release
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
- dev
8+
9+
jobs:
10+
release:
11+
runs-on: ubuntu-latest
12+
steps:
13+
- name: Checkout
14+
uses: actions/checkout@v3
15+
with:
16+
fetch-depth: 0
17+
persist-credentials: false
18+
19+
- uses: pnpm/action-setup@v3
20+
with:
21+
version: 8
22+
23+
- name: Setup Node.js
24+
uses: actions/setup-node@v3
25+
with:
26+
node-version: 18
27+
28+
- name: Install dependencies
29+
run: pnpm i
30+
31+
- name: Semantic Release
32+
env:
33+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
34+
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
35+
run: pnpm run lib:release

libs/react-plock/.releaserc

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
{
2+
"branches": [
3+
"main",
4+
{
5+
"name": "dev",
6+
"prerelease": true
7+
}
8+
],
9+
"plugins": [
10+
"@semantic-release/commit-analyzer",
11+
"@semantic-release/release-notes-generator",
12+
"@semantic-release/npm",
13+
"@semantic-release/github"
14+
]
15+
}

libs/react-plock/package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424
"lib:bump:dev": "changelogen --bump --prerelease dev",
2525
"lib:publish": "changelogen --publish",
2626
"lib:publish:dev": "npm publish react-plock --tag dev",
27-
"lib:release": "changelogen --release",
27+
"lib:release": "semantic-release",
2828
"build": "tsup index.ts --dts --minify"
2929
},
3030
"bugs": {
@@ -38,6 +38,7 @@
3838
"@types/react": "^18.0.28",
3939
"changelogen": "^0.5.5",
4040
"jest": "^29.4.3",
41+
"semantic-release": "^22.0.12",
4142
"ts-jest": "^29.0.5"
4243
}
4344
}

0 commit comments

Comments
 (0)