A Symfony bundle that provides automated semantic versioning, git operations, and deployment capabilities for your applications. Streamline your release process with a single command.
β οΈ Breaking Changes in v8.0.0
- Symfony 7.4+ required: The bundle now uses Symfony's invokable command pattern introduced in v7.3/7.4
- If you need Symfony 6.x or 7.0-7.3 support, use v7.x of this bundle
- See BREAKING_CHANGES.md for migration instructions
# Install the bundle
composer require svc/versioning-bundle
# Create your first version (prompts for commit message)
bin/console svc:versioning:new --init
# Or provide commit message directly
bin/console svc:versioning:new "Initial version" --init
# Increment versions easily
bin/console svc:versioning:new "Bug fixes" --patch # 1.0.0 β 1.0.1
bin/console svc:versioning:new "New features" --minor # 1.0.1 β 1.1.0
bin/console svc:versioning:new "Breaking changes" --major # 1.1.0 β 2.0.0
# Without message argument, you'll be prompted interactively
bin/console svc:versioning:new --patch
# β "Please enter the commit message:"- π·οΈ Semantic Versioning: Automatic major/minor/patch version increments
- π File Generation: Updates
.version,CHANGELOG.md, and Twig templates - π§ Git Integration: Automatic commits, pushes, and tag creation
- π Multiple Deployment Options:
- EasyCorp EasyDeploy Bundle integration
- Custom deployment commands
- Ansible automation
- Docker deployments
- π§ͺ Pre-deployment Validation: Run tests, linting, or custom commands before release
- π Security Scanning: Built-in composer audit for vulnerability detection (enabled by default)
- π CI/CD Ready: Perfect for automated pipelines
- π Modern PHP: Built with PHP 8.2+ features (readonly properties, match expressions)
- π‘οΈ Type Safe: Immutable value objects with PHPStan level 6 compliance
- β‘ Invokable Commands: Uses Symfony 7.4's modern invokable command pattern
- π¬ Interactive Prompts: Asks for commit message if not provided (v8.0.0+)
When you run bin/console svc:versioning:new, the bundle:
- Pre-validation - Runs optional pre-commands (tests, linting)
- Security Check - Scans dependencies for vulnerabilities with composer audit (enabled by default)
- Cache Check - Optionally verifies production cache can be cleared without errors
- Increments - Updates version number using semantic versioning
- Updates Files - Modifies
.version,CHANGELOG.md, and Twig templates - Git Operations - Commits changes, pushes, and creates tags
- Deploys - Triggers deployment via your chosen method
- Installation - Setup and bundle registration
- Configuration - Detailed configuration options
- Usage - Basic usage and commands
- Examples & Workflows - Real-world usage scenarios
- Deployment Guide - All deployment options explained
- Troubleshooting - Common issues and solutions
- Contributing - Development guidelines and setup
- Breaking Changes - Version migration guides
- PHP: 8.2+ (for readonly properties and modern features)
- Symfony: 7.4+ or 8.x (for invokable command pattern)
- Git: For version control operations (optional)
Note: For Symfony 6.x or 7.0-7.3 support, use v7.x of this bundle
composer require svc/versioning-bundleFor non-Flex projects, register the bundle manually:
// config/bundles.php
return [
// ...
Svc\VersioningBundle\SvcVersioningBundle::class => ['all' => true],
];# config/packages/svc_versioning.yaml
svc_versioning:
run_git: true # Enable git operations
run_deploy: true # Enable deployment
pre_command: "vendor/bin/phpunit" # Run tests before versioning
run_composer_audit: true # Check for security vulnerabilities (default: true)
check_cache_clear: false # Check if production cache clear works
cleanup_cache_dir: false # Delete var/cache/prod after check# Initialize versioning (creates version 0.0.1)
bin/console svc:versioning:new "Initial version" --init
# Patch release (bug fixes)
bin/console svc:versioning:new "Fix critical bug" --patch
# Minor release (new features, backward compatible)
bin/console svc:versioning:new "Add user management" --minor
# Major release (breaking changes)
bin/console svc:versioning:new "New API version" --major
# Interactive mode - prompts for commit message
bin/console svc:versioning:new --patch
# β "Please enter the commit message:" [waits for input]
# Quick patch without specifying type (defaults to patch)
bin/console svc:versioning:new "Quick bugfix"
# Override security audit check (emergency use only)
bin/console svc:versioning:new "Hotfix" --patch --ignore-auditcomposer require easycorp/easy-deploy-bundle --devsvc_versioning:
deploy_command: "./deploy.sh production"svc_versioning:
ansible_deploy: true
ansible_inventory: "inventory.yml"
ansible_playbook: "deploy.yml"The bundle automatically creates and maintains:
.version- Current version numberCHANGELOG.md- Version history with timestampstemplates/_version.html.twig- Twig template for displaying version
{# Example generated template #}
<span title='Release 2024-01-15 14:30:25 UTC'>Version: 1.2.3</span>Contributions are welcome! Please see CONTRIBUTING.md for details.
This bundle is released under the MIT License. See LICENSE for details.
Created and maintained by Sven Vetter.