From 8bf4f9a67d18bc95a7f16f11559fddc64629af47 Mon Sep 17 00:00:00 2001 From: Toon Verwerft Date: Fri, 29 May 2026 10:27:15 +0200 Subject: [PATCH] Sync wsdl-tools console version & add release Makefile The console application hardcoded its version (1.0.0), which drifted from the released git tags so `./bin/wsdl` printed a stale version. - Extract the version into a `APP_VERSION` constant set to 1.21.0 (the latest release), so it is both discoverable and rewritable. - Add a Makefile `tag` target (modelled on phpro/grumphp) that rewrites APP_VERSION, lints, commits and creates a signed tag without the `v` prefix, keeping the constant and the tag in sync by construction. --- Makefile | 12 ++++++++++++ src/Console/AppFactory.php | 4 +++- 2 files changed, 15 insertions(+), 1 deletion(-) create mode 100644 Makefile diff --git a/Makefile b/Makefile new file mode 100644 index 0000000..61f6600 --- /dev/null +++ b/Makefile @@ -0,0 +1,12 @@ +help: + @echo "Please use \`make ' where is one of" + @echo " tag to modify the version and tag" + +tag: + $(if $(TAG),,$(error TAG is not defined. Pass via "make tag TAG=1.22.0")) + @echo Tagging $(TAG) + sed -i '' -e "s/APP_VERSION = '.*'/APP_VERSION = '$(TAG)'/" src/Console/AppFactory.php + php -l src/Console/AppFactory.php + git add -A + git commit -m '$(TAG) release' -n + git tag -s '$(TAG)' -m 'Version $(TAG)' diff --git a/src/Console/AppFactory.php b/src/Console/AppFactory.php index 1b946fa..4cd2320 100644 --- a/src/Console/AppFactory.php +++ b/src/Console/AppFactory.php @@ -8,6 +8,8 @@ final class AppFactory { + private const APP_VERSION = '1.21.0'; + /** * @psalm-suppress UndefinedClass * @var list @@ -21,7 +23,7 @@ final class AppFactory */ public static function create(): Application { - $app = new Application('wsdl-tools', '1.0.0'); + $app = new Application('wsdl-tools', self::APP_VERSION); $app->addCommands([ new Command\FlattenCommand(), new Command\ValidateCommand(),