panrelease 0.13.2

Utility to release software
Documentation

Panrelease

Test Status Crate API License: MIT npm version

Panrelease is a versatile release automation tool that manages version bumping, changelog updates, and Git operations across multiple package managers. It supports Cargo (Rust), npm (Node.js), Maven, and Gradle (Java) projects in a unified workflow.

Features

  • Multi-Language Support - Unified version management for Cargo, npm, Maven, and Gradle projects
  • Semantic Versioning - Automatic major, minor, patch, and post-release version bumping
  • Changelog Automation - Automatically updates CHANGELOG.md following Keep a Changelog format
  • Git Integration - Commits version changes, creates tags, and supports GPG signing
  • Multi-Module Projects - Manages monorepos with multiple packages
  • Custom Hooks - Execute arbitrary commands after releases (build, test, deploy)
  • Cross-Platform - Available as native CLI binary and npm package (via WebAssembly)
  • Configurable Tag Templates - Customize Git tag naming (e.g., v{{version}})

Table of Contents

Installation

Using Cargo (Rust)

cargo install panrelease

Using npm/yarn/pnpm (Node.js)

# npm
npm install -g panrelease

# yarn
yarn global add panrelease

# pnpm
pnpm add -g panrelease

From Source

git clone https://github.com/dghilardi/panrelease.git
cd panrelease
cargo build --release

The binary will be available at target/release/panrelease.

Quick Start

  1. Initialize your project by creating a .panproject.toml file in your project root:
[vcs]
software = "Git"

[modules.main]
path = "."
packageManager = "Cargo"  # or "Npm", "Maven", "Gradle"
main = true
  1. Create a release with a version bump:
# Patch release (1.0.0 -> 1.0.1)
panrelease patch

# Minor release (1.0.0 -> 1.1.0)
panrelease minor

# Major release (1.0.0 -> 2.0.0)
panrelease major

# Set explicit version
panrelease 2.0.0

That's it! Panrelease will:

  • Update version in your package manifest (Cargo.toml, package.json, pom.xml, etc.)
  • Update CHANGELOG.md with the new version and date
  • Commit the changes
  • Create a Git tag

Configuration

Panrelease is configured via a .panproject.toml file in your project root.

Basic Configuration

[vcs]
software = "Git"
force_sign = false              # Require GPG-signed commits
tag_template = "{{version}}"    # Git tag format (e.g., "v{{version}}" -> "v1.0.0")

[modules.myapp]
path = "."
packageManager = "Cargo"        # Cargo | Npm | Maven | Gradle
main = true                     # Designates primary module for version detection

Configuration Options

Section Field Type Description
vcs software string Version control system (Git)
vcs force_sign bool Require GPG-signed commits (default: false)
vcs tag_template string Git tag template (default: {{version}})
modules.<name> path string Path to module relative to project root
modules.<name> packageManager string Package manager: Cargo, Npm, Maven, Gradle
modules.<name> main bool Mark as primary module for version extraction

For detailed configuration options, see docs/CONFIGURATION.md.

Usage

Command Line Interface

panrelease [OPTIONS] <BUMP_TYPE>

Bump Types

Type Description Example
major Increment major version 1.2.3 -> 2.0.0
minor Increment minor version 1.2.3 -> 1.3.0
patch Increment patch version 1.2.3 -> 1.2.4
post Create post-release with build metadata 1.2.3 -> 1.2.3+feat.r1
X.Y.Z Set explicit version 1.2.3 -> 2.0.0

Options

-h, --help       Print help information
-V, --version    Print version information

Environment Variables

Variable Description
RUST_LOG Set log level (error, warn, info, debug, trace)

Examples

# Standard patch release
panrelease patch

# Minor release with debug logging
RUST_LOG=debug panrelease minor

# Set specific version
panrelease 1.5.0

# Post-release for feature branch
panrelease post

Package Manager Support

Cargo (Rust)

Updates Cargo.toml and runs cargo check to update Cargo.lock.

[modules.rust-lib]
path = "."
packageManager = "Cargo"
main = true

npm (Node.js)

Updates package.json and automatically detects/updates the appropriate lockfile (package-lock.json, yarn.lock, or pnpm-lock.yaml).

[modules.node-app]
path = "."
packageManager = "Npm"
main = true

Maven (Java)

Updates pom.xml, supporting both direct version fields and property-based versions.

[modules.java-lib]
path = "."
packageManager = "Maven"
main = true

Gradle (Java/Kotlin)

Updates gradle.properties file.

[modules.gradle-app]
path = "."
packageManager = "Gradle"
main = true

Multi-Module Projects

Panrelease excels at managing monorepos with multiple packages:

[vcs]
software = "Git"
tag_template = "v{{version}}"

[modules.core]
path = "packages/core"
packageManager = "Cargo"
main = true  # Primary module determines project version

[modules.cli]
path = "packages/cli"
packageManager = "Cargo"

[modules.web]
path = "packages/web"
packageManager = "Npm"

[modules.server]
path = "packages/server"
packageManager = "Maven"

All modules are updated simultaneously during a release.

Hooks

Execute custom commands after releases using hooks:

[modules.myapp]
path = "."
packageManager = "Cargo"
main = true

[modules.myapp.hooks.after_rel]
build = ["cargo", "build", "--release"]
test = ["cargo", "test"]
publish = ["cargo", "publish"]

Hooks are executed in the order they are defined.

Git Integration

Automatic Operations

During a release, Panrelease automatically:

  1. Verifies the staging area is clean
  2. Updates version in package manifests
  3. Updates CHANGELOG.md
  4. Executes post-release hooks
  5. Commits all changes with the version as the commit message
  6. Creates a Git tag based on tag_template

GPG Signing

Enable GPG-signed commits and tags:

[vcs]
software = "Git"
force_sign = true

Tag Templates

Customize Git tag naming:

[vcs]
tag_template = "v{{version}}"     # v1.0.0
# or
tag_template = "release-{{version}}"  # release-1.0.0
# or
tag_template = "{{version}}"      # 1.0.0 (default)

Documentation

Requirements

  • Git - Required for version control operations
  • Rust 1.70+ (for building from source)
  • Package manager CLI (optional):
    • cargo for Rust projects
    • npm/yarn/pnpm for Node.js projects
    • mvn for Maven projects (optional, only for hooks)
    • gradle for Gradle projects (optional, only for hooks)

Contributing

Contributions are welcome! Please read our Contributing Guidelines before submitting a pull request.

  1. Fork the repository
  2. Create your feature branch (git checkout -b feature/amazing-feature)
  3. Commit your changes (git commit -m 'Add amazing feature')
  4. Push to the branch (git push origin feature/amazing-feature)
  5. Open a Pull Request

License

This project is licensed under the MIT License - see the LICENSE file for details.

Acknowledgments


Made with care by dghilardi