https://github.com/thewalkingcoder/gitversion-bundle
Extract last git tag to manage app versioning
https://github.com/thewalkingcoder/gitversion-bundle
Last synced: 8 months ago
JSON representation
Extract last git tag to manage app versioning
- Host: GitHub
- URL: https://github.com/thewalkingcoder/gitversion-bundle
- Owner: thewalkingcoder
- Created: 2022-03-10T13:12:23.000Z (about 4 years ago)
- Default Branch: master
- Last Pushed: 2024-03-20T09:14:41.000Z (about 2 years ago)
- Last Synced: 2025-05-21T04:18:10.716Z (10 months ago)
- Language: PHP
- Size: 18.6 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# TwcGitVersion
Extract last git tag to manage app versioning.
## Installation
```bash
composer require twc/gitversion-bundle
```
## Basic Usage
### Configuration
| key | definition | default |
|-----------------|-----------------------------------------------|---------------|
| default_version | value when tag not exist | v0.1.0 |
| file_name | file Name including last git tag | VERSION |
```yaml
#If you want to change default value create config/packages/twc_gitversion.yaml
twc_gitversion:
default_version: 'v0.0.0'
```
### Generate version
```bash
bin/console twc:generate:version
```
### Get last version
with twig
```twig
{{ twc_version }}
```
with php
```php
use Twc\GitversionBundle\Provider\GitVersionProvider;
public function home(GitVersionProvider $gitVersionProvider)
{
$version = $gitVersionProvider->get();
dump($version->toString());
}
```