Compare commits
No commits in common. "master" and "v1.0.7" have entirely different histories.
|
@ -1,31 +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,2 +0,0 @@
|
||||||
## v1.1.0
|
|
||||||
- Adding support for root directory .env file which is used to set environment variables
|
|
33
env.inc.php
33
env.inc.php
|
@ -26,8 +26,6 @@ function put_env(&$argv)
|
||||||
{
|
{
|
||||||
global $GAME_ROOT;
|
global $GAME_ROOT;
|
||||||
|
|
||||||
_set_env_vars_from_file();
|
|
||||||
|
|
||||||
$env = '';
|
$env = '';
|
||||||
$filtered = array();
|
$filtered = array();
|
||||||
for($i=0;$i<sizeof($argv);++$i)
|
for($i=0;$i<sizeof($argv);++$i)
|
||||||
|
@ -55,37 +53,6 @@ function put_env(&$argv)
|
||||||
putenv("GAME_ENV=");
|
putenv("GAME_ENV=");
|
||||||
}
|
}
|
||||||
|
|
||||||
function _set_env_vars_from_file()
|
|
||||||
{
|
|
||||||
global $GAME_ROOT;
|
|
||||||
|
|
||||||
if(!file_exists($GAME_ROOT . '/.env'))
|
|
||||||
return;
|
|
||||||
|
|
||||||
$var_arrs = array();
|
|
||||||
$lines = file($GAME_ROOT . '/.env');
|
|
||||||
foreach($lines as $line)
|
|
||||||
{
|
|
||||||
$line = trim($line);
|
|
||||||
|
|
||||||
$line_is_comment = (substr(trim($line),0 , 1) == '#') ? true: false;
|
|
||||||
|
|
||||||
if($line_is_comment || empty(trim($line)))
|
|
||||||
continue;
|
|
||||||
|
|
||||||
// Split the line variable and succeeding comment on line if exists
|
|
||||||
$line_no_comment = explode("#", $line, 2)[0];
|
|
||||||
// Split the variable name and value
|
|
||||||
$env_ex = preg_split('/(\s?)\=(\s?)/', $line_no_comment);
|
|
||||||
$env_name = trim($env_ex[0]);
|
|
||||||
$env_value = isset($env_ex[1]) ? trim($env_ex[1]) : "";
|
|
||||||
$var_arrs[$env_name] = $env_value;
|
|
||||||
}
|
|
||||||
|
|
||||||
foreach($var_arrs as $k => $v)
|
|
||||||
putenv("$k=$v");
|
|
||||||
}
|
|
||||||
|
|
||||||
function set_root_env_name($root_name)
|
function set_root_env_name($root_name)
|
||||||
{
|
{
|
||||||
$GLOBALS['TASKMAN_ROOT_ENV_NAME'] = $root_name;
|
$GLOBALS['TASKMAN_ROOT_ENV_NAME'] = $root_name;
|
||||||
|
|
Loading…
Reference in New Issue