From 6076e52cdf242d3f95e9c2d37a75625954b08ff2 Mon Sep 17 00:00:00 2001 From: Samuel Salazar Date: Mon, 27 Apr 2026 16:27:48 -0500 Subject: [PATCH] ci: switch to conventionalcommits preset for semantic-release --- .github/workflows/prepare-release.yml | 4 +-- .releaserc.json | 14 ++++++++-- package-lock.json | 39 ++++++++++++++++++++++----- package.json | 1 + 4 files changed, 47 insertions(+), 11 deletions(-) diff --git a/.github/workflows/prepare-release.yml b/.github/workflows/prepare-release.yml index 8a514f3..f7a54d0 100644 --- a/.github/workflows/prepare-release.yml +++ b/.github/workflows/prepare-release.yml @@ -38,8 +38,8 @@ jobs: env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} run: | - # Run semantic-release with only commit analyzer to detect version - NEXT_VERSION=$(npx semantic-release --dry-run --plugins @semantic-release/commit-analyzer | tee /dev/stderr | awk '/The next release version is/{print $NF}') + # Run semantic-release with dry-run to detect version + NEXT_VERSION=$(npx semantic-release --dry-run --verify-conditions false | tee /dev/stderr | awk '/The next release version is/{print $NF}') echo "next=$NEXT_VERSION" >> $GITHUB_OUTPUT - name: Update package.json diff --git a/.releaserc.json b/.releaserc.json index 0fb60c6..60e758e 100644 --- a/.releaserc.json +++ b/.releaserc.json @@ -1,8 +1,18 @@ { "branches": ["master"], "plugins": [ - "@semantic-release/commit-analyzer", - "@semantic-release/release-notes-generator", + [ + "@semantic-release/commit-analyzer", + { + "preset": "conventionalcommits" + } + ], + [ + "@semantic-release/release-notes-generator", + { + "preset": "conventionalcommits" + } + ], [ "@semantic-release/npm", { diff --git a/package-lock.json b/package-lock.json index fa03f0f..6542295 100644 --- a/package-lock.json +++ b/package-lock.json @@ -17,6 +17,7 @@ "@commitlint/cli": "^20.3.1", "@commitlint/config-conventional": "^20.3.1", "@semantic-release/exec": "^7.0.3", + "conventional-changelog-conventionalcommits": "^9.3.0", "husky": "^9.1.7", "mocha": "^7.1.2", "semantic-release": "^25.0.2", @@ -310,6 +311,19 @@ "node": ">=v18" } }, + "node_modules/@commitlint/config-conventional/node_modules/conventional-changelog-conventionalcommits": { + "version": "7.0.2", + "resolved": "https://registry.npmjs.org/conventional-changelog-conventionalcommits/-/conventional-changelog-conventionalcommits-7.0.2.tgz", + "integrity": "sha512-NKXYmMR/Hr1DevQegFB4MwfM5Vv0m4UIxKZTTYuD98lpTknaZlSRrDOG4X7wIXpGkfsYxZTghUN+Qq+T0YQI7w==", + "dev": true, + "license": "ISC", + "dependencies": { + "compare-func": "^2.0.0" + }, + "engines": { + "node": ">=16" + } + }, "node_modules/@commitlint/config-validator": { "version": "20.3.1", "resolved": "https://registry.npmjs.org/@commitlint/config-validator/-/config-validator-20.3.1.tgz", @@ -2583,16 +2597,16 @@ } }, "node_modules/conventional-changelog-conventionalcommits": { - "version": "7.0.2", - "resolved": "https://registry.npmjs.org/conventional-changelog-conventionalcommits/-/conventional-changelog-conventionalcommits-7.0.2.tgz", - "integrity": "sha512-NKXYmMR/Hr1DevQegFB4MwfM5Vv0m4UIxKZTTYuD98lpTknaZlSRrDOG4X7wIXpGkfsYxZTghUN+Qq+T0YQI7w==", + "version": "9.3.1", + "resolved": "https://registry.npmjs.org/conventional-changelog-conventionalcommits/-/conventional-changelog-conventionalcommits-9.3.1.tgz", + "integrity": "sha512-dTYtpIacRpcZgrvBYvBfArMmK2xvIpv2TaxM0/ZI5CBtNUzvF2x0t15HsbRABWprS6UPmvj+PzHVjSx4qAVKyw==", "dev": true, "license": "ISC", "dependencies": { "compare-func": "^2.0.0" }, "engines": { - "node": ">=16" + "node": ">=18" } }, "node_modules/conventional-changelog-writer": { @@ -9169,6 +9183,17 @@ "requires": { "@commitlint/types": "^20.3.1", "conventional-changelog-conventionalcommits": "^7.0.2" + }, + "dependencies": { + "conventional-changelog-conventionalcommits": { + "version": "7.0.2", + "resolved": "https://registry.npmjs.org/conventional-changelog-conventionalcommits/-/conventional-changelog-conventionalcommits-7.0.2.tgz", + "integrity": "sha512-NKXYmMR/Hr1DevQegFB4MwfM5Vv0m4UIxKZTTYuD98lpTknaZlSRrDOG4X7wIXpGkfsYxZTghUN+Qq+T0YQI7w==", + "dev": true, + "requires": { + "compare-func": "^2.0.0" + } + } } }, "@commitlint/config-validator": { @@ -10698,9 +10723,9 @@ } }, "conventional-changelog-conventionalcommits": { - "version": "7.0.2", - "resolved": "https://registry.npmjs.org/conventional-changelog-conventionalcommits/-/conventional-changelog-conventionalcommits-7.0.2.tgz", - "integrity": "sha512-NKXYmMR/Hr1DevQegFB4MwfM5Vv0m4UIxKZTTYuD98lpTknaZlSRrDOG4X7wIXpGkfsYxZTghUN+Qq+T0YQI7w==", + "version": "9.3.1", + "resolved": "https://registry.npmjs.org/conventional-changelog-conventionalcommits/-/conventional-changelog-conventionalcommits-9.3.1.tgz", + "integrity": "sha512-dTYtpIacRpcZgrvBYvBfArMmK2xvIpv2TaxM0/ZI5CBtNUzvF2x0t15HsbRABWprS6UPmvj+PzHVjSx4qAVKyw==", "dev": true, "requires": { "compare-func": "^2.0.0" diff --git a/package.json b/package.json index 2a19625..e33b6d0 100644 --- a/package.json +++ b/package.json @@ -5,6 +5,7 @@ "@commitlint/cli": "^20.3.1", "@commitlint/config-conventional": "^20.3.1", "@semantic-release/exec": "^7.0.3", + "conventional-changelog-conventionalcommits": "^9.3.0", "husky": "^9.1.7", "mocha": "^7.1.2", "semantic-release": "^25.0.2",