Skip to content

Commit

Permalink
Merge pull request #153 from hydephp/release/v0.7.59
Browse files Browse the repository at this point in the history
HydeCLI v0.7.59
  • Loading branch information
caendesilva authored Apr 21, 2024
2 parents 80cb325 + fe4b0e2 commit d3c7534
Show file tree
Hide file tree
Showing 9 changed files with 86 additions and 73 deletions.
6 changes: 3 additions & 3 deletions .github/workflows/create-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ jobs:
name: Prepare a new release

steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
with:
ssh-key: ${{ secrets.SSH_PRIVATE_KEY }}
ref: stable
Expand Down Expand Up @@ -61,7 +61,7 @@ jobs:
run: php builds/hyde --version

- name: Upload executable artifact
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4
with:
name: hyde
path: builds/hyde
Expand Down Expand Up @@ -93,7 +93,7 @@ jobs:
- name: Upload signature artifact
if: github.event.repository.full_name == 'hydephp/cli'
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4
with:
name: signature
path: builds/hyde.sig
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/publish-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ jobs:
name: Merge stable branch into master

steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
with:
ssh-key: ${{ secrets.SSH_PRIVATE_KEY }}
ref: master
Expand All @@ -37,7 +37,7 @@ jobs:
contents: write

steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
with:
ssh-key: ${{ secrets.SSH_PRIVATE_KEY }}
ref: stable
Expand Down
26 changes: 13 additions & 13 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,11 +19,11 @@ jobs:
extensions:
fileinfo

- uses: actions/checkout@v3
- uses: actions/checkout@v4

- name: Cache Composer packages
id: composer-cache
uses: actions/cache@v3
uses: actions/cache@v4
with:
path: vendor
key: ${{ runner.os }}-php-${{ hashFiles('**/composer.lock') }}
Expand All @@ -37,7 +37,7 @@ jobs:
run: vendor/bin/pest --coverage --coverage-clover ./coverage.xml

- name: Upload coverage reports to Codecov
uses: codecov/codecov-action@v3
uses: codecov/codecov-action@v4


run-tests:
Expand All @@ -59,14 +59,14 @@ jobs:
php-version: ${{ matrix.php }}
extensions: fileinfo

- uses: actions/checkout@v3
- uses: actions/checkout@v4

- name: Validate composer.json and composer.lock
run: composer validate --strict

- name: Cache Composer packages
id: composer-cache
uses: actions/cache@v3
uses: actions/cache@v4
with:
path: vendor
key: ${{ runner.os }}-php-${{ hashFiles('**/composer.lock') }}
Expand All @@ -84,11 +84,11 @@ jobs:
name: Build standalone executable

steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4

- name: Cache Composer packages
id: composer-cache
uses: actions/cache@v3
uses: actions/cache@v4
with:
path: vendor
key: ${{ runner.os }}-php-${{ hashFiles('**/composer.lock') }}
Expand All @@ -114,7 +114,7 @@ jobs:
run: php builds/hyde --version

- name: Upload executable
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4
with:
name: hyde
path: builds/hyde
Expand All @@ -138,11 +138,11 @@ jobs:
php-version: ${{ matrix.php }}
extensions: fileinfo

- uses: actions/checkout@v3
- uses: actions/checkout@v4
with:
path: ./source

- uses: actions/download-artifact@v3
- uses: actions/download-artifact@v4
with:
name: hyde
path: .
Expand Down Expand Up @@ -212,7 +212,7 @@ jobs:
php-version: 8.1
extensions: fileinfo

- uses: actions/download-artifact@v3
- uses: actions/download-artifact@v4
with:
name: hyde
path: .
Expand Down Expand Up @@ -249,7 +249,7 @@ jobs:
php-version: 8.1
extensions: fileinfo

- uses: actions/download-artifact@v3
- uses: actions/download-artifact@v4
with:
name: hyde
path: .
Expand Down Expand Up @@ -301,7 +301,7 @@ jobs:
php-version: 8.1
extensions: fileinfo

- uses: actions/download-artifact@v3
- uses: actions/download-artifact@v4
with:
name: hyde
path: .
Expand Down
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,8 @@ Please note that the standalone HydePHP version is **experimental**, and that th
composer global require hyde/cli
```

Make sure to place the Composer system-wide vendor bin directory in your `$PATH` so the `hyde` executable can be located by your system. This directory is typically located at `$HOME/.composer/vendor/bin`.

### Direct Download (Unix) <a href="https://github.com/hydephp/cli/releases/latest"><img alt="Total Installs on GitHub" src="https://img.shields.io/github/downloads/hydephp/cli/total.svg" align="right"></a>

```bash
Expand Down
2 changes: 1 addition & 1 deletion app/Application.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

class Application extends \Hyde\Foundation\Application
{
final public const APP_VERSION = '0.7.58';
final public const APP_VERSION = '0.7.59';

public function getCachedPackagesPath(): string
{
Expand Down
37 changes: 22 additions & 15 deletions app/Commands/SelfUpdateCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -391,21 +391,8 @@ protected function runComposerProcess(): array
$command = self::COMPOSER_COMMAND;

if (PHP_OS_FAMILY === 'Windows') {
// We need to run Composer as an administrator on Windows, so we use PowerShell to request a UAC prompt if needed.
$powerShell = sprintf("Start-Process -Verb RunAs powershell -ArgumentList '-Command %s'", escapeshellarg($command));
$command = 'powershell -Command "'.$powerShell.'"';
$this->debug("Running command: $command");
exec($command, $output, $exitCode);

if ($exitCode !== 0) {
$this->error('The Composer command failed with exit code '.$exitCode);
$this->output->writeln($output);
exit($exitCode);
} else {
$this->info('The installation will continue in a new window as you may need to provide administrator permissions.');
// We need to exit here so we can release the binary as Composer can't modify it when we are using it
exit(0);
}
// We need to exit here so we can release the binary as Composer can't modify it when we are using it
exit($this->runComposerWindowsProcess());
}

$output = [];
Expand All @@ -419,6 +406,26 @@ protected function runComposerProcess(): array
return [$result->exitCode(), $output];
}

protected function runComposerWindowsProcess(): int
{
$command = self::COMPOSER_COMMAND;

// We need to run Composer as an administrator on Windows, so we use PowerShell to request a UAC prompt if needed.
$powerShell = sprintf("Start-Process -Verb RunAs powershell -ArgumentList '-Command %s'", escapeshellarg($command));
$command = 'powershell -Command "'.$powerShell.'"';
$this->debug("Running command: $command");
exec($command, $output, $exitCode);

if ($exitCode !== 0) {
$this->error('The Composer command failed with exit code '.$exitCode);
$this->output->writeln($output);
} else {
$this->info('The installation will continue in a new window as you may need to provide administrator permissions.');
}

return $exitCode;
}

protected function debug(string $message): void
{
if ($this->output->isVerbose()) {
Expand Down
Binary file modified builds/hyde
Binary file not shown.
Binary file modified builds/hyde.sig
Binary file not shown.
82 changes: 43 additions & 39 deletions composer.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit d3c7534

Please sign in to comment.