Reimport tag creation script.

This commit is contained in:
flash 2025-05-13 19:49:28 +02:00
parent 606d22466f
commit affcb9ca7d
Signed by: flash
GPG key ID: 6D833BE0D210AC02
2 changed files with 31 additions and 0 deletions

1
VERSION Normal file
View file

@ -0,0 +1 @@
v0.3.1

30
tools/create-tag Executable file
View file

@ -0,0 +1,30 @@
#!/usr/bin/env php
<?php
$path = (function($path) {
if(!str_starts_with($path, '/'))
die('Cannot be bothered to support non-UNIX style paths, sorry!' . PHP_EOL);
while($path !== '/') {
$vPath = $path . DIRECTORY_SEPARATOR . 'VERSION';
if(is_file($vPath))
return $vPath;
$path = dirname($path);
}
})(__DIR__);
$version = file_get_contents($path);
if($version === false)
die('Failed to read VERSION file.' . PHP_EOL);
$version = trim($version);
$workingDir = getcwd();
try {
chdir(dirname($path));
echo shell_exec(sprintf('git tag %s -m "%s"', $version, $version));
echo shell_exec(sprintf('git push origin %s', $version));
} finally {
chdir($workingDir);
}
echo $version . PHP_EOL;