README
Semantic Release Config
semantic-release shareable config to publish npm packages with GitHub.
Plugins
This configuration uses the following plugins:
@semantic-release/commit-analyzer
@semantic-release/release-notes-generator
@semantic-release/npm
@semantic-release/git
Summary
- Provides an informative git commit message for the release commit that does not trigger continuous integration and conforms to the conventional commits specification (e.g., "chore(release): 1.2.3 [skip ci]\n\nnotes").
- Creates a tarball that gets uploaded with each GitHub release.
- Publishes the same tarball to npm.
- Commits the version change in
package.json
. - Creates or updates a changelog file.
Install
$ yarn add semantic-release @code-quality/semantic-release-config -D
Usage
The shareable config can be configured in the semantic-release configuration file:
{
"extends": "@code-quality/semantic-release-config",
"branch": "master"
}
Configuration
Ensure that your CI configuration has the following secret environment variables set:
GH_TOKEN
withpublic_repo
access.NPM_TOKEN
See each plugin documentation for required installation and configuration steps.
GitHub workflows
If you're configuring a GitHub actions the following yaml configuration will help you do just that.
name: CI
on:
push:
branches:
- master
jobs:
publish:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v1
- uses: actions/setup-node@v1
with:
node-version: 12
registry-url: https://registry.npmjs.org
- run: yarn install
- run: npx semantic-release
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
GH_TOKEN: ${{ secrets.GH_TOKEN }}