- Dependencies
- Hooks
- Commitlint config
- Release-please config
- Conventional commit messages
- Bump version
- Fix release notes
$ yarn add -D husky @commitlint/{cli,config-conventional} npx husky install
npx husky add .husky/commit-msg 'npx --no -- commitlint --edit "$1"'
npx husky add .husky/pre-commit "echo 'some process ci/cd'"
⚠️ To filecommitlint.config.js
module.exports = {extends: ['@commitlint/config-conventional']};
Have two jobs for build and bum version and release
on:
push:
branches:
- main
permissions:
contents: write
pull-requests: write
name: Create release
jobs:
build:
name: Build pkg
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version: 16
- name: Build
run: |
yarn -y && yarn build
- name: Upload build
uses: actions/upload-artifact@v3
with:
name: ars
path: build
release-please:
name: Bump+CL+release
runs-on: ubuntu-latest
needs: build
steps:
- name: Download build
uses: actions/download-artifact@v3
with:
name: ars
- uses: google-github-actions/release-please-action@v3
with:
release-type: node
token: ${{secrets.GITHUB_TOKEN}}
package-name: ars
path: build/
pull-request-title-pattern: "chore${scope}: to release${component} ${version}"
{
".": "1.0.0"
}{
"release-type": "node",
"packages": {
".": {
"changelog-path": "CHANGELOG.md",
"release-type": "node",
"bump-minor-pre-major": false,
"bump-patch-for-minor-pre-major": false,
"draft": false,
"prerelease": false
}
},
"$schema": "https://raw.githubusercontent.com/googleapis/release-please/main/schemas/config.json"
}Release Please assume you are using Conventional Commit messages.
The most important prefixes you should have in mind are:
fix: which represents bug fixes, and correlates to a SemVer patch.
feat: which represents a new feature, and correlates to a SemVer minor.
feat!:, or fix!:, refactor!:, etc., which represent a breaking change (indicated by the !) and
will result in a SemVer major.
feat: adds v4 UUID to crypto
This adds support for v4 UUIDs to the library.
fix(utils): unicode no longer throws exception
PiperOrigin-RevId: 345559154
BREAKING-CHANGE: encode method no longer throws.
Source-Link: googleapis/googleapis@5e0dcb2
feat(utils): update encode to support unicode
PiperOrigin-RevId: 345559182
Source-Link: googleapis/googleapis@e5eef86
The above commit message will contain:
- an entry for the "adds v4 UUID to crypto" feature.
- an entry for the fix "unicode no longer throws exception", along with a note that it's a breaking change.
- an entry for the feature "update encode to support unicode"
git commit -m "chore: release 2.0.0\n\nRelease-As: 2.0.0"
⚠️ A releasable unit is a commit to the branch with one of the following prefixes: "feat", "* fix*", and "deps". (A "chore" or "build" commit is not a releasable unit.)
BEGIN_COMMIT_OVERRIDE
feat: add ability to override merged commit message
fix: another message
chore: a third message
END_COMMIT_OVERRIDE