Skip to content

ivuorinen/base-configs-semantic-release

@ivuorinen/semantic-release-config

npm package license MIT ivuorinen's Code Style

ivuorinen's shareable configuration for semantic-release.

Table of Contents

Plugins

This shareable configuration uses the following plugins:

Release Rules

This config is designed to work with Renovate commit conventions:

Commit pattern Example Release
feat: ... feat: add new option minor
fix: ... fix: resolve parsing error patch
chore(deps)!: ... chore(deps)!: update X (1.0.0 → 2.0.0) minor
chore(deps): ... chore(deps): update X (1.0.0 → 1.1.0) patch
chore(actions): ... chore(actions): update actions/checkout no release

Installation

Install this config as a devDependencies:

# npm
npm install @ivuorinen/semantic-release-config --save-dev

# Yarn
yarn add @ivuorinen/semantic-release-config --dev

After installing it, a .releaserc.json file will be created automatically in the project's root folder with the following configuration:

{
  "extends": ["@ivuorinen/semantic-release-config"]
}

Configuration

Ensure that your CI configuration has the following secret environment variables set:

See each plugin documentation for required installation and configuration steps.

GitHub Actions

name: Release

on:
  push:
    branches:
      - main

jobs:
  release:
    name: Release
    runs-on: ubuntu-latest
    permissions:
      contents: write
      issues: write
      pull-requests: write
      id-token: write

    steps:
      - name: Checkout
        uses: actions/checkout@v4
        with:
          fetch-depth: 0

      - name: Setup Node.js Environment
        uses: actions/setup-node@v4
        with:
          always-auth: true
          node-version: 20
          registry-url: "https://registry.npmjs.org"

      - name: Install Dependencies
        run: npm ci

      - name: Release
        env:
          GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
          NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
        run: npx semantic-release

Documentations

Read the semantic-release docs for more information.

Contributing

If you are interested in helping contribute, please take a look at our contribution guidelines and open an issue or pull request.

License

Distributed under the MIT License. See LICENSE for more information.

About

ivuorinen's shareable configuration for semantic-release.

Topics

Resources

License

Code of conduct

Contributing

Stars

Watchers

Forks

Contributors