How To Install Semantic Release
Prerequisites
Step 1 — Install Semantic Release
pnpm install --save-dev semantic-release
You’ll see output similar to:
+ semantic-release@<version>
added 15 packages from 10 contributors and audited 30 packages in 5s
found 0 vulnerabilities
Step 2 — Create a Semantic Release Configuration File
To use our Semantic Release configuration, add the following .releaserc.js
file at the root of your project.
For Apps and Web-Based Projects
module.exports = require.resolve('@kurocado-studio/style-guide/release/app');
For Packages That Will Be Released Publicly on NPM
module.exports = require.resolve('@kurocado-studio/style-guide/release/npm');
Step 3 — Configure Git Hooks
To ensure that Semantic Release runs correctly during your CI/CD process, you should add a Git hook in your configuration.
Optional: you can add a prepublish or postversion hook with Husky:
npx husky add .husky/prepublish 'npx semantic-release'
Step 4 — Run Semantic Release
npx semantic-release
Last modified: 27 November 2024