Compare commits

...

11 Commits

Author SHA1 Message Date
Alexey Chubar 54694eaed0 Edited changelog
Publish PHP Package / docker (push) Successful in 6s Details
2025-03-13 19:46:05 +07:00
Alexey Chubar c4be07e36e Edited changelog 2025-03-13 19:32:09 +07:00
Alexey Chubar d73f06fec8 Added unity helper method 2025-03-13 19:07:33 +07:00
Alexey Chubar 5ae5b81992 guess_unity_app_dir fix for linux
Publish PHP Package / docker (push) Successful in 7s Details
2025-03-11 15:57:47 +07:00
Alexey Chubar eebc83e8a7 Added a low-level task for unity_batch_exec
Publish PHP Package / docker (push) Successful in 6s Details
2024-10-14 12:58:06 +03:00
wrenge 2b11b6724b Linux build fix
Publish PHP Package / docker (push) Successful in 6s Details
2024-09-17 17:34:51 +03:00
Pavel Shevaev 08b65dd720 Добавить .gitea/workflows/build_composer.yaml
Publish PHP Package / docker (push) Successful in 6s Details
2024-02-13 14:46:35 +03:00
Pavel Shevaev 113d64a8db Изменил(а) на 'composer.json' 2023-10-24 18:26:20 +03:00
Pavel Shevaev f72fb3ca5a Tweaking composer autoload 2023-10-24 17:33:23 +03:00
Pavel Shevaev 7c47baa66b Making PHPStan happy 2023-08-16 14:06:32 +03:00
wrenge 62567e2d40 unity task linux support 2023-07-06 22:19:58 +03:00
5 changed files with 77 additions and 8 deletions

View File

@ -0,0 +1,29 @@
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
.gitignore vendored Normal file
View File

@ -0,0 +1 @@
tags

View File

@ -1,10 +1,13 @@
# Change Log
All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](http://keepachangelog.com/)
and this project adheres to [Semantic Versioning](http://semver.org/).
## [1.0.21] - 2025-03-13
### Fixed
- Added helper methods, fixed Linux
## [1.0.5] - 2022-08-09
### Fixed
- Unity task on windows not working
@ -18,4 +21,4 @@ and this project adheres to [Semantic Versioning](http://semver.org/).
- A changelog. Cuz why not? :D
### Fixed
- Task unity now uses proper folder from propery
- Task unity now uses proper folder from propery

View File

@ -4,8 +4,5 @@
"homepage": "https://git.bit5.ru/composer/taskman_unity",
"require": {
"php": ">=7.4"
},
"autoload": {
"classmap": ["unity.inc.php"]
}
}

View File

@ -11,6 +11,12 @@ task('unity', function()
$unity_app_path = "'$unity_path/Editor/Unity.exe'";
run_background_proc($unity_app_path, ['-projectPath', "$proj_path"]);
}
else if(is_linux())
{
$unity_path = get('UNITY_APP_DIR');
$unity_app_path = "'$unity_path/Editor/Unity'";
run_background_proc($unity_app_path, ['-projectPath', "$proj_path"]);
}
else
{
$cmd = guess_unity_app_dir()."'Unity.app/Contents/MacOS/Unity' -projectPath '$proj_path' > /dev/null 2>&1&";
@ -95,6 +101,19 @@ function unity_batch_exec($func, $build_target = "")
);
}
task('unity_batch_exec', function(array $args)
{
if(count($args) != 2)
{
echo "Usage: gamectl unity_batch_exec <method name> <platform>\n";
return;
}
$func = $args[0];
$platform = $args[1];
unity_batch_exec($func, $platform);
});
function unity_run_proc($shared_cmd)
{
$app_dir = get('UNITY_APP_DIR');
@ -105,6 +124,10 @@ function unity_run_proc($shared_cmd)
$unity_app_path = $app_dir . "Editor/Unity.exe";
$cmd = "powershell.exe (Start-Process '$unity_app_path'-ArgumentList '$shared_cmd' -passthru).Id";
}
else if(is_linux())
{
$cmd = "'$app_dir/Editor/Unity' $shared_cmd > /dev/null & echo $!";
}
else
{
$cmd = "'$app_dir/Unity.app/Contents/MacOS/Unity' $shared_cmd > /dev/null & echo $!";
@ -152,6 +175,8 @@ function guess_unity_app_dir()
$path = "/Applications/Unity/";
if(is_win())
$path = getenv("ProgramFiles")."/Unity/";
else if(is_linux())
$path = getenv("HOME")."/Unity/";
$proj_version_file = $GAME_ROOT.'/unity/ProjectSettings/ProjectVersion.txt';
if(is_file($proj_version_file))
@ -172,6 +197,20 @@ function get_unity_dir()
return "$app_dir/Unity.app/Contents/";
}
function unity_build_cmd($shared_cmd)
{
$app_dir = get('UNITY_APP_DIR');
if(is_win())
$cmd = "\"$app_dir/Editor/Unity.exe\" $shared_cmd";
else if(is_linux())
$cmd = "\"$app_dir/Editor/Unity\" $shared_cmd";
else
$cmd = "$app_dir/Unity.app/Contents/MacOS/Unity $shared_cmd";
return $cmd;
}
function mono_mcs_bin()
{
if(!get("USE_UNITY_MONO"))
@ -246,9 +285,9 @@ function build_mono($src_spec, $out_file, $ref_dlls = array(), $mcs_opts = "")
foreach($sources as $src)
{
if(is_win())
$sources_str .= '"'.normalize_path($src, !is_win()).'" ';
$sources_str .= '"'.normalize_path($src).'" ';
else
$sources_str .= '\''.normalize_path($src, !is_win()).'\' ';
$sources_str .= '\''.normalize_path($src).'\' ';
}
$deps = $sources;
@ -294,7 +333,7 @@ function run_mono($exe_file)
if(is_win())
{
$unity_dir = "$app_dir/Editor/Data";
$mono_bin = '"' . normalize_path("$unity_dir/Mono/bin/mono", !is_win()) . '"';
$mono_bin = '"' . normalize_path("$unity_dir/Mono/bin/mono") . '"';
}
else
{