Skip to content

Commit 02688b9

Browse files
ci: switch to conventionalcommits preset for semantic-release (#1020)
1 parent cf33b5f commit 02688b9

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
@@ -55,6 +55,7 @@
5555
"atob": "^2.1.2",
5656
"chai": "^4.1.2",
5757
"conventional-changelog": "~1.1.0",
58+
"conventional-changelog-conventionalcommits": "^9.3.0",
5859
"eslint": "^4.19.1",
5960
"husky": "^9.1.7",
6061
"mocha": "^5.2.0",

0 commit comments

Comments
 (0)