diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml index 150a097..e48b2f4 100644 --- a/.github/workflows/deploy.yml +++ b/.github/workflows/deploy.yml @@ -25,6 +25,8 @@ env: # newer release. Used by the build and publish jobs to stamp the tag version # into Cargo.toml before building/publishing. CARGO_EDIT_VERSION: "0.13.13" + # Pin the preset because its type schema is part of .releaserc.json. + CONVENTIONAL_CHANGELOG_PRESET_VERSION: "9.3.1" jobs: semantic-release: @@ -50,6 +52,19 @@ jobs: shallow: false token: ${{ steps.app.outputs.token }} + # The release action checks out the repository again and removes workspace + # dependencies. Install the preset above the workspace so Node can find it. + - name: Install release-note preset + run: >- + npm install + --prefix "$GITHUB_WORKSPACE/.." + --no-save + --package-lock=false + --ignore-scripts + --no-audit + --no-fund + conventional-changelog-conventionalcommits@${CONVENTIONAL_CHANGELOG_PRESET_VERSION} + - name: Version and release id: version-release uses: alchemaxinc/composite-toolbox/semantic-release@v1 diff --git a/.github/workflows/update-deps-cargo.yml b/.github/workflows/update-deps-cargo.yml index 3ace570..ccb7512 100644 --- a/.github/workflows/update-deps-cargo.yml +++ b/.github/workflows/update-deps-cargo.yml @@ -28,8 +28,8 @@ jobs: base-branch: "develop" merge-method: "squash" branch-prefix: ${{ env.BRANCH_PREFIX }} - pr-title: "fix(deps): update cargo dependencies" - commit-message: "fix(deps): update cargo dependencies" + pr-title: "build(deps): update cargo dependencies" + commit-message: "build(deps): update cargo dependencies" # The action leaves the working tree on the branch it created, so the # regenerated output lands on the same pull request. diff --git a/.github/workflows/update-deps-github-actions.yml b/.github/workflows/update-deps-github-actions.yml index 2c04e0e..e343d25 100644 --- a/.github/workflows/update-deps-github-actions.yml +++ b/.github/workflows/update-deps-github-actions.yml @@ -26,5 +26,5 @@ jobs: merge-method: "squash" file-glob: ".github/**/*.yml" branch-prefix: "update-actions" - pr-title: "chore(ci): update github actions" - commit-message: "chore(ci): update github actions" + pr-title: "ci(deps): update github actions" + commit-message: "ci(deps): update github actions" diff --git a/.releaserc.json b/.releaserc.json index f418590..2c662aa 100644 --- a/.releaserc.json +++ b/.releaserc.json @@ -1,8 +1,114 @@ { "branches": ["main", { "name": "develop", "prerelease": "dev" }], "plugins": [ - "@semantic-release/commit-analyzer", - "@semantic-release/release-notes-generator", + [ + "@semantic-release/commit-analyzer", + { + "preset": "conventionalcommits", + "presetConfig": {}, + "releaseRules": [ + { + "breaking": true, + "type": "build", + "scope": "deps", + "release": "major" + }, + { "type": "build", "scope": "deps", "release": "patch" } + ] + } + ], + [ + "@semantic-release/release-notes-generator", + { + "preset": "conventionalcommits", + "presetConfig": { + "types": [ + { + "type": "build", + "scope": "deps", + "section": "Dependency Updates" + }, + { + "type": "chore", + "scope": "deps", + "section": "Dependency Updates" + }, + { + "type": "ci", + "scope": "deps", + "section": "Dependency Updates" + }, + { + "type": "docs", + "scope": "deps", + "section": "Dependency Updates" + }, + { + "type": "feat", + "scope": "deps", + "section": "Dependency Updates" + }, + { + "type": "fix", + "scope": "deps", + "section": "Dependency Updates" + }, + { + "type": "perf", + "scope": "deps", + "section": "Dependency Updates" + }, + { + "type": "refactor", + "scope": "deps", + "section": "Dependency Updates" + }, + { + "type": "revert", + "scope": "deps", + "section": "Dependency Updates" + }, + { + "type": "style", + "scope": "deps", + "section": "Dependency Updates" + }, + { + "type": "test", + "scope": "deps", + "section": "Dependency Updates" + }, + { "type": "feat", "section": "Features" }, + { "type": "feature", "section": "Features" }, + { "type": "fix", "section": "Bug Fixes" }, + { "type": "perf", "section": "Performance Improvements" }, + { "type": "revert", "section": "Reverts" }, + { "type": "docs", "section": "Documentation", "hidden": true }, + { "type": "style", "section": "Styles", "hidden": true }, + { + "type": "chore", + "section": "Miscellaneous Chores", + "hidden": true + }, + { + "type": "refactor", + "section": "Code Refactoring", + "hidden": true + }, + { "type": "test", "section": "Tests", "hidden": true }, + { "type": "build", "section": "Build System", "hidden": true }, + { + "type": "ci", + "section": "Continuous Integration", + "hidden": true + } + ] + }, + "writerOpts": { + "commitGroupsSort": "title" + } + } + ], [ "@semantic-release/github", { diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 6f492c4..a3598ef 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -48,6 +48,10 @@ Write commit messages in the [Conventional Commits](https://www.conventionalcommits.org) form. `commitlint` checks them, and each line has a limit of 150 characters. +Dependency updates use the `deps` scope. Cargo updates use `build(deps)`, and +GitHub Actions updates use `ci(deps)`. semantic-release groups these commits +under `Dependency Updates`. + ## Bug reports Give the smallest specification that shows the problem. This tool reads a