{"id":19763877,"url":"https://github.com/hypemc/versioning-bundle","last_synced_at":"2025-10-06T15:08:08.641Z","repository":{"id":62494725,"uuid":"272068806","full_name":"HypeMC/versioning-bundle","owner":"HypeMC","description":"Symfony bundle which provides a way to version your application using various versioning strategies","archived":false,"fork":false,"pushed_at":"2024-12-03T00:03:58.000Z","size":573,"stargazers_count":9,"open_issues_count":5,"forks_count":3,"subscribers_count":1,"default_branch":"1.x","last_synced_at":"2025-04-30T14:33:22.170Z","etag":null,"topics":["bundle","git","php","semver","symfony","symfony-bundle","version","version-control-system","versioning","versioning-strategies"],"latest_commit_sha":null,"homepage":"","language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/HypeMC.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2020-06-13T18:58:54.000Z","updated_at":"2025-04-09T18:21:18.000Z","dependencies_parsed_at":"2024-02-24T12:25:02.904Z","dependency_job_id":"dd88ab2b-e23f-4570-81ae-61ae8a6a4c67","html_url":"https://github.com/HypeMC/versioning-bundle","commit_stats":{"total_commits":41,"total_committers":1,"mean_commits":41.0,"dds":0.0,"last_synced_commit":"357bb811532be473e52d539bf54129c57c4ecc6e"},"previous_names":[],"tags_count":9,"template":false,"template_full_name":null,"purl":"pkg:github/HypeMC/versioning-bundle","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/HypeMC%2Fversioning-bundle","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/HypeMC%2Fversioning-bundle/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/HypeMC%2Fversioning-bundle/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/HypeMC%2Fversioning-bundle/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/HypeMC","download_url":"https://codeload.github.com/HypeMC/versioning-bundle/tar.gz/refs/heads/1.x","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/HypeMC%2Fversioning-bundle/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":278629395,"owners_count":26018552,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-10-06T02:00:05.630Z","response_time":65,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["bundle","git","php","semver","symfony","symfony-bundle","version","version-control-system","versioning","versioning-strategies"],"created_at":"2024-11-12T04:11:26.108Z","updated_at":"2025-10-06T15:08:08.612Z","avatar_url":"https://github.com/HypeMC.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"# BizkitVersioningBundle\n\n[![Latest Stable Version](https://poser.pugx.org/bizkit/versioning-bundle/v/stable)](https://packagist.org/packages/bizkit/versioning-bundle)\n[![Build Status](https://github.com/HypeMC/versioning-bundle/workflows/Tests/badge.svg)](https://github.com/HypeMC/versioning-bundle/actions)\n[![Code Coverage](https://codecov.io/gh/HypeMC/versioning-bundle/branch/1.x/graph/badge.svg)](https://codecov.io/gh/HypeMC/versioning-bundle)\n[![License](https://poser.pugx.org/bizkit/versioning-bundle/license)](https://packagist.org/packages/bizkit/versioning-bundle)\n\nSymfony bundle which provides a way to version your application using various versioning strategies.\n\n![Showcase](showcase.gif)\n\n## Features\n\n- Stores the application's version \u0026 release date into a compliant YAML or XML Symfony container configuration file\n- Automatically imports the file with the parameters into Symfony's container\n- Supports multiple versioning strategies \u0026 creating custom ones\n- Includes a console command for incrementing the version using the configured versioning strategy\n- The command automatically commits the version file \u0026 optionally creates a tag if a VCS handler is configured\n- Supports the Git VCS \u0026 creating custom VCS handlers\n\n## Requirements\n\n- [PHP 7.2](http://php.net/releases/7_2_0.php) or higher\n- [Symfony 4.4](https://symfony.com/roadmap/4.4) or [Symfony 5.2](https://symfony.com/roadmap/5.2) or higher\n\n## Installation\n\n1. Require the bundle using [Composer](https://getcomposer.org/):\n\n    ```sh\n    composer require bizkit/versioning-bundle\n    ```\n\n1. Create a configuration file under `config/packages/bizkit_versioning.yaml`. Here's a reference configuration:\n\n    ```yaml\n    bizkit_versioning:\n\n        # The prefix added to the version parameters.\n        parameter_prefix:     application # Example: my_app\n\n        # The versioning strategy used.\n        strategy:             incrementing\n\n        # The name of the file containing the version information.\n        filename:             version\n\n        # The path to the file containing the version information.\n        filepath:             '%kernel.project_dir%/config'\n\n        # The format used for the version file.\n        format:               yaml # One of \"yaml\"; \"xml\"\n\n        # Configuration for the VCS integration,\n        # set to false to disable the integration.\n        vcs:\n\n            # The handler used for the VCS integration,\n            # set to null to disable the integration.\n            handler:              git\n\n            # The message to use for the VCS commit.\n            commit_message:       'Update application version to %s'\n\n            # The mode for applying tags to version commits:\n            # - 'always': automatically add a tag without prompting\n            # - 'never': do not add a tag\n            # - 'ask': prompt before tagging when incrementing versions\n            tagging_mode:         ask # One of \"always\"; \"never\"; \"ask\"\n\n            # The message to use for the VCS tag.\n            tag_message:          'Update application version to %s'\n\n            # The name used for the VCS commit information,\n            # set to null to use the default VCS configuration.\n            name:                 null\n\n            # The email used for the VCS commit information,\n            # set to null to use the default VCS configuration.\n            email:                null\n\n            # The path to the VCS executable,\n            # set to null for autodiscovery.\n            path_to_executable:   null\n    ```\n\n1. If your project doesn't use [Symfony Flex](https://github.com/symfony/flex), enable the bundle in\n   `config/bundles.php` by adding it to the array:\n\n    ```php\n    Bizkit\\VersioningBundle\\BizkitVersioningBundle::class =\u003e ['all' =\u003e true],\n    ```\n\n## Usage\n\nThe bundle creates a compliant [Symfony Dependency Injection Container](https://symfony.com/doc/4.4/components/dependency_injection.html)\nconfiguration file with the following three parameters:\n\n- `application.version` - the application's version (the format depends on the configured versioning strategy)\n- `application.version_hash` - an MD5 digest of the version\n- `application.release_date` - an [RFC 3339](https://tools.ietf.org/html/rfc3339) formatted date on which the version was last incremented\n\n\u003e **NOTE:** The parameter names mighty vary depending on the `parameter_prefix` configuration option.\n\nIt automatically adds the parameters into Symfony's container by registering the file as an [import](https://symfony.com/doc/4.4/service_container/import.html).\n\nTo find out more about parameters check Symfony's [official documentation](https://symfony.com/doc/4.4/configuration.html#configuration-parameters).\nThe following example shows how to use it with [Sentry's](https://sentry.io/) Monolog handler:\n\n```yaml\nmonolog:\n    sentry:\n        type: sentry\n        dsn: '%sentry_dsn%'\n        release: '%application.version%'\n```\n\n### Incrementing the version\n\nTo increment the version using the configured strategy run the following command:\n\n```sh\nbin/console bizkit:versioning:increment\n```\n\nIf you have a VCS handler configured, the command will automatically commit the version file\n\u0026 optionally create a tag with the new version.\n\n## Versioning strategies\n\nThe bundle comes with the following version strategies:\n\n1. `incrementing` - defines the version as an incrementing number\n1. `semver` - uses the [Semantic Versioning](https://semver.org/) system\n\n### Custom strategies\n\nTo implement a custom strategy all you need to do is create a service which implements the `StrategyInterface` interface.\n\n```php\nnamespace App;\n\nuse Bizkit\\VersioningBundle\\Strategy\\StrategyInterface;\n\nclass MyStrategy implements StrategyInterface\n{\n    public function __invoke(StyleInterface $io, ?Version $version = null): Version\n    {\n        if (null === $version) {\n            // return initial version\n        }\n\n        // return incremented version\n    }\n}\n```\n\nUse the FQCN of the service in the configuration:\n\n```yaml\nbizkit_versioning:\n    strategy: App\\MyStrategy\n```\n\nIf you are not using Symfony's [autoconfigure](https://symfony.com/doc/4.4/service_container.html#the-autoconfigure-option)\nfeature or wish to use an alias in the configuration, tag the service with the `bizkit_versioning.strategy` tag.\n\n```yaml\nApp\\MyStrategy:\n    tags:\n        - { name: 'bizkit_versioning.strategy', alias: 'my_strategy' }\n\nbizkit_versioning:\n    strategy: my_strategy\n```\n\n## VCS handlers\n\nThe bundle comes with a handler for the [Git](https://git-scm.com/) VCS. If you wish to disable the VCS feature,\nset the `vcs` configuration option to `false`:\n\n```yaml\nbizkit_versioning:\n    vcs: false\n```\n\n### Custom VCS handlers\n\nTo implement a custom VCS handler all you need to do is create a service which implements the `VCSHandlerInterface` interface.\n\n```php\nnamespace App;\n\nuse Bizkit\\VersioningBundle\\VCS\\VCSHandlerInterface;\n\nclass MyVCSHandler implements VCSHandlerInterface\n{\n    public function commit(StyleInterface $io, Version $version): void\n    {\n        // commit the file\n    }\n\n    public function tag(StyleInterface $io, Version $version): void\n    {\n        // create a tag\n    }\n}\n```\n\nUse the FQCN of the service in the configuration:\n\n```yaml\nbizkit_versioning:\n    vcs:\n        handler: App\\MyVCSHandler\n```\n\nIf you are not using Symfony's [autoconfigure](https://symfony.com/doc/4.4/service_container.html#the-autoconfigure-option)\nfeature or wish to use an alias in the configuration, tag the service with the `bizkit_versioning.vcs_handler` tag.\n\n```yaml\nApp\\MyVCSHandler:\n    tags:\n        - { name: 'bizkit_versioning.vcs_handler', alias: 'my_vcs' }\n\nbizkit_versioning:\n    vcs:\n        handler: my_vcs\n```\n\n## Versioning\n\nThis project follows [Semantic Versioning 2.0.0](http://semver.org/).\n\n## Reporting Issues\n\nUse the [issue tracker](https://github.com/HypeMC/versioning-bundle/issues) to report any issues you encounter.\n\n## License\n\nSee the [LICENSE](LICENSE) file for details (MIT).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhypemc%2Fversioning-bundle","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fhypemc%2Fversioning-bundle","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhypemc%2Fversioning-bundle/lists"}