svc / versioning-bundle
Private package to handle version numbers and deploys
Installs: 305
Dependents: 0
Suggesters: 0
Security: 0
Stars: 1
Watchers: 1
Forks: 0
Open Issues: 0
Type:symfony-bundle
Requires
- php: ^7.3 || ^8
- symfony/config: ^6 || ^7
- symfony/console: ^6 || ^7
- symfony/dependency-injection: ^6 || ^7
- symfony/http-kernel: ^6 || ^7
- symfony/yaml: ^6 || ^7
Requires (Dev)
- phpstan/phpstan: ^2.1
- phpunit/phpunit: ^12.2
Suggests
- easycorp/easy-deploy-bundle: Prefered tool to deploy the application
README
A Symfony bundle that provides automated semantic versioning, git operations, and deployment capabilities for your applications. Streamline your release process with a single command.
๐ Quick Start
# Install the bundle composer require svc/versioning-bundle # Create your first version bin/console svc:versioning:new --init # Increment versions easily bin/console svc:versioning:new --patch # 1.0.0 โ 1.0.1 bin/console svc:versioning:new --minor # 1.0.1 โ 1.1.0 bin/console svc:versioning:new --major # 1.1.0 โ 2.0.0
โจ Features
- ๐ท๏ธ 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
- ๐ Sentry Integration: Automatic release tracking
- ๐ CI/CD Ready: Perfect for automated pipelines
๐ฏ How It Works
When you run bin/console svc:versioning:new
, the bundle:
- Validates - Runs optional pre-commands (tests, linting)
- 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
- Tracks - Optional Sentry release creation
๐ Documentation
Getting Started
- Installation - Setup and bundle registration
- Configuration - Detailed configuration options
- Usage - Basic usage and commands
Advanced Topics
- Examples & Workflows - Real-world usage scenarios
- Deployment Guide - All deployment options explained
- Troubleshooting - Common issues and solutions
Development
- Contributing - Development guidelines and setup
๐๏ธ Requirements
- PHP: 7.3+ or 8.x
- Symfony: 6.x or 7.x
- Git: For version control operations (optional)
๐ฆ Installation
composer require svc/versioning-bundle
For non-Flex projects, register the bundle manually:
// config/bundles.php return [ // ... Svc\VersioningBundle\SvcVersioningBundle::class => ['all' => true], ];
โ๏ธ Basic Configuration
# 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 create_sentry_release: false # Sentry integration
๐ฆ Usage Examples
# Initialize versioning (creates version 0.0.1) bin/console svc:versioning:new --init # Patch release (bug fixes) bin/console svc:versioning:new --patch "Fix critical bug" # Minor release (new features, backward compatible) bin/console svc:versioning:new --minor "Add user management" # Major release (breaking changes) bin/console svc:versioning:new --major "New API version" # Quick patch with default message bin/console svc:versioning:new
๐ง Deployment Options
EasyDeploy (Default)
composer require easycorp/easy-deploy-bundle --dev
Custom Commands
svc_versioning: deploy_command: "./deploy.sh production"
Ansible Automation
svc_versioning: ansible_deploy: true ansible_inventory: "inventory.yml" ansible_playbook: "deploy.yml"
๐จ Generated Files
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>
๐ค Contributing
Contributions are welcome! Please see CONTRIBUTING.md for details.
๐ License
This bundle is released under the MIT License. See LICENSE for details.
๐ Credits
Created and maintained by Sven Vetter.