From 753ca3dafda842826d5e8861846761b3703a4c0d Mon Sep 17 00:00:00 2001 From: David Uhlmann Date: Wed, 24 Jan 2024 07:54:33 +1000 Subject: [PATCH] fix: Semantic Release CI config again (#521) fix: .releaserc seems to expect a YAML format with comments present --- .releaserc | 71 -------------------------------------------- release.config.cjs | 74 ++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 74 insertions(+), 71 deletions(-) delete mode 100644 .releaserc create mode 100644 release.config.cjs diff --git a/.releaserc b/.releaserc deleted file mode 100644 index 8a7f6a99c..000000000 --- a/.releaserc +++ /dev/null @@ -1,71 +0,0 @@ -{ - // config for Semantic Release workflow - // docs: https://github.com/semantic-release/semantic-release/blob/master/docs/usage/configuration.md#configuration - "branches": ["main"], - "dryRun": false, - "plugins": [ - // determine what type of semver change this commit may generate - [ - "@semantic-release/commit-analyzer", - { - "preset": "conventionalcommits", - // see default rules: https://github.com/semantic-release/commit-analyzer/blob/master/lib/default-release-rules.js - "releaseRules": [ - // while in "alpha" mode don't increment the major version - { "breaking": true, "release": "minor" }, - { "type": "feat", "release": "patch" }, - { "type": "fix", "release": "patch" }, - { "type": "perf", "release": "patch" } - ] - } - ], - // create CHANGELOG text for changelog and commit description - [ - "@semantic-release/release-notes-generator", - { - "preset": "conventionalcommits", - "presetConfig": { - "types": [ - { "type": "feat", "section": "Features" }, - { "type": "fix", "section": "Fixes" }, - { "type": "chore", "hidden": false, "section": "Other" }, - { "type": "docs", "hidden": false, "section": "Other" }, - { "type": "style", "hidden": false, "section": "Other" }, - { "type": "refactor", "hidden": false, "section": "Other" }, - { "type": "perf", "hidden": false, "section": "Other" }, - { "type": "revert", "hidden": false, "section": "Other " }, - { "type": "test", "hidden": false, "section": "Other " }, - { "type": "build", "hidden": false, "section": "Other" }, - { "type": "ci", "hidden": true } - ] - } - } - ], - // edits CHANGELOG.md - [ - "@semantic-release/changelog", - { - "changelogFile": "CHANGELOG.md", - "changelogTitle": "# Changelog" - } - ], - // edits package.json and package-lock.json - [ - "@semantic-release/npm", - { - "npmPublish": false - } - ], - // creates git commit and tag - [ - "@semantic-release/git", - { - "assets": ["CHANGELOG.md", "package.json", "package-lock.json"], - "message": - "chore(release): ${nextRelease.version} [skip ci]\n\n${nextRelease.notes}" - } - ], - // creates github release from git tag - "@semantic-release/github" - ] -} diff --git a/release.config.cjs b/release.config.cjs new file mode 100644 index 000000000..17fd6afae --- /dev/null +++ b/release.config.cjs @@ -0,0 +1,74 @@ +/** + * config for Semantic Release workflow + * docs: https://github.com/semantic-release/semantic-release/blob/master/docs/usage/configuration.md#configuration + **/ + +module.exports = { + branches: ['main'], + dryRun: false, + plugins: [ + // determine what type of semver change this commit may generate + [ + '@semantic-release/commit-analyzer', + { + preset: 'conventionalcommits', + // see default rules: https://github.com/semantic-release/commit-analyzer/blob/master/lib/default-release-rules.js + releaseRules: [ + // while in "alpha" mode don't increment the major version + { breaking: true, release: 'minor' }, + { type: 'feat', release: 'patch' }, + { type: 'fix', release: 'patch' }, + { type: 'perf', release: 'patch' }, + ], + }, + ], + // create CHANGELOG text for changelog and commit description + [ + '@semantic-release/release-notes-generator', + { + preset: 'conventionalcommits', + presetConfig: { + types: [ + { type: 'feat', section: 'Features' }, + { type: 'fix', section: 'Fixes' }, + { type: 'chore', hidden: false, section: 'Other' }, + { type: 'docs', hidden: false, section: 'Other' }, + { type: 'style', hidden: false, section: 'Other' }, + { type: 'refactor', hidden: false, section: 'Other' }, + { type: 'perf', hidden: false, section: 'Other' }, + { type: 'revert', hidden: false, section: 'Other ' }, + { type: 'test', hidden: false, section: 'Other ' }, + { type: 'build', hidden: false, section: 'Other' }, + { type: 'ci', hidden: true }, + ], + }, + }, + ], + // edits CHANGELOG.md + [ + '@semantic-release/changelog', + { + changelogFile: 'CHANGELOG.md', + changelogTitle: '# Changelog', + }, + ], + // edits package.json and package-lock.json + [ + '@semantic-release/npm', + { + npmPublish: false, + }, + ], + // creates git commit and tag + [ + '@semantic-release/git', + { + assets: ['CHANGELOG.md', 'package.json', 'package-lock.json'], + message: + 'chore(release): ${nextRelease.version} [skip ci]\n\n${nextRelease.notes}', + }, + ], + // creates github release from git tag + '@semantic-release/github', + ], +};