PitchHut logo
semantic-release-npm-github-publish
Effortlessly publish to npm and GitHub with changelog automation.
Pitch

This repository offers a comprehensive and opinionated configuration for semantic-release, streamlining the publishing process for npm and GitHub. By integrating changelog generation and release commits, it eliminates redundancy in plugin setups for developers, enhancing efficiency and organization across projects.

Description

Semantic Release for NPM and GitHub Publishing

The semantic-release-npm-github-publish project offers a robust, opinionated configuration for automating versioning and package publishing to both npm and GitHub. It streamlines the process by generating changelogs and release notes based on conventional commit messages, making it suitable for developers seeking an efficient release workflow.

Key Features

  • Comprehensive Plugin Chain: This preset eliminates the need for repetitive configuration across different repositories by providing a well-maintained preset that integrates the necessary plugins for semantic release. It ensures enhanced functionality with the following workflow stages:

    1. @semantic-release/commit-analyzer with custom release rules for additional patch-triggering types such as build, ci, chore, docs, refactor, style, and test.
    2. @semantic-release/release-notes-generator
    3. @semantic-release/changelog
    4. @semantic-release/npm
    5. @semantic-release/git, which commits key files like package.json, package-lock.json, and CHANGELOG.md with a standardized release message.
    6. @semantic-release/github for handling GitHub releases.
  • Change Log Generation: Utilizing the commit-transform.js and types.js, it promotes a curated changelog complete with grouped entries, formatting, and emojis, providing a clear history of changes made between releases.

  • Compatibility and Maintenance: Actively maintained against the latest versions of semantic-release, this configuration has been tested with Node versions 22 and 24, ensuring compatibility and reliability for various Node environments.

Configuration Example

Setting up the configuration for your repository is simple. The default behavior is flexible and caters to various branch names. Below is a sample configuration file, .releaserc.yaml:

branches:
  - main
extends: "semantic-release-npm-github-publish"
ci: false
dryRun: false
debug: false

For projects releasing from branches other than main, adjust the branches property accordingly.

Use Cases

This preset is ideal for users seeking:

  • A readily available plugin chain for efficient releases.
  • Advanced handling of various commit types that trigger separate patch releases.
  • An organized and visually appealing changelog format.
  • Long-term maintenance and updates of the semantic release configuration.

For use cases requiring unique plugins or when a tailored release strategy is desired, consider alternative plugin compositions at the local repository level.

Conclusion

The semantic-release-npm-github-publish package significantly reduces the overhead of managing releases and changelogs in JavaScript projects by providing a streamlined, opinionated configuration that can be easily adapted. Suitable for both new and existing projects, it promotes best practices in version control and transparency in development processes.

0 comments

No comments yet.

Sign in to be the first to comment.