Skip to content

Commit 6467c6d

Browse files
Refining the version handling
1 parent 7083327 commit 6467c6d

File tree

2 files changed

+7
-2
lines changed

2 files changed

+7
-2
lines changed

.github/workflows/phar-build.yaml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,13 +17,16 @@ jobs:
1717
- name: Setup PHP
1818
uses: shivammathur/setup-php@v2
1919
with:
20-
php-version: '8.2'
20+
php-version: '8.4'
2121
extensions: json, fileinfo
2222
tools: composer
2323

2424
- name: Install dependencies
2525
run: composer install --no-dev --optimize-autoloader
2626

27+
- name: Inject version from tag
28+
run: sed -i "s/public const VERSION = .*/public const VERSION = '\${{ github.ref_name }}';/" src/Application.php
29+
2730
- name: Build PHAR
2831
run: composer build-phar
2932

src/Application.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,8 @@
4949
*/
5050
class Application
5151
{
52+
public const VERSION = '1.3.0';
53+
5254
private ContainerBuilder $containerBuilder;
5355

5456
public function __construct()
@@ -233,7 +235,7 @@ private function configureApplication(): void
233235
$this->containerBuilder->register(SymfonyApplication::class, SymfonyApplication::class)
234236
->setArguments([
235237
'Cognitive Code Analysis',
236-
'1.3.1'
238+
self::VERSION
237239
])
238240
->setPublic(true)
239241
->addMethodCall('add', [new Reference(CognitiveMetricsCommand::class)])

0 commit comments

Comments
 (0)