diff --git a/.github/workflows/semantic-release.yml b/.github/workflows/semantic-release.yml index 90f8e8e..bbf485e 100644 --- a/.github/workflows/semantic-release.yml +++ b/.github/workflows/semantic-release.yml @@ -38,11 +38,17 @@ jobs: node-version: 22 # Pinned to an exact version: this action publishes no floating major - # tags, so @v6 would not resolve. All three plugins in .releaserc.json - # ship with the semantic-release core it bundles. + # tags, so @v6 would not resolve. The plugins in .releaserc.json ship + # with the semantic-release core it bundles, the conventionalcommits + # preset (which understands `feat!:`) has to be installed. Version 9: + # version 10 needs a newer changelog writer than the bundled + # release-notes-generator uses. - name: Semantic release id: semantic uses: cycjimmy/semantic-release-action@v6.0.0 + with: + extra_plugins: | + conventional-changelog-conventionalcommits@9 env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} diff --git a/.releaserc.json b/.releaserc.json index fea7fae..d28c3b9 100644 --- a/.releaserc.json +++ b/.releaserc.json @@ -2,8 +2,8 @@ "branches": ["main"], "tagFormat": "v${version}", "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/github" ] } diff --git a/README.md b/README.md index 3fa706f..55ce032 100644 --- a/README.md +++ b/README.md @@ -289,9 +289,9 @@ Releases are automated with [semantic-release](https://semantic-release.gitbook. | PR title | Release | |----------|---------| -| `fix: ...` | patch (1.2.3 → 1.2.4) | +| `fix: ...`, `perf: ...` | patch (1.2.3 → 1.2.4) | | `feat: ...` | minor (1.2.3 → 1.3.0) | -| `feat!: ...` or a `BREAKING CHANGE:` footer | major (1.2.3 → 2.0.0) | -| `docs:`, `chore:`, `ci:`, `build:`, `refactor:`, `test:`, `style:`, `perf:` | no release | +| `!` after the type (e.g. `feat!: ...`, `refactor!: ...`) or a `BREAKING CHANGE:` footer | major (1.2.3 → 2.0.0) | +| `docs:`, `chore:`, `ci:`, `build:`, `refactor:`, `test:`, `style:`, `revert:` | no release | On every merge to `main` the next version is determined, tagged (`vX.Y.Z`), a GitHub release is created and the package is published to PyPI. The version is set during the build and is not committed, so the version in `pyproject.toml` is not the released version.