New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

@mrbernnz/semantic-release-calver

Package Overview
Dependencies
Maintainers
0
Versions
5
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@mrbernnz/semantic-release-calver

Semantic-Release plugin for versioning using CalVer spec.

  • 0.2.1
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
9
increased by800%
Maintainers
0
Weekly downloads
 
Created
Source

@mrbernnz/semantic-release-calver

A plugin for semantic-release that supports Calendar Versioning (CalVer) for automated release management. CalVer uses date-based versioning, making it ideal for projects with frequent releases.

Features

  • 📅 CalVer Support: Adheres to the Calendar Versioning format (e.g. YYYY.MM.MINOR).
  • 🔧 Flexible Configuration: Customize versioning patterns to fit your project needs.
  • ✅ Integration Ready: Works seamlessly with semantic-release workflows.
  • ⚙️ TypeScript Support: Fully typed for better developer experience.
  • 🔒 Secure and Reliable: Built with best practices for automated release pipelines.

Installation

Install the package via npm or yarn:

# Using npm
npm install @mrbernnz/semantic-release-calver --save-dev

# Using yarn
yarn add @mrbernnz/semantic-release-calver --dev

Usage

Basic Setup

To use semantic-release-calver, configure it as a plugin in your release configuration file (e.g., release.config.js):

module.exports = {
  branches: ['main'],
  plugins:
    '@semantic-release/release-notes-generator',
    '@semantic-release/changelog',
    '@semantic-release/git',
    '@semantic-release/npm',
    '@mrbernnz/semantic-release-calver'

};

Example Release Workflow

With the configuration above, semantic-release-calver will:

  1. Generate a version in the specified CalVer format.
  2. Automatically create and publish releases using semantic-release.

API Reference

@mrbernnz/semantic-release-calver plugin

Returns

A string representing the calculated version (e.g., 2024.01.0).

Example

const calverPlugin = require('@mrbernnz/semantic-release-calver');

const version = calverPlugin.calculateNextVersion({
  lastVersion: '2023.12.2'
});

console.log(version); // Outputs: '2024.01.0'

Integration Examples

GitHub Actions

Here’s an example workflow to use semantic-release-calver in a GitHub Actions pipeline:

name: Release

on:
push:
branches: - main

jobs:
release:
runs-on: ubuntu-latest
steps: - name: Checkout repository
uses: actions/checkout@v3 - name: Set up Node.js
uses: actions/setup-node@v3
with:
node-version: 16 - name: Install dependencies
run: npm install - name: Run semantic-release
run: npx semantic-release
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}

Troubleshooting Guide

Common Issues

  1. Plugin Not Executing:
    • Verify that the plugin is correctly configured in the plugins array of your release.config.js.
  2. Authentication Errors:
    • Ensure you’ve set the necessary environment variables (GITHUB_TOKEN, GITLAB_TOKEN, NPM_TOKEN).

Contributing

Contributions are welcome to semantic-release-calver! Please follow these steps:

  1. Fork the repository and clone it locally.
  2. Create a feature branch:
git checkout -b feature/my-feature
  1. Commit your changes:
git commit -m "Add my feature"
  1. Push to your fork and submit a pull request.

License

This project is licensed under the MIT License.

Keywords

FAQs

Package last updated on 04 Jan 2025

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc