diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml index 268c56e..b160085 100644 --- a/.github/workflows/deploy.yml +++ b/.github/workflows/deploy.yml @@ -48,7 +48,8 @@ jobs: path: ./build - name: Semantic release - run: npx semantic-release + run: npm i -g semantic-release @semantic-release/changelog @semantic-release/git @semantic-release/github @semantic-release/commit-analyzer @semantic-release/release-notes-generator conventional-changelog-conventionalcommits + run: npx semantic-release --debug --dry-run # Deployment job deploy: diff --git a/package.json b/package.json index 4211edd..3add511 100644 --- a/package.json +++ b/package.json @@ -83,4 +83,4 @@ }, "type": "module", "version": "0.1.0" -} +} \ No newline at end of file diff --git a/release.config.cjs b/release.config.cjs new file mode 100644 index 0000000..08a914f --- /dev/null +++ b/release.config.cjs @@ -0,0 +1,74 @@ +/** + * @type {import('semantic-release').GlobalConfig} + */ +module.exports = { + branches: ["main", "next", "master", "production"], + plugins: [ + [ + "@semantic-release/commit-analyzer", + { + preset: "angular", + releaseRules: [ + { + breaking: true, + release: "major", + }, + { + type: "feat", + release: "minor", + }, + { + type: "fix", + release: "patch", + }, + { + type: "docs", + scope: "README", + release: "patch", + }, + { + type: "chore", + release: "patch", + }, + ], + parserOpts: { + noteKeywords: ["BREAKING CHANGE", "BREAKING CHANGES", "BREAKING"], + }, + }, + ], + [ + "@semantic-release/release-notes-generator", + { + /* + use conventionalcommits instead of conventional-changelog-angular (default) + to introduce new sections in changelog + */ + preset: "conventionalcommits", + presetConfig: { + types: [ + { type: "feat", section: "Features", hidden: false }, + { type: "fix", section: "Bug Fixes", hidden: false }, + { type: "docs", section: "Miscellaneous Chores", hidden: false }, + { type: "chore", section: "Miscellaneous Chores", hidden: false }, + ], + }, + parserOpts: { + noteKeywords: ["BREAKING CHANGE", "BREAKING CHANGES", "BREAKING"], + }, + }, + ], + [ + "@semantic-release/changelog", + { + changelogFile: "CHANGELOG.md", + }, + ], + [ + "@semantic-release/git", + { + assets: ["package.json", "CHANGELOG.md"], + }, + ], + "@semantic-release/github", + ], +};