Compare commits
No commits in common. "master" and "v1.0.3" have entirely different histories.
|
@ -1,29 +0,0 @@
|
||||||
|
|
||||||
name: Publish PHP Package
|
|
||||||
|
|
||||||
on:
|
|
||||||
push:
|
|
||||||
tags:
|
|
||||||
- 'v*'
|
|
||||||
|
|
||||||
jobs:
|
|
||||||
docker:
|
|
||||||
runs-on: ubuntu-latest
|
|
||||||
|
|
||||||
steps:
|
|
||||||
- uses: actions/checkout@v3
|
|
||||||
|
|
||||||
- name: Get tag name
|
|
||||||
run: echo "TAG=${GITHUB_REF#refs/*/}" >> $GITHUB_ENV
|
|
||||||
|
|
||||||
- name: zip and send
|
|
||||||
run: |
|
|
||||||
ls -la
|
|
||||||
apt-get update -y
|
|
||||||
apt-get install -y zip
|
|
||||||
cd ../
|
|
||||||
zip -r ${{ gitea.event.repository.name }}.zip ${{ gitea.event.repository.name }} -x '*.git*'
|
|
||||||
curl -v \
|
|
||||||
--user composer-pbl:${{ secrets.COMPOSER_PSWD }} \
|
|
||||||
--upload-file ${{ gitea.event.repository.name }}.zip \
|
|
||||||
https://git.bit5.ru/api/packages/bit/composer?version=${{ env.TAG }}
|
|
|
@ -1 +0,0 @@
|
||||||
tags
|
|
|
@ -4,5 +4,8 @@
|
||||||
"homepage": "https://git.bit5.ru/composer/taskman_version",
|
"homepage": "https://git.bit5.ru/composer/taskman_version",
|
||||||
"require": {
|
"require": {
|
||||||
"php": ">=7.4"
|
"php": ">=7.4"
|
||||||
|
},
|
||||||
|
"autoload": {
|
||||||
|
"classmap": ["version.inc.php"]
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -10,14 +10,16 @@ task('version', function()
|
||||||
|
|
||||||
task('inc_game_version', function()
|
task('inc_game_version', function()
|
||||||
{
|
{
|
||||||
$path_to_version = get_path_to_version_file();
|
global $GAME_ROOT;
|
||||||
|
$path_to_version = $GAME_ROOT . getor('VERSION_FILE', "/VERSION");
|
||||||
ensure_write($path_to_version, get_inc_game_version());
|
ensure_write($path_to_version, get_inc_game_version());
|
||||||
git_try_commit($path_to_version, "inc version");
|
git_try_commit($path_to_version, "inc version");
|
||||||
});
|
});
|
||||||
|
|
||||||
function game_version_full_str()
|
function game_version_full_str()
|
||||||
{
|
{
|
||||||
return trim(file(get_path_to_version_file())[0]);
|
global $GAME_ROOT;
|
||||||
|
return trim(file($GAME_ROOT . getor('VERSION_FILE', "/VERSION"))[0]);
|
||||||
}
|
}
|
||||||
|
|
||||||
function game_version()
|
function game_version()
|
||||||
|
@ -40,7 +42,7 @@ function game_version_code($str = null)
|
||||||
$min = $items[1];
|
$min = $items[1];
|
||||||
$pat = isset($items[2]) ? $items[2] : 0;
|
$pat = isset($items[2]) ? $items[2] : 0;
|
||||||
|
|
||||||
$num = $pat + intval($min)*100 + intval($maj)*1000000;
|
$num = $pat + $min*100 + $maj*1000000;
|
||||||
return $num;
|
return $num;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -57,18 +59,10 @@ function game_patch_code()
|
||||||
return $code;
|
return $code;
|
||||||
}
|
}
|
||||||
|
|
||||||
function get_path_to_version_file()
|
|
||||||
{
|
|
||||||
global $GAME_ROOT;
|
|
||||||
return $GAME_ROOT . '/' . getor('VERSION_FILE_NAME', "VERSION");
|
|
||||||
}
|
|
||||||
|
|
||||||
function get_inc_game_version()
|
function get_inc_game_version()
|
||||||
{
|
{
|
||||||
$string = game_version();
|
$string = game_version();
|
||||||
|
|
||||||
$most_significant_number = -1;
|
|
||||||
|
|
||||||
for($i = strlen($string) - 1; $i >= 0; $i--)
|
for($i = strlen($string) - 1; $i >= 0; $i--)
|
||||||
{
|
{
|
||||||
if(is_numeric($string[$i]))
|
if(is_numeric($string[$i]))
|
||||||
|
@ -94,10 +88,12 @@ function get_inc_game_version()
|
||||||
|
|
||||||
function get_version_file_lifetime()
|
function get_version_file_lifetime()
|
||||||
{
|
{
|
||||||
exec("git log --follow --format=%ad --date=format:\"%Y-%m-%d %H:%M:%S\" " . get_path_to_version_file() , $out, $ret);
|
global $GAME_ROOT;
|
||||||
|
|
||||||
|
exec("git log --follow --format=%ad --date=format:'%Y-%m-%d %H:%M:%S' " . $GAME_ROOT . getor('VERSION_FILE', "/VERSION") , $out, $ret);
|
||||||
if($ret != 0)
|
if($ret != 0)
|
||||||
throw new Exception("git error");
|
throw new Exception("git error");
|
||||||
$minutes = (time() - strtotime($out[0])) / 60;
|
$minutes = (time() - strtotime($out[0])) / 60;
|
||||||
|
|
||||||
return ceil($minutes);
|
return ceil($minutes);
|
||||||
}
|
}
|
Loading…
Reference in New Issue