diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 78626bf..1d85b78 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -19,10 +19,13 @@ jobs: with: node-version: 16 - - name: Install dependencies - run: npm install + - name: Install pnpm + run: npm install -g pnpm + + - name: Install semantic-release + run: pnpm add -D semantic-release @semantic-release/github @semantic-release/git @semantic-release/changelog - name: Run Semantic Release env: GITHUB_TOKEN: ${{ secrets.GH_TOKEN }} - run: npx semantic-release + run: pnpm exec semantic-release diff --git a/.releaserc.json b/.releaserc.json index 4168e13..752c57a 100644 --- a/.releaserc.json +++ b/.releaserc.json @@ -2,16 +2,25 @@ "branches": ["main"], "repositoryUrl": "https://github.com/blinko-space/blinko", "plugins": [ - "@semantic-release/commit-analyzer", - "@semantic-release/release-notes-generator", - "@semantic-release/changelog", - "@semantic-release/github", [ - "@semantic-release/git", + "@semantic-release/commit-analyzer", { - "assets": ["CHANGELOG.md", "package.json"], - "message": "chore(release): ${nextRelease.version} [skip ci]\n\n${nextRelease.notes}" + "preset": "conventionalcommits", + "releaseRules": [ + { "type": "feat", "release": "minor" }, + { "type": "fix", "release": "patch" }, + { "type": "chore", "release": false } + ], + "parserOpts": { + "noteKeywords": ["BREAKING CHANGE", "BREAKING CHANGES"], + "headerPattern": "^(\\w*|\\p{Emoji_Presentation}+)?(feat|fix|chore|docs|style|refactor|perf|test)(?:\\((.*)\\))?: (.*)$", + "headerCorrespondence": ["emoji", "type", "scope", "subject"] + } } - ] + ], + "@semantic-release/release-notes-generator", + "@semantic-release/changelog", + "@semantic-release/github", + "@semantic-release/git" ] }