Skip to content

Commit 5f7133f

Browse files
ci: switch to conventionalcommits preset for semantic-release (#118)
1 parent 1e07b1b commit 5f7133f

3 files changed

Lines changed: 16 additions & 4 deletions

File tree

‎.github/workflows/prepare-release.yml‎

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,8 @@ jobs:
3737
env:
3838
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
3939
run: |
40-
NEXT_VERSION=$(npx semantic-release --dry-run --plugins @semantic-release/commit-analyzer | tee /dev/stderr | awk '/The next release version is/{print $NF}')
40+
# Run semantic-release with dry-run to detect version
41+
NEXT_VERSION=$(npx semantic-release --dry-run --verify-conditions false | tee /dev/stderr | awk '/The next release version is/{print $NF}')
4142
echo "next=$NEXT_VERSION" >> $GITHUB_OUTPUT
4243
4344
- name: Update package.json
@@ -48,7 +49,7 @@ jobs:
4849

4950
- name: Update CHANGELOG.md
5051
if: steps.version.outputs.next != ''
51-
run: npx conventional-changelog-cli -p angular -i CHANGELOG.md -s
52+
run: npx conventional-changelog-cli -p conventionalcommits -i CHANGELOG.md -s
5253

5354
- name: Create Pull Request
5455
if: steps.version.outputs.next != ''

‎.releaserc.json‎

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,18 @@
33
"master"
44
],
55
"plugins": [
6-
"@semantic-release/commit-analyzer",
7-
"@semantic-release/release-notes-generator",
6+
[
7+
"@semantic-release/commit-analyzer",
8+
{
9+
"preset": "conventionalcommits"
10+
}
11+
],
12+
[
13+
"@semantic-release/release-notes-generator",
14+
{
15+
"preset": "conventionalcommits"
16+
}
17+
],
818
[
919
"@semantic-release/npm",
1020
{

‎package.json‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,7 @@
3939
"@commitlint/cli": "^20.3.1",
4040
"@commitlint/config-conventional": "^20.3.1",
4141
"@semantic-release/exec": "^7.0.3",
42+
"conventional-changelog-conventionalcommits": "^9.3.0",
4243
"husky": "^9.1.7",
4344
"semantic-release": "^25.0.2",
4445
"semver": "^5.1.0",

0 commit comments

Comments
 (0)