Setup Semantic Release

Automate version bumps, changelog updates, and publishing from conventional commits.

Updated Nov 14, 2024
One-click install
npx skills add https://github.com/nickromney/n-dotfiles --skill setup-semantic-release
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: Setup Semantic Release
Source: https://github.com/nickromney/n-dotfiles/tree/main/claude/.claude/skills/setup-semantic-release
Command: npx skills add https://github.com/nickromney/n-dotfiles --skill setup-semantic-release

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill requires semantic-release, @semantic-release/changelog, @semantic-release/git, @semantic-release/github, @semantic-release/npm, @commitlint/cli, @commitlint/config-conventional, husky.

What problem does it solve?

Manually managing software versions, writing changelogs, and publishing packages is a time-consuming and error-prone process. This skill automates the entire release workflow, ensuring consistent, high-quality releases based on conventional commit messages.

Core Features & Use Cases

  • Automated Versioning: Automatically determines major, minor, or patch version bumps based on your commit messages, adhering to Semantic Versioning.
  • Changelog Generation: Creates and updates CHANGELOG.md and GitHub releases with detailed, automatically generated release notes.
  • Package Publishing: Integrates seamlessly with npm and GitHub Packages for automated package publishing.
  • Use Case: You're maintaining an open-source library and want to ensure every feat: commit results in a minor version bump and an updated changelog, without any manual intervention. This skill sets up the entire CI/CD pipeline for you.

Quick Start

Set up automated releases for your Node.js project. Install semantic-release dependencies, create a .releaserc.json file, and add a GitHub Actions workflow to automate publishing on push to main.

Frequently Asked Questions about Setup Semantic Release

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I automate version bumps and changelog generation from commit messages?

Semantic Release automates version bumps by analyzing conventional commits to determine major, minor, or patch increments, then generates changelogs and Git tags automatically. Install semantic-release with changelog and Git plugins, configure a .releaserc.json file, and trigger releases via CI/CD on pushes to your main branch.

Can I automatically publish npm packages on every commit to main?

Yes. Semantic Release integrates with npm and GitHub Packages to publish automatically after version bumping. Set up the npm plugin in your .releaserc.json, authenticate via GitHub Actions, and configure your workflow to run semantic-release on main branch pushes.

What's the best way to enforce conventional commits in my project?

Commitlint validates commit messages against conventional-commit rules before they're pushed. Install @commitlint/cli and @commitlint/config-conventional, configure commitlint.config.js, and use Husky to run commitlint as a Git hook to block non-compliant commits.

Do I need to manually update CHANGELOG.md and package.json for each release?

No. Semantic Release automatically updates CHANGELOG.md with formatted release notes and increments the version field in package.json based on commit analysis, eliminating manual release administration.

What prerequisite knowledge do I need to set up automated releases?

Familiarity with Git workflow, conventional commit format, GitHub Actions or CI/CD pipelines, and npm authentication tokens is helpful. The Skill guides setup of semantic-release configuration and integrations without requiring deep knowledge of each dependency.

Can semantic-release work with private npm registries or GitHub Packages?

Yes. Semantic Release supports GitHub Packages and private npm registries through plugin configuration in .releaserc.json and credential management via GitHub Actions secrets or environment variables during the publish step.

Related Skills