Skip to content

Commit

Permalink
testing set ENV
Browse files Browse the repository at this point in the history
  • Loading branch information
inhere committed Nov 19, 2020
1 parent 83b9594 commit 0ce0723
Show file tree
Hide file tree
Showing 4 changed files with 27 additions and 23 deletions.
12 changes: 9 additions & 3 deletions .github/workflows/php.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,15 @@ jobs:
- name: Checkout
uses: actions/checkout@v2

- name: Set ENV vars
# https://docs.github.com/en/free-pro-team@latest/actions/reference/workflow-commands-for-github-actions#setting-an-environment-variable
run: |
echo "RELEASE_TAG=${GITHUB_REF:10}" >> $GITHUB_ENV
echo "RELEASE_NAME=$GITHUB_WORKFLOW" >> $GITHUB_ENV
- name: Display Env
run: env

# usage refer https://github.com/shivammathur/setup-php
- name: Setup PHP
timeout-minutes: 5
Expand All @@ -33,9 +42,6 @@ jobs:
ini-values: post_max_size=56M, short_open_tag=On #optional, setup php.ini configuration
coverage: none #optional, setup coverage driver: xdebug, none

- name: Display Env
run: env

- name: Install dependencies
run: composer install --no-progress --no-suggest

Expand Down
16 changes: 8 additions & 8 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,13 +20,10 @@ jobs:
uses: actions/checkout@v2

- name: Set ENV for github-release
# https://docs.github.com/en/free-pro-team@latest/actions/reference/workflow-commands-for-github-actions#setting-an-environment-variable
run: |
# echo ::set-env name=RELEASE_NAME::"$GITHUB_WORKFLOW"
# echo ::set-env name=RELEASE_TAG::$(echo ${GITHUB_REF:10})
echo "${GITHUB_REF:10}" >> $RELEASE_TAG
echo "$GITHUB_WORKFLOW" >> $RELEASE_NAME
echo $RELEASE_TAG
echo $RELEASE_NAME
echo "RELEASE_TAG=${GITHUB_REF:10}" >> $GITHUB_ENV
echo "RELEASE_NAME=$GITHUB_WORKFLOW" >> $GITHUB_ENV
# usage refer https://github.com/shivammathur/setup-php
- name: Setup PHP
Expand All @@ -50,9 +47,12 @@ jobs:

- name: Build phar and send to github assets
run: |
php -d phar.readonly=0 bin/kite phar:pack -o kite-${RELEASE_TAG}.phar --no-progress
php kite-${RELEASE_TAG}.phar -V
echo $RELEASE_TAG
echo $RELEASE_NAME
php -d phar.readonly=0 bin/kite phar:pack -o kite-${RELEASE_TAG}.phar --no-progress
php kite-${RELEASE_TAG}.phar -V
# https://github.com/actions/create-release
- uses: meeDamian/github-release@2.0
with:
gzip: false
Expand Down
11 changes: 5 additions & 6 deletions app/Common/CmdRunner.php
Original file line number Diff line number Diff line change
Expand Up @@ -327,8 +327,7 @@ public function run(bool $printOutput = false): self

// stop on error
if (0 !== $this->code && false === $this->ignoreError) {
Color::println($this->getError(), 'red');
Color::println("\nCommand exit code != 0(code: {$this->code}), stop run.", 'red');
Color::println("\nCommand exit code not equal to 0(code: {$this->code}), stop run.", 'red');
break;
}
}
Expand Down Expand Up @@ -376,10 +375,10 @@ protected function execute(string $command, string $workDir): void
// print output
$this->output = $output;
if ($this->printOutput) {
if ($output) {
echo $output . "\n";
} elseif ($this->error) {
Color::println($this->error, 'red');
if ($code !== 0 && $this->error) {
Color::println("ERR($code): " . $this->error, 'red');
} else {
echo ($output ?: $error) . "\n";
}
}
}
Expand Down
11 changes: 5 additions & 6 deletions app/Console/Controller/GitFlowController.php
Original file line number Diff line number Diff line change
Expand Up @@ -130,12 +130,10 @@ public function newBranchCommand(Input $input, Output $output): void
->setDryRun($input->getBoolOpt('dry-run'))
->run(true);

if ($cmd->isFail()) {
$output->error($cmd->getOutput() ?: 'Failure');
return;
if ($cmd->isSuccess()) {
// $output->error($cmd->getOutput() ?: 'Failure');
$output->success('Complete');
}

$output->success('Complete');
}

/**
Expand All @@ -153,8 +151,9 @@ public function resolveCommand(Input $input, Output $output): void
// git merge CUR_BRANCH
// resolve conflicts
// git add . && git ci
$branch = $input->getRequiredArg('branch');

$output->success('Complete');
$output->success('Complete for ' . $branch);
}

protected function syncConfigure(): void
Expand Down

0 comments on commit 0ce0723

Please sign in to comment.