@crystal-ball/semantic-release-base
v2.40.0
Published
🔮 Projects - Semantic Release configs
Downloads
506
Readme
Package contains the shared base configs for automated release management with Semantic Release. Included configurations will:
- Analyze commits using the ESLint commit standards to determine a semver version
- Generate release notes for the release
- Generate changelog updates for the release
- Update the
package.json
version and publish to NPM - Push a release commit and tag
- Add a comment to Github issues and PRs resolved in the release
Setup
1. Install
npm i -D @crystal-ball/semantic-release-base
2. Update package.json
{
"release": {
"extends": ["@crystal-ball/semantic-release-base"]
}
}
CI/CD configuration
Releases should be configured to trigger on change to default branch in CI/CD. Configurations must be set as environment values including:
GH_TOKEN
Github tokenNPM_TOKEN
NPM token
Configuring Github Actions
jobs:
ci-cd:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v1
- name: Setup Node.js
uses: actions/setup-node@v1
with:
node-version: '10'
- name: Install
run: npm install
env:
CI: true
- name: Test
run: npm test
- name: Release
if: success() && github.ref == 'refs/heads/main'
run: npx semantic-release
env:
GH_TOKEN: ${{ secrets.SEMANTIC_GH_TOKEN }}
NPM_TOKEN: ${{ secrets.SEMANTIC_NPM_TOKEN }}
Configuring Travis
deploy:
provider: script
skip_cleanup: true
script:
- npx semantic-release
Changelog generation
- Commits with breaking changes will create a notes section