mirror of
https://github.com/shivammathur/setup-php.git
synced 2026-12-06 09:50:56 +00:00
Compare commits
2
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
de6e68eb30 | ||
|
|
6584f79bb6 |
@@ -14,7 +14,6 @@ This security policy only applies to the latest patch releases of the following
|
|||||||
| 8.3 | :white_check_mark: |
|
| 8.3 | :white_check_mark: |
|
||||||
| 8.4 | :white_check_mark: |
|
| 8.4 | :white_check_mark: |
|
||||||
| 8.5 | :white_check_mark: |
|
| 8.5 | :white_check_mark: |
|
||||||
| 8.6 | :white_check_mark: |
|
|
||||||
|
|
||||||
## Reporting a Vulnerability
|
## Reporting a Vulnerability
|
||||||
|
|
||||||
|
|||||||
@@ -26,13 +26,13 @@ jobs:
|
|||||||
persist-credentials: false
|
persist-credentials: false
|
||||||
|
|
||||||
- name: Initialize CodeQL
|
- name: Initialize CodeQL
|
||||||
uses: github/codeql-action/init@915412ff23e8b7659517e607487dbeae018f2934 # v4
|
uses: github/codeql-action/init@2892aa5e19bbd11bc0cff5427e3b750a04d9e3c2 # v4
|
||||||
with:
|
with:
|
||||||
config-file: ./.github/codeql/codeql-configuration.yml
|
config-file: ./.github/codeql/codeql-configuration.yml
|
||||||
languages: javascript
|
languages: javascript
|
||||||
|
|
||||||
- name: Autobuild
|
- name: Autobuild
|
||||||
uses: github/codeql-action/autobuild@915412ff23e8b7659517e607487dbeae018f2934 # v4
|
uses: github/codeql-action/autobuild@2892aa5e19bbd11bc0cff5427e3b750a04d9e3c2 # v4
|
||||||
|
|
||||||
- name: Perform CodeQL Analysis
|
- name: Perform CodeQL Analysis
|
||||||
uses: github/codeql-action/analyze@915412ff23e8b7659517e607487dbeae018f2934 # v4
|
uses: github/codeql-action/analyze@2892aa5e19bbd11bc0cff5427e3b750a04d9e3c2 # v4
|
||||||
|
|||||||
@@ -23,7 +23,7 @@ jobs:
|
|||||||
php-versions: ['5.3', '5.4', '5.5', '5.6', '7.0', '7.1', '7.2', '7.3', '7.4', '8.0', '8.1', '8.2', '8.3', '8.4', '8.5', '8.6', '8.7']
|
php-versions: ['5.3', '5.4', '5.5', '5.6', '7.0', '7.1', '7.2', '7.3', '7.4', '8.0', '8.1', '8.2', '8.3', '8.4', '8.5', '8.6', '8.7']
|
||||||
steps:
|
steps:
|
||||||
- name: Setup PHP
|
- name: Setup PHP
|
||||||
uses: shivammathur/setup-php@eb7c497e18156a6bbabfef1d3a82760b9eda3962 # v2
|
uses: shivammathur/setup-php@f3e473d116dcccaddc5834248c87452386958240 # v2
|
||||||
with:
|
with:
|
||||||
php-version: ${{ matrix.php-versions }}
|
php-version: ${{ matrix.php-versions }}
|
||||||
tools: none
|
tools: none
|
||||||
@@ -42,7 +42,7 @@ jobs:
|
|||||||
run: |
|
run: |
|
||||||
php -m | Out-File -FilePath "$env:file.all" -Append
|
php -m | Out-File -FilePath "$env:file.all" -Append
|
||||||
- name: Setup PHP
|
- name: Setup PHP
|
||||||
uses: shivammathur/setup-php@eb7c497e18156a6bbabfef1d3a82760b9eda3962 # v2
|
uses: shivammathur/setup-php@f3e473d116dcccaddc5834248c87452386958240 # v2
|
||||||
with:
|
with:
|
||||||
php-version: ${{ matrix.php-versions }}
|
php-version: ${{ matrix.php-versions }}
|
||||||
extensions: none
|
extensions: none
|
||||||
@@ -91,7 +91,7 @@ jobs:
|
|||||||
Remove-Item "$env:file.all" -Force
|
Remove-Item "$env:file.all" -Force
|
||||||
Remove-Item "$env:file.builtin" -Force
|
Remove-Item "$env:file.builtin" -Force
|
||||||
- name: Upload artifacts
|
- name: Upload artifacts
|
||||||
uses: actions/upload-artifact@cf430e030ddbb5b0abf93d22962f4752f3646cd9 # v7
|
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7
|
||||||
with:
|
with:
|
||||||
name: lists-php${{ matrix.php-versions }}-${{ matrix.operating-system }}.md
|
name: lists-php${{ matrix.php-versions }}-${{ matrix.operating-system }}.md
|
||||||
path: php${{ matrix.php-versions }}-${{ matrix.operating-system }}.md
|
path: php${{ matrix.php-versions }}-${{ matrix.operating-system }}.md
|
||||||
@@ -109,7 +109,7 @@ jobs:
|
|||||||
repository: ${{ github.repository }}.wiki
|
repository: ${{ github.repository }}.wiki
|
||||||
persist-credentials: false
|
persist-credentials: false
|
||||||
- name: Download artifacts
|
- name: Download artifacts
|
||||||
uses: actions/download-artifact@9000827ccba6bdab643e8b6fd33ac0654aef8333 # v8
|
uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8
|
||||||
with:
|
with:
|
||||||
path: ${{ github.workspace }}/lists
|
path: ${{ github.workspace }}/lists
|
||||||
pattern: lists-*
|
pattern: lists-*
|
||||||
|
|||||||
@@ -39,7 +39,7 @@ jobs:
|
|||||||
persist-credentials: false
|
persist-credentials: false
|
||||||
|
|
||||||
- name: Setup Node.js 24.x
|
- name: Setup Node.js 24.x
|
||||||
uses: actions/setup-node@949feb2413d6458794dcd2491c4babbbce0c15c1 # v6
|
uses: actions/setup-node@820762786026740c76f36085b0efc47a31fe5020 # v6
|
||||||
with:
|
with:
|
||||||
node-version: 24.x
|
node-version: 24.x
|
||||||
|
|
||||||
|
|||||||
@@ -23,7 +23,7 @@ concurrency:
|
|||||||
group: ${{ github.workflow }}-${{ github.ref }}
|
group: ${{ github.workflow }}-${{ github.ref }}
|
||||||
cancel-in-progress: true
|
cancel-in-progress: true
|
||||||
env:
|
env:
|
||||||
default-php-version: '8.6'
|
default-php-version: '8.5'
|
||||||
jobs:
|
jobs:
|
||||||
run:
|
run:
|
||||||
name: Run
|
name: Run
|
||||||
@@ -48,7 +48,7 @@ jobs:
|
|||||||
|
|
||||||
- name: Setup cache environment
|
- name: Setup cache environment
|
||||||
id: cache-env
|
id: cache-env
|
||||||
uses: shivammathur/cache-extensions@0769e8b0c165c62888174c0fe66557ca1616ae45 # v1
|
uses: shivammathur/cache-extensions@de3c642a5fce0ef91581a1c9831e229f525196d6 # v1
|
||||||
with:
|
with:
|
||||||
php-version: ${{ matrix.php-versions || env.default-php-version }}
|
php-version: ${{ matrix.php-versions || env.default-php-version }}
|
||||||
extensions: ${{ env.extensions }}
|
extensions: ${{ env.extensions }}
|
||||||
|
|||||||
@@ -38,7 +38,7 @@ jobs:
|
|||||||
persist-credentials: false
|
persist-credentials: false
|
||||||
|
|
||||||
- name: Setup Node.js
|
- name: Setup Node.js
|
||||||
uses: actions/setup-node@949feb2413d6458794dcd2491c4babbbce0c15c1 # v6
|
uses: actions/setup-node@820762786026740c76f36085b0efc47a31fe5020 # v6
|
||||||
with:
|
with:
|
||||||
node-version: '24.x'
|
node-version: '24.x'
|
||||||
registry-url: https://registry.npmjs.org
|
registry-url: https://registry.npmjs.org
|
||||||
@@ -60,7 +60,7 @@ jobs:
|
|||||||
run: npm publish --access public --tag "${{ steps.publish-tag.outputs.tag }}"
|
run: npm publish --access public --tag "${{ steps.publish-tag.outputs.tag }}"
|
||||||
|
|
||||||
- name: Change to GitHub Packages registry
|
- name: Change to GitHub Packages registry
|
||||||
uses: actions/setup-node@949feb2413d6458794dcd2491c4babbbce0c15c1 # v6
|
uses: actions/setup-node@820762786026740c76f36085b0efc47a31fe5020 # v6
|
||||||
with:
|
with:
|
||||||
registry-url: https://npm.pkg.github.com
|
registry-url: https://npm.pkg.github.com
|
||||||
package-manager-cache: false
|
package-manager-cache: false
|
||||||
|
|||||||
@@ -17,9 +17,6 @@
|
|||||||
<a href="https://twitter.com/setup_php" title="setup-php twitter"><img alt="setup-php twitter" src="https://img.shields.io/badge/twitter-follow-1DA1F2?logo=twitter&logoColor=1DA1F2&labelColor=555555"></a>
|
<a href="https://twitter.com/setup_php" title="setup-php twitter"><img alt="setup-php twitter" src="https://img.shields.io/badge/twitter-follow-1DA1F2?logo=twitter&logoColor=1DA1F2&labelColor=555555"></a>
|
||||||
<a href="https://status.setup-php.com" title="setup-php status"><img alt="setup-php status" src="https://img.shields.io/badge/status-subscribe-28A745?logo=statuspage&logoColor=28A745&labelColor=555555"></a>
|
<a href="https://status.setup-php.com" title="setup-php status"><img alt="setup-php status" src="https://img.shields.io/badge/status-subscribe-28A745?logo=statuspage&logoColor=28A745&labelColor=555555"></a>
|
||||||
</p>
|
</p>
|
||||||
<p align="center">
|
|
||||||
<a target="_blank" href="https://namespace.so/github-actions/?utm_source=oss&utm_campaign=setup-php"><img src="https://namespace.so/oss/badge.svg" alt="CI powered by Namespace" height="32" align="middle"></a>
|
|
||||||
</p>
|
|
||||||
|
|
||||||
Setup PHP with required extensions, php.ini configuration, code-coverage support, and various tools like composer in [GitHub Actions](https://github.com/features/actions "GitHub Actions"). This action gives you a cross-platform interface to set up the PHP environment you need to test your application. Refer to the [Usage](#memo-usage "How to use this") section and [examples](#examples "Examples of use") to see how to use this.
|
Setup PHP with required extensions, php.ini configuration, code-coverage support, and various tools like composer in [GitHub Actions](https://github.com/features/actions "GitHub Actions"). This action gives you a cross-platform interface to set up the PHP environment you need to test your application. Refer to the [Usage](#memo-usage "How to use this") section and [examples](#examples "Examples of use") to see how to use this.
|
||||||
|
|
||||||
@@ -44,7 +41,6 @@ Setup PHP with required extensions, php.ini configuration, code-coverage support
|
|||||||
- [Nightly Build Setup](#nightly-build-setup)
|
- [Nightly Build Setup](#nightly-build-setup)
|
||||||
- [Debug Build Setup](#debug-build-setup)
|
- [Debug Build Setup](#debug-build-setup)
|
||||||
- [Thread Safe Setup](#thread-safe-setup)
|
- [Thread Safe Setup](#thread-safe-setup)
|
||||||
- [ASAN Build Setup](#asan-build-setup)
|
|
||||||
- [Force Update Setup](#force-update-setup)
|
- [Force Update Setup](#force-update-setup)
|
||||||
- [Verbose Setup](#verbose-setup)
|
- [Verbose Setup](#verbose-setup)
|
||||||
- [Multi-Arch Setup](#multi-arch-setup)
|
- [Multi-Arch Setup](#multi-arch-setup)
|
||||||
@@ -115,7 +111,8 @@ Both `GitHub-hosted` and `self-hosted` runners are supported by `setup-php` on t
|
|||||||
|
|
||||||
On all supported OS/Platforms, the following PHP versions can be set up as per the runner.
|
On all supported OS/Platforms, the following PHP versions can be set up as per the runner.
|
||||||
|
|
||||||
- PHP 5.3 to PHP 8.7 on supported GitHub-hosted runners, including macOS ARM64 runners.
|
- PHP 5.3 to PHP 8.7 on GitHub-hosted runners, except for macOS ARM64 runners.
|
||||||
|
- PHP 5.6 to PHP 8.7 on GitHub-hosted macOS ARM64 runners.
|
||||||
- PHP 5.6 to PHP 8.7 on self-hosted runners.
|
- PHP 5.6 to PHP 8.7 on self-hosted runners.
|
||||||
|
|
||||||
| PHP Version | Stability | Release Support | Runner Support |
|
| PHP Version | Stability | Release Support | Runner Support |
|
||||||
@@ -135,12 +132,12 @@ On all supported OS/Platforms, the following PHP versions can be set up as per t
|
|||||||
| `8.3` | `Stable` | `Security fixes only` | `GitHub-hosted`, `self-hosted` |
|
| `8.3` | `Stable` | `Security fixes only` | `GitHub-hosted`, `self-hosted` |
|
||||||
| `8.4` | `Stable` | `Active` | `GitHub-hosted`, `self-hosted` |
|
| `8.4` | `Stable` | `Active` | `GitHub-hosted`, `self-hosted` |
|
||||||
| `8.5` | `Stable` | `Active` | `GitHub-hosted`, `self-hosted` |
|
| `8.5` | `Stable` | `Active` | `GitHub-hosted`, `self-hosted` |
|
||||||
| `8.6` | `Stable` | `Active` | `GitHub-hosted`, `self-hosted` |
|
| `8.6` | `Nightly` | `In development` | `GitHub-hosted`, `self-hosted` |
|
||||||
| `8.7` | `Nightly` | `In development` | `GitHub-hosted`, `self-hosted` |
|
| `8.7` | `Nightly` | `In development` | `GitHub-hosted`, `self-hosted` |
|
||||||
|
|
||||||
|
|
||||||
> [!Note]
|
> [!Note]
|
||||||
> - Specifying `8.6` in the `php-version` input selects the PHP 8.6 stable series. Specifying `8.7`, `nightly`, or `master` installs a nightly build of PHP 8.7 from the master branch of PHP. See [nightly build setup](#nightly-build-setup) for more information.
|
> - Specifying `8.7` or `master` in `php-version` input installs a nightly build of `PHP 8.7.0-dev` from the master branch of PHP. Specifying `8.6` or `nightly` installs a nightly build of `PHP 8.6.0-dev` from the PHP-8.6 branch. See [nightly build setup](#nightly-build-setup) for more information.
|
||||||
> - To use JIT on `PHP 8.0` and above, refer to the [JIT configuration](#jit-configuration) section.
|
> - To use JIT on `PHP 8.0` and above, refer to the [JIT configuration](#jit-configuration) section.
|
||||||
|
|
||||||
## :heavy_plus_sign: PHP Extension Support
|
## :heavy_plus_sign: PHP Extension Support
|
||||||
@@ -177,8 +174,6 @@ PHP extensions can be set up using the `extensions` input. It accepts a `string`
|
|||||||
|
|
||||||
- Extensions with pre-release versions available on `PECL` can be set up by suffixing the extension's name with its state i.e `alpha`, `beta`, `devel` or `snapshot`.
|
- Extensions with pre-release versions available on `PECL` can be set up by suffixing the extension's name with its state i.e `alpha`, `beta`, `devel` or `snapshot`.
|
||||||
|
|
||||||
This sets the minimum stability. The newest release with that stability or a more stable state is selected.
|
|
||||||
|
|
||||||
```yaml
|
```yaml
|
||||||
- name: Setup PHP with pre-release PECL extension
|
- name: Setup PHP with pre-release PECL extension
|
||||||
uses: shivammathur/setup-php@v2
|
uses: shivammathur/setup-php@v2
|
||||||
@@ -244,7 +239,7 @@ This disables all core and third-party shared extensions and thus, can break som
|
|||||||
|
|
||||||
These tools can be set up globally using the `tools` input. It accepts a string in csv-format.
|
These tools can be set up globally using the `tools` input. It accepts a string in csv-format.
|
||||||
|
|
||||||
[`backward-compatibility-check`], [`behat`], [`blackfire`], [`blackfire-player`], [`box`], [`castor`], [`churn`], [`codeception`], [`composer`], [`composer-dependency-analyser`], [`composer-normalize`], [`composer-prefetcher`], [`composer-require-checker`], [`composer-unused`], [`cpx`], [`cs2pr`], [`deployer`], [`ecs`], [`flex`], [`grpc_php_plugin`], [`infection`], [`laravel-cloud`] or [`cloud-cli`], [`mago`], [`name-collision-detector`], [`parallel-lint`], [`pecl`], [`phan`], [`phing`], [`phinx`], [`phive`], [`php-config`], [`php-cs-fixer`], [`php-scoper`], [`phpcbf`], [`phpcpd`], [`phpcs`], [`phpdoc`] or [`phpDocumentor`], [`phpize`], [`phplint`], [`phpmd`], [`phpspec`], [`phpstan`], [`phpunit`], [`phpunit-bridge`], [`phpunit-polyfills`], [`pie`], [`pint`], [`prestissimo`], [`protoc`], [`psalm`], [`rector`], [`symfony`] or [`symfony-cli`], [`upsun`] or [`upsun-cli`], [`vapor`] or [`vapor-cli`], [`wp`] or [`wp-cli`]
|
[`backward-compatibility-check`], [`behat`], [`blackfire`], [`blackfire-player`], [`box`], [`castor`], [`churn`], [`codeception`], [`composer`], [`composer-dependency-analyser`], [`composer-normalize`], [`composer-prefetcher`], [`composer-require-checker`], [`composer-unused`], [`cpx`], [`cs2pr`], [`deployer`], [`ecs`], [`flex`], [`grpc_php_plugin`], [`infection`], [`laravel-cloud`] or [`cloud-cli`], [`mago`], [`name-collision-detector`], [`parallel-lint`], [`pecl`], [`phan`], [`phing`], [`phinx`], [`phive`], [`php-config`], [`php-cs-fixer`], [`php-scoper`], [`phpcbf`], [`phpcpd`], [`phpcs`], [`phpdoc`] or [`phpDocumentor`], [`phpize`], [`phplint`], [`phpmd`], [`phpspec`], [`phpstan`], [`phpunit`], [`phpunit-bridge`], [`phpunit-polyfills`], [`pie`], [`pint`], [`prestissimo`], [`protoc`], [`psalm`], [`rector`], [`symfony`] or [`symfony-cli`], [`vapor`] or [`vapor-cli`], [`wp`] or [`wp-cli`]
|
||||||
|
|
||||||
```yaml
|
```yaml
|
||||||
- name: Setup PHP with tools
|
- name: Setup PHP with tools
|
||||||
@@ -436,7 +431,7 @@ Disable coverage for these reasons:
|
|||||||
- Accepts a `string`. For example `'8.5'`.
|
- Accepts a `string`. For example `'8.5'`.
|
||||||
- Accepts `lowest` to set up the lowest supported PHP version.
|
- Accepts `lowest` to set up the lowest supported PHP version.
|
||||||
- Accepts `highest` or `latest` to set up the latest stable PHP version.
|
- Accepts `highest` or `latest` to set up the latest stable PHP version.
|
||||||
- Accepts `nightly` to set up a nightly build of the next PHP release (`8.7`).
|
- Accepts `nightly` to set up a nightly build of the next PHP release (`8.6`).
|
||||||
- Accepts `master` to set up a nightly build from the master branch of PHP (`8.7`).
|
- Accepts `master` to set up a nightly build from the master branch of PHP (`8.7`).
|
||||||
- Accepts `pre-installed` to set up the highest pre-installed PHP version. You can combine this with `update: true` to update the pre-installed PHP version.
|
- Accepts `pre-installed` to set up the highest pre-installed PHP version. You can combine this with `update: true` to update the pre-installed PHP version.
|
||||||
- Accepts the format `d.x`, where `d` is the major version. For example `5.x`, `7.x` and `8.x`.
|
- Accepts the format `d.x`, where `d` is the major version. For example `5.x`, `7.x` and `8.x`.
|
||||||
@@ -532,13 +527,6 @@ On GitHub Actions you can assign the `setup-php` step an `id`, you can use the s
|
|||||||
- By default, it is set to `nts`.
|
- By default, it is set to `nts`.
|
||||||
- See [thread safe setup](#thread-safe-setup) for more info.
|
- See [thread safe setup](#thread-safe-setup) for more info.
|
||||||
|
|
||||||
#### `asan` (optional)
|
|
||||||
|
|
||||||
- Specify to set up PHP with AddressSanitizer (ASAN) for memory error detection.
|
|
||||||
- Accepts `true` or `false`.
|
|
||||||
- Only available for PHP 8.0 and above on Linux runners.
|
|
||||||
- See [ASAN build setup](#asan-build-setup) for more info.
|
|
||||||
|
|
||||||
#### `update` (optional)
|
#### `update` (optional)
|
||||||
|
|
||||||
- Specify to update PHP on the runner to the latest patch version.
|
- Specify to update PHP on the runner to the latest patch version.
|
||||||
@@ -601,10 +589,10 @@ jobs:
|
|||||||
|
|
||||||
### Nightly Build Setup
|
### Nightly Build Setup
|
||||||
|
|
||||||
> Set up a nightly build of `PHP 8.7`.
|
> Set up a nightly build of `PHP 8.6` or `PHP 8.7`.
|
||||||
|
|
||||||
- PHP 8.7 is in active development and might contain bugs and breaking changes.
|
- These PHP versions are currently in active development and might contain bugs and breaking changes.
|
||||||
- Some extensions might not support PHP 8.7 yet.
|
- Some user space extensions might not support these versions currently.
|
||||||
|
|
||||||
```yaml
|
```yaml
|
||||||
steps:
|
steps:
|
||||||
@@ -660,54 +648,6 @@ jobs:
|
|||||||
phpts: ts # specify ts or nts
|
phpts: ts # specify ts or nts
|
||||||
```
|
```
|
||||||
|
|
||||||
### ASAN Build Setup
|
|
||||||
|
|
||||||
> Set up PHP with AddressSanitizer (ASAN) for memory error detection.
|
|
||||||
|
|
||||||
- ASAN builds include both `AddressSanitizer` and `UndefinedBehaviorSanitizer (UBSan)`.
|
|
||||||
- Only available for PHP 8.0 and above on Linux based runners.
|
|
||||||
- Useful for detecting memory errors such as buffer overflows, use-after-free, and memory leaks.
|
|
||||||
|
|
||||||
```yaml
|
|
||||||
jobs:
|
|
||||||
run:
|
|
||||||
runs-on: ubuntu-latest
|
|
||||||
name: Setup PHP with ASAN
|
|
||||||
steps:
|
|
||||||
- name: Setup PHP
|
|
||||||
uses: shivammathur/setup-php@v2
|
|
||||||
with:
|
|
||||||
php-version: '8.5'
|
|
||||||
env:
|
|
||||||
asan: true
|
|
||||||
```
|
|
||||||
|
|
||||||
You can combine ASAN with other options:
|
|
||||||
|
|
||||||
```yaml
|
|
||||||
- name: Setup PHP with ASAN and thread safety
|
|
||||||
uses: shivammathur/setup-php@v2
|
|
||||||
with:
|
|
||||||
php-version: '8.5'
|
|
||||||
env:
|
|
||||||
asan: true
|
|
||||||
phpts: ts
|
|
||||||
```
|
|
||||||
|
|
||||||
With `asan: true`, subsequent steps in the same job inherit `ASAN_OPTIONS=detect_leaks=0`, `UBSAN_OPTIONS=halt_on_error=1`, `ZEND_DONT_UNLOAD_MODULES=1`, and `USE_ZEND_ALLOC=0` by default.
|
|
||||||
|
|
||||||
Set a variable in the setup step's `env` to override its default for the rest of the job. To enable leak checks for a single test step, set `ASAN_OPTIONS` on that step.
|
|
||||||
|
|
||||||
```yaml
|
|
||||||
- name: Run PHPUnit with leak detection
|
|
||||||
run: vendor/bin/phpunit
|
|
||||||
env:
|
|
||||||
ASAN_OPTIONS: detect_leaks=1
|
|
||||||
```
|
|
||||||
|
|
||||||
> [!NOTE]
|
|
||||||
> - ASAN builds have a performance overhead due to the instrumentation, so they are recommended for testing and debugging only.
|
|
||||||
|
|
||||||
### Force Update Setup
|
### Force Update Setup
|
||||||
|
|
||||||
> Update to the latest patch of PHP versions.
|
> Update to the latest patch of PHP versions.
|
||||||
@@ -748,7 +688,7 @@ Set a variable in the setup step's `env` to override its default for the rest of
|
|||||||
|
|
||||||
> Set up PHP on multiple architectures on Ubuntu GitHub Runners.
|
> Set up PHP on multiple architectures on Ubuntu GitHub Runners.
|
||||||
|
|
||||||
- `PHP 5.6` to `PHP 8.6` are supported by `setup-php` on multiple architectures on `Ubuntu` and `Debian`.
|
- `PHP 5.6` to `PHP 8.5` are supported by `setup-php` on multiple architecture on `Ubuntu` and `Debian`.
|
||||||
- For this, you can use `shivammathur/node` images as containers. These have compatible `Nodejs` and `PHP` installed for `setup-php`.
|
- For this, you can use `shivammathur/node` images as containers. These have compatible `Nodejs` and `PHP` installed for `setup-php`.
|
||||||
|
|
||||||
```yaml
|
```yaml
|
||||||
@@ -1104,23 +1044,34 @@ Examples of using `setup-php` with various PHP frameworks and packages.
|
|||||||
|
|
||||||
These companies generously provide setup-php their products and services to aid in the development of this project.
|
These companies generously provide setup-php their products and services to aid in the development of this project.
|
||||||
|
|
||||||
<p align="center">
|
<p>
|
||||||
<a target="_blank" href="https://www.jetbrains.com/?from=setup-php#gh-light-mode-only"><img src="https://setup-php.com/sponsors/jetbrains.svg" alt="JetBrains" width="140"></a>
|
<a target="_blank" href="https://www.jetbrains.com/?from=setup-php#gh-light-mode-only">
|
||||||
<a target="_blank" href="https://www.jetbrains.com/?from=setup-php#gh-dark-mode-only"><img src="https://setup-php.com/sponsors/jetbrains-white.svg" alt="JetBrains" width="140"></a>
|
<img src="https://setup-php.com/sponsors/jetbrains.svg" alt="JetBrains" width="140" height="100">
|
||||||
|
</a>
|
||||||
<a target="_blank" href="https://www.cloudflare.com/lp/project-alexandria/#gh-light-mode-only"><img src="https://setup-php.com/sponsors/cloudflare.svg" alt="Cloudflare" width="240"></a>
|
<a target="_blank" href="https://www.jetbrains.com/?from=setup-php#gh-dark-mode-only">
|
||||||
<a target="_blank" href="https://www.cloudflare.com/lp/project-alexandria/#gh-dark-mode-only"><img src="https://setup-php.com/sponsors/cloudflare-white.svg" alt="Cloudflare" width="240"></a>
|
<img src="https://setup-php.com/sponsors/jetbrains-white.svg" alt="JetBrains" width="140" height="100">
|
||||||
|
</a>
|
||||||
<a target="_blank" href="https://www.macstadium.com/company/opensource#gh-light-mode-only"><img src="https://setup-php.com/sponsors/macstadium.png" alt="Mac Stadium" width="200"></a>
|
|
||||||
<a target="_blank" href="https://www.macstadium.com/company/opensource#gh-dark-mode-only"><img src="https://setup-php.com/sponsors/macstadium-white.png" alt="Mac Stadium" width="200"></a>
|
<a target="_blank" href="https://www.cloudflare.com/lp/project-alexandria/#gh-light-mode-only">
|
||||||
</p>
|
<img src="https://setup-php.com/sponsors/cloudflare.svg" alt="Cloudflare" width="240" height="80">
|
||||||
|
</a>
|
||||||
<p align="center">
|
<a target="_blank" href="https://www.cloudflare.com/lp/project-alexandria/#gh-dark-mode-only">
|
||||||
<a target="_blank" href="https://namespace.so/github-actions/?utm_source=oss&utm_campaign=setup-php#gh-light-mode-only"><img src="https://setup-php.com/sponsors/namespace.svg?v=2" alt="Namespace" width="180" align="middle"></a>
|
<img src="https://setup-php.com/sponsors/cloudflare-white.svg" alt="Cloudflare" width="240" height="80">
|
||||||
<a target="_blank" href="https://namespace.so/github-actions/?utm_source=oss&utm_campaign=setup-php#gh-dark-mode-only"><img src="https://setup-php.com/sponsors/namespace-white.svg?v=2" alt="Namespace" width="180" align="middle"></a>
|
</a>
|
||||||
|
|
||||||
<a target="_blank" href="https://www.blacksmith.sh/#gh-light-mode-only"><img src="https://setup-php.com/sponsors/blacksmith.svg?v=2" alt="Blacksmith" width="180" align="middle"></a>
|
<a target="_blank" href="https://www.macstadium.com/company/opensource#gh-light-mode-only">
|
||||||
<a target="_blank" href="https://www.blacksmith.sh/#gh-dark-mode-only"><img src="https://setup-php.com/sponsors/blacksmith-white.svg?v=2" alt="Blacksmith" width="180" align="middle"></a>
|
<img src="https://setup-php.com/sponsors/macstadium.png" alt="Mac Stadium" width="200" height="80">
|
||||||
|
</a>
|
||||||
|
<a target="_blank" href="https://www.macstadium.com/company/opensource#gh-dark-mode-only">
|
||||||
|
<img src="https://setup-php.com/sponsors/macstadium-white.png" alt="Mac Stadium" width="200" height="80">
|
||||||
|
</a>
|
||||||
|
|
||||||
|
<a target="_blank" href="https://m.do.co/c/f1a8ee1277b0#gh-light-mode-only">
|
||||||
|
<img src="https://setup-php.com/sponsors/digitalocean.svg" alt="Digitalocean" width="100" height="100">
|
||||||
|
</a>
|
||||||
|
<a target="_blank" href="https://m.do.co/c/f1a8ee1277b0#gh-dark-mode-only">
|
||||||
|
<img src="https://setup-php.com/sponsors/digitalocean-white.svg" alt="Digitalocean" width="100" height="100">
|
||||||
|
</a>
|
||||||
</p>
|
</p>
|
||||||
|
|
||||||
Many users and organizations support setup-php via [GitHub Sponsors](https://github.com/sponsors/shivammathur).
|
Many users and organizations support setup-php via [GitHub Sponsors](https://github.com/sponsors/shivammathur).
|
||||||
@@ -1136,7 +1087,7 @@ Many users and organizations support setup-php via [GitHub Sponsors](https://git
|
|||||||
- [Node.js dependencies](https://github.com/shivammathur/setup-php/network/dependencies "Node.js dependencies")
|
- [Node.js dependencies](https://github.com/shivammathur/setup-php/network/dependencies "Node.js dependencies")
|
||||||
- [aaronparker/VcRedist](https://github.com/aaronparker/VcRedist "VcRedist PowerShell package")
|
- [aaronparker/VcRedist](https://github.com/aaronparker/VcRedist "VcRedist PowerShell package")
|
||||||
- [mlocati/powershell-phpmanager](https://github.com/mlocati/powershell-phpmanager "Package to handle PHP on windows")
|
- [mlocati/powershell-phpmanager](https://github.com/mlocati/powershell-phpmanager "Package to handle PHP on windows")
|
||||||
- [Sury PHP packages](https://packages.sury.org/php/) and the [setup-php mirror](https://ppa.setup-php.com/sury/)
|
- [ppa:ondrej/php](https://launchpad.net/~ondrej/+archive/ubuntu/php "Packaging active PHP packages")
|
||||||
- [shivammathur/cache-extensions](https://github.com/shivammathur/cache-extensions "GitHub action to help with caching PHP extensions")
|
- [shivammathur/cache-extensions](https://github.com/shivammathur/cache-extensions "GitHub action to help with caching PHP extensions")
|
||||||
- [shivammathur/composer-cache](https://github.com/shivammathur/composer-cache "Cache composer releases")
|
- [shivammathur/composer-cache](https://github.com/shivammathur/composer-cache "Cache composer releases")
|
||||||
- [shivammathur/homebrew-extensions](https://github.com/shivammathur/homebrew-extensions "Tap for PHP extensions on MacOS")
|
- [shivammathur/homebrew-extensions](https://github.com/shivammathur/homebrew-extensions "Tap for PHP extensions on MacOS")
|
||||||
@@ -1211,8 +1162,6 @@ Many users and organizations support setup-php via [GitHub Sponsors](https://git
|
|||||||
[`rector`]: https://getrector.org/
|
[`rector`]: https://getrector.org/
|
||||||
[`symfony`]: https://symfony.com/download
|
[`symfony`]: https://symfony.com/download
|
||||||
[`symfony-cli`]: https://symfony.com/download
|
[`symfony-cli`]: https://symfony.com/download
|
||||||
[`upsun`]: https://docs.upsun.com/administration/cli.html
|
|
||||||
[`upsun-cli`]: https://docs.upsun.com/administration/cli.html
|
|
||||||
[`vapor`]: https://docs.vapor.build/
|
[`vapor`]: https://docs.vapor.build/
|
||||||
[`vapor-cli`]: https://docs.vapor.build/
|
[`vapor-cli`]: https://docs.vapor.build/
|
||||||
[`wp`]: https://wp-cli.org/
|
[`wp`]: https://wp-cli.org/
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
import * as config from '../src/config.js';
|
import * as config from '../src/config';
|
||||||
|
|
||||||
describe('Config tests', () => {
|
describe('Config tests', () => {
|
||||||
it.each`
|
it.each`
|
||||||
|
|||||||
@@ -1,5 +1,4 @@
|
|||||||
import {jest} from '@jest/globals';
|
import * as core from '../src/core';
|
||||||
import * as core from '../src/core.js';
|
|
||||||
|
|
||||||
describe('Core tests', () => {
|
describe('Core tests', () => {
|
||||||
const originalEnv = process.env;
|
const originalEnv = process.env;
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
import * as coverage from '../src/coverage.js';
|
import * as coverage from '../src/coverage';
|
||||||
|
|
||||||
describe('Config tests', () => {
|
describe('Config tests', () => {
|
||||||
it.each`
|
it.each`
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
import * as fs from 'fs';
|
import * as fs from 'fs';
|
||||||
import * as extensions from '../src/extensions.js';
|
import * as extensions from '../src/extensions';
|
||||||
|
|
||||||
describe('Extension tests', () => {
|
describe('Extension tests', () => {
|
||||||
it.each`
|
it.each`
|
||||||
@@ -7,7 +7,6 @@ describe('Extension tests', () => {
|
|||||||
${'none'} | ${'7.4'} | ${'Disable-AllShared'}
|
${'none'} | ${'7.4'} | ${'Disable-AllShared'}
|
||||||
${':intl'} | ${'7.4'} | ${'Disable-Extension intl'}
|
${':intl'} | ${'7.4'} | ${'Disable-Extension intl'}
|
||||||
${'ast-beta'} | ${'7.4'} | ${'Add-Extension ast beta'}
|
${'ast-beta'} | ${'7.4'} | ${'Add-Extension ast beta'}
|
||||||
${'ast-stable'} | ${'7.4'} | ${'Add-Extension ast stable'}
|
|
||||||
${'blackfire'} | ${'7.3'} | ${'Add-Blackfire blackfire'}
|
${'blackfire'} | ${'7.3'} | ${'Add-Blackfire blackfire'}
|
||||||
${'blackfire-1.31.0'} | ${'7.3'} | ${'Add-Blackfire blackfire-1.31.0'}
|
${'blackfire-1.31.0'} | ${'7.3'} | ${'Add-Blackfire blackfire-1.31.0'}
|
||||||
${'grpc-1.2.3'} | ${'7.4'} | ${'Add-Extension grpc stable 1.2.3'}
|
${'grpc-1.2.3'} | ${'7.4'} | ${'Add-Extension grpc stable 1.2.3'}
|
||||||
@@ -72,7 +71,6 @@ describe('Extension tests', () => {
|
|||||||
${'phalcon3'} | ${'7.3'} | ${'add_phalcon phalcon3'}
|
${'phalcon3'} | ${'7.3'} | ${'add_phalcon phalcon3'}
|
||||||
${'relay'} | ${'7.4'} | ${'add_relay relay'}
|
${'relay'} | ${'7.4'} | ${'add_relay relay'}
|
||||||
${'relay-v1.2.3'} | ${'7.4'} | ${'add_relay relay-v1.2.3'}
|
${'relay-v1.2.3'} | ${'7.4'} | ${'add_relay relay-v1.2.3'}
|
||||||
${'relay-nightly'} | ${'8.6'} | ${'add_relay relay-nightly'}
|
|
||||||
${'sqlite'} | ${'7.4'} | ${'add_extension sqlite3'}
|
${'sqlite'} | ${'7.4'} | ${'add_extension sqlite3'}
|
||||||
${'sqlsrv-1.2.3-beta1'} | ${'7.4'} | ${'add_pecl_extension sqlsrv 1.2.3beta1 extension'}
|
${'sqlsrv-1.2.3-beta1'} | ${'7.4'} | ${'add_pecl_extension sqlsrv 1.2.3beta1 extension'}
|
||||||
${'Xdebug'} | ${'7.4'} | ${'add_extension xdebug'}
|
${'Xdebug'} | ${'7.4'} | ${'add_extension xdebug'}
|
||||||
@@ -108,7 +106,6 @@ describe('Extension tests', () => {
|
|||||||
${'pdo_oci'} | ${'7.3'} | ${'add_oci pdo_oci'}
|
${'pdo_oci'} | ${'7.3'} | ${'add_oci pdo_oci'}
|
||||||
${'pecl_http'} | ${'7.3'} | ${'add_http'}
|
${'pecl_http'} | ${'7.3'} | ${'add_http'}
|
||||||
${'relay-1.2.3'} | ${'7.4'} | ${'add_relay relay-1.2.3'}
|
${'relay-1.2.3'} | ${'7.4'} | ${'add_relay relay-1.2.3'}
|
||||||
${'relay-nightly'} | ${'8.6'} | ${'add_relay relay-nightly'}
|
|
||||||
${'sqlite'} | ${'7.2'} | ${'add_extension sqlite3'}
|
${'sqlite'} | ${'7.2'} | ${'add_extension sqlite3'}
|
||||||
${'xdebug2'} | ${'7.4'} | ${'add_brew_extension xdebug2 zend_extension 2.9.8'}
|
${'xdebug2'} | ${'7.4'} | ${'add_brew_extension xdebug2 zend_extension 2.9.8'}
|
||||||
${'zephir_parser-v1.2.3'} | ${'7.2'} | ${'add_zephir_parser zephir_parser-v1.2.3'}
|
${'zephir_parser-v1.2.3'} | ${'7.2'} | ${'add_zephir_parser zephir_parser-v1.2.3'}
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
import * as fetch from '../src/fetch.js';
|
import * as fetch from '../src/fetch';
|
||||||
import nock from 'nock';
|
import nock from 'nock';
|
||||||
|
|
||||||
beforeAll(() => nock.disableNetConnect());
|
beforeAll(() => nock.disableNetConnect());
|
||||||
@@ -21,10 +21,6 @@ it('checking fetch', async () => {
|
|||||||
|
|
||||||
nock(host_url)
|
nock(host_url)
|
||||||
.get('/manifest')
|
.get('/manifest')
|
||||||
.matchHeader(
|
|
||||||
'user-agent',
|
|
||||||
`setup-php (${process.platform}; ${process.arch}; +https://setup-php.com)`
|
|
||||||
)
|
|
||||||
.reply(200, {latest: 'latest'})
|
.reply(200, {latest: 'latest'})
|
||||||
.get('/manifest')
|
.get('/manifest')
|
||||||
.matchHeader('authorization', 'Bearer invalid_token')
|
.matchHeader('authorization', 'Bearer invalid_token')
|
||||||
|
|||||||
@@ -1,11 +1,12 @@
|
|||||||
import {jest} from '@jest/globals';
|
import * as install from '../src/install';
|
||||||
|
import * as utils from '../src/utils';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Mock install.ts
|
* Mock install.ts
|
||||||
*/
|
*/
|
||||||
jest.unstable_mockModule('../src/install.js', () => ({
|
jest.mock('../src/install', () => ({
|
||||||
getScript: jest
|
getScript: jest
|
||||||
.fn<typeof import('../src/install.js').getScript>()
|
.fn()
|
||||||
.mockImplementation(async (os: string): Promise<string> => {
|
.mockImplementation(async (os: string): Promise<string> => {
|
||||||
const filename = os + (await utils.scriptExtension(os));
|
const filename = os + (await utils.scriptExtension(os));
|
||||||
const version: string = await utils.parseVersion(
|
const version: string = await utils.parseVersion(
|
||||||
@@ -35,7 +36,7 @@ jest.unstable_mockModule('../src/install.js', () => ({
|
|||||||
/**
|
/**
|
||||||
* Mock fetch.ts
|
* Mock fetch.ts
|
||||||
*/
|
*/
|
||||||
jest.unstable_mockModule('../src/fetch.js', () => ({
|
jest.mock('../src/fetch', () => ({
|
||||||
fetch: jest.fn().mockImplementation(() => {
|
fetch: jest.fn().mockImplementation(() => {
|
||||||
return {
|
return {
|
||||||
data: '{ "latest": "8.3", "lowest": "8.1", "highest": "8.3", "nightly": "8.4", "5.x": "5.6" }'
|
data: '{ "latest": "8.3", "lowest": "8.1", "highest": "8.3", "nightly": "8.4", "5.x": "5.6" }'
|
||||||
@@ -43,9 +44,6 @@ jest.unstable_mockModule('../src/fetch.js', () => ({
|
|||||||
})
|
})
|
||||||
}));
|
}));
|
||||||
|
|
||||||
const utils = await import('../src/utils.js');
|
|
||||||
const install = await import('../src/install.js');
|
|
||||||
|
|
||||||
describe('Install', () => {
|
describe('Install', () => {
|
||||||
it.each`
|
it.each`
|
||||||
version | os | extension_csv | ini_file | ini_values_csv | coverage_driver | tools | output
|
version | os | extension_csv | ini_file | ini_values_csv | coverage_driver | tools | output
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
import * as packagist from '../src/packagist.js';
|
import * as packagist from '../src/packagist';
|
||||||
import nock from 'nock';
|
import nock from 'nock';
|
||||||
|
|
||||||
beforeAll(() => nock.disableNetConnect());
|
beforeAll(() => nock.disableNetConnect());
|
||||||
|
|||||||
+76
-101
@@ -1,6 +1,6 @@
|
|||||||
import {jest} from '@jest/globals';
|
import * as fs from 'fs';
|
||||||
import fs from 'fs';
|
import * as tools from '../src/tools';
|
||||||
import type {ToolData, ToolInput} from '../src/tools.js';
|
import {ToolData, ToolInput} from '../src/tools';
|
||||||
|
|
||||||
function getData(data: Partial<ToolData>): ToolData {
|
function getData(data: Partial<ToolData>): ToolData {
|
||||||
const tool = data.tool || 'tool';
|
const tool = data.tool || 'tool';
|
||||||
@@ -40,12 +40,16 @@ function unsetComposerAuthEnv(): void {
|
|||||||
/**
|
/**
|
||||||
* Mock fetch.ts
|
* Mock fetch.ts
|
||||||
*/
|
*/
|
||||||
jest.unstable_mockModule('../src/fetch.js', () => ({
|
jest.mock('../src/fetch', () => ({
|
||||||
fetch: jest
|
fetch: jest
|
||||||
.fn<typeof import('../src/fetch.js').fetch>()
|
.fn()
|
||||||
.mockImplementation(
|
.mockImplementation(
|
||||||
async (url: string, token?: string): Promise<Record<string, string>> => {
|
async (url: string, token?: string): Promise<Record<string, string>> => {
|
||||||
if (url.includes('atom') && !url.includes('no-')) {
|
if (url.includes('deployer')) {
|
||||||
|
return {
|
||||||
|
data: '[{"version": "1.2.3", "url": "https://deployer.org/releases/v1.2.3/deployer.phar"}]'
|
||||||
|
};
|
||||||
|
} else if (url.includes('atom') && !url.includes('no-')) {
|
||||||
return {
|
return {
|
||||||
data: '"releases/tag/1.2.3", "releases/tag/3.2.1", "releases/tag/2.3.1"'
|
data: '"releases/tag/1.2.3", "releases/tag/3.2.1", "releases/tag/2.3.1"'
|
||||||
};
|
};
|
||||||
@@ -82,9 +86,9 @@ jest.unstable_mockModule('../src/fetch.js', () => ({
|
|||||||
)
|
)
|
||||||
}));
|
}));
|
||||||
|
|
||||||
jest.unstable_mockModule('../src/packagist.js', () => ({
|
jest.mock('../src/packagist', () => ({
|
||||||
search: jest
|
search: jest
|
||||||
.fn<typeof import('../src/packagist.js').search>()
|
.fn()
|
||||||
.mockImplementation(
|
.mockImplementation(
|
||||||
async (
|
async (
|
||||||
package_name: string,
|
package_name: string,
|
||||||
@@ -98,10 +102,6 @@ jest.unstable_mockModule('../src/packagist.js', () => ({
|
|||||||
)
|
)
|
||||||
}));
|
}));
|
||||||
|
|
||||||
const tools = await import('../src/tools.js');
|
|
||||||
|
|
||||||
afterEach(() => jest.restoreAllMocks());
|
|
||||||
|
|
||||||
describe('Tools tests', () => {
|
describe('Tools tests', () => {
|
||||||
it.each`
|
it.each`
|
||||||
token | version
|
token | version
|
||||||
@@ -381,56 +381,6 @@ describe('Tools tests', () => {
|
|||||||
}
|
}
|
||||||
);
|
);
|
||||||
|
|
||||||
it.each`
|
|
||||||
release | resolved
|
|
||||||
${'phpstan'} | ${'latest/download'}
|
|
||||||
${'phpstan:0.12.68'} | ${'download/0.12.68'}
|
|
||||||
${'phpstan:^0.12.68'} | ${'download/0.12.68'}
|
|
||||||
${'phpstan:0.12'} | ${'download/1.2.3'}
|
|
||||||
${'phpstan:0.12.x'} | ${'download/1.2.3'}
|
|
||||||
${'phpstan:0.12.*'} | ${'download/1.2.3'}
|
|
||||||
`(
|
|
||||||
'resolving PHPStan PHAR fallback for $release',
|
|
||||||
async ({release, resolved}) => {
|
|
||||||
unsetComposerAuthEnv();
|
|
||||||
for (const os of ['linux', 'darwin', 'win32']) {
|
|
||||||
const data = await tools.getData(release, '8.0', os);
|
|
||||||
const script = await tools.addPackage(data);
|
|
||||||
expect(script).toContain(
|
|
||||||
'scoped https://github.com/phpstan/phpstan/releases/' +
|
|
||||||
resolved +
|
|
||||||
'/phpstan.phar "-V"'
|
|
||||||
);
|
|
||||||
expect(data.type).toBe('composer');
|
|
||||||
expect(data.release).toContain('phpstan');
|
|
||||||
}
|
|
||||||
}
|
|
||||||
);
|
|
||||||
|
|
||||||
it('keeps Composer available when the fallback version lookup fails', async () => {
|
|
||||||
process.env['GITHUB_TOKEN'] = 'invalid_token';
|
|
||||||
const data = await tools.getData('phpstan:0.12', '8.0', 'linux');
|
|
||||||
expect(await tools.addPackage(data)).toBe(
|
|
||||||
'add_composer_tool phpstan "phpstan:0.12.*" phpstan/ scoped'
|
|
||||||
);
|
|
||||||
unsetComposerAuthEnv();
|
|
||||||
});
|
|
||||||
|
|
||||||
it('uses fallback settings independently of the Composer repository', async () => {
|
|
||||||
const data = await tools.getData('vendor/tool:1.2.3', '8.0', 'linux', {
|
|
||||||
fallback: {
|
|
||||||
type: 'phar',
|
|
||||||
repository: 'releases/tool',
|
|
||||||
domain: 'https://example.com',
|
|
||||||
extension: '.phar',
|
|
||||||
version_prefix: 'v'
|
|
||||||
}
|
|
||||||
});
|
|
||||||
expect(await tools.addPackage(data)).toBe(
|
|
||||||
'add_composer_tool tool tool:1.2.3 vendor/ global https://example.com/releases/tool/v1.2.3/tool.phar ""'
|
|
||||||
);
|
|
||||||
});
|
|
||||||
|
|
||||||
it.each`
|
it.each`
|
||||||
version | php_version | os | script
|
version | php_version | os | script
|
||||||
${'latest'} | ${'8.0'} | ${'linux'} | ${'add_tool https://github.com/phar-io/phive/releases/download/3.2.1/phive-3.2.1.phar phive'}
|
${'latest'} | ${'8.0'} | ${'linux'} | ${'add_tool https://github.com/phar-io/phive/releases/download/3.2.1/phive-3.2.1.phar phive'}
|
||||||
@@ -481,15 +431,13 @@ describe('Tools tests', () => {
|
|||||||
|
|
||||||
it.each`
|
it.each`
|
||||||
version | url
|
version | url
|
||||||
${'latest'} | ${'https://github.com/deployphp/deployer/releases/latest/download/deployer.phar,https://deployer.org/deployer.phar deployer'}
|
${'latest'} | ${'https://deployer.org/deployer.phar'}
|
||||||
${'7.5.12'} | ${'https://github.com/deployphp/deployer/releases/download/v7.5.12/deployer.phar,https://deployer.org/releases/v7.5.12/deployer.phar deployer'}
|
${'1.2.3'} | ${'https://deployer.org/releases/v1.2.3/deployer.phar'}
|
||||||
${'6.8.0'} | ${'https://github.com/deployphp/deployer/releases/download/v6.8.0/deployer.phar,https://deployer.org/releases/v6.8.0/deployer.phar deployer'}
|
${'3.2.1'} | ${'Version missing in deployer manifest'}
|
||||||
`('checking addDeployer: $version', async ({version, url}) => {
|
`('checking addDeployer: $version', async ({version, url}) => {
|
||||||
const data = getData({
|
const data = getData({
|
||||||
tool: 'deployer',
|
tool: 'deployer',
|
||||||
domain: 'https://deployer.org',
|
domain: 'https://deployer.org',
|
||||||
repository: 'deployphp/deployer',
|
|
||||||
version_prefix: 'v',
|
|
||||||
version: version
|
version: version
|
||||||
});
|
});
|
||||||
expect(await tools.addDeployer(data)).toContain(url);
|
expect(await tools.addDeployer(data)).toContain(url);
|
||||||
@@ -579,11 +527,30 @@ describe('Tools tests', () => {
|
|||||||
});
|
});
|
||||||
|
|
||||||
it('checking affected composer version with CRLF ranges', async () => {
|
it('checking affected composer version with CRLF ranges', async () => {
|
||||||
jest
|
let affected = false;
|
||||||
.spyOn(fs, 'readFileSync')
|
let fixed = true;
|
||||||
.mockReturnValue('1.0.0-0 1.10.28\r\n2.0.0-0 2.2.28\r\n2.3.0-0 2.9.8');
|
await jest.isolateModulesAsync(async () => {
|
||||||
expect(tools.skipGitHubAuthForComposerVersion('2.9.7')).toBe(true);
|
jest.doMock('fs', () => ({
|
||||||
expect(tools.skipGitHubAuthForComposerVersion('2.9.8')).toBe(false);
|
...jest.requireActual('fs'),
|
||||||
|
readFileSync: (
|
||||||
|
filePath: fs.PathOrFileDescriptor,
|
||||||
|
options?: unknown
|
||||||
|
) => {
|
||||||
|
if (String(filePath).includes('composer-gh-auth-no-op')) {
|
||||||
|
return '1.0.0-0 1.10.28\r\n2.0.0-0 2.2.28\r\n2.3.0-0 2.9.8';
|
||||||
|
}
|
||||||
|
return (jest.requireActual('fs') as typeof fs).readFileSync(
|
||||||
|
filePath,
|
||||||
|
options as fs.ObjectEncodingOptions & {flag?: string}
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}));
|
||||||
|
const isolatedTools = jest.requireActual<typeof tools>('../src/tools');
|
||||||
|
affected = isolatedTools.skipGitHubAuthForComposerVersion('2.9.7');
|
||||||
|
fixed = isolatedTools.skipGitHubAuthForComposerVersion('2.9.8');
|
||||||
|
});
|
||||||
|
expect(affected).toBe(true);
|
||||||
|
expect(fixed).toBe(false);
|
||||||
});
|
});
|
||||||
|
|
||||||
it.each`
|
it.each`
|
||||||
@@ -669,7 +636,7 @@ describe('Tools tests', () => {
|
|||||||
|
|
||||||
it.each([
|
it.each([
|
||||||
[
|
[
|
||||||
'blackfire, blackfire-player, box, churn, cloud-cli, cpx, cs2pr, flex, grpc_php_plugin, mago, name-collision-detector, parallel-lint, php-cs-fixer, php-scoper, phpDocumentor, phplint, phpstan, phpunit, pecl, phing, phinx, phinx:1.2.3, phive, phpunit-bridge, phpunit-polyfills, pint, php-config, phpize, protoc, symfony, upsun, vapor, wp, pie',
|
'blackfire, blackfire-player, box, churn, cloud-cli, cpx, cs2pr, flex, grpc_php_plugin, mago, name-collision-detector, parallel-lint, php-cs-fixer, php-scoper, phpDocumentor, phplint, phpstan, phpunit, pecl, phing, phinx, phinx:1.2.3, phive, phpunit-bridge, phpunit-polyfills, pint, php-config, phpize, protoc, symfony, vapor, wp, pie',
|
||||||
[
|
[
|
||||||
'add_tool https://github.com/shivammathur/composer-cache/releases/latest/download/composer-7.4-stable.phar,https://artifacts.setup-php.com/composer/composer-7.4-stable.phar,https://dl.cloudsmith.io/public/shivammathur/composer-cache/raw/files/composer-7.4-stable.phar,https://getcomposer.org/composer-stable.phar composer',
|
'add_tool https://github.com/shivammathur/composer-cache/releases/latest/download/composer-7.4-stable.phar,https://artifacts.setup-php.com/composer/composer-7.4-stable.phar,https://dl.cloudsmith.io/public/shivammathur/composer-cache/raw/files/composer-7.4-stable.phar,https://getcomposer.org/composer-stable.phar composer',
|
||||||
'add_blackfire',
|
'add_blackfire',
|
||||||
@@ -688,7 +655,7 @@ describe('Tools tests', () => {
|
|||||||
'add_tool https://github.com/humbug/php-scoper/releases/latest/download/php-scoper.phar php-scoper "--version"',
|
'add_tool https://github.com/humbug/php-scoper/releases/latest/download/php-scoper.phar php-scoper "--version"',
|
||||||
'add_tool https://github.com/phpDocumentor/phpDocumentor/releases/latest/download/phpDocumentor.phar phpDocumentor "--version"',
|
'add_tool https://github.com/phpDocumentor/phpDocumentor/releases/latest/download/phpDocumentor.phar phpDocumentor "--version"',
|
||||||
'add_composer_tool phplint phplint overtrue/',
|
'add_composer_tool phplint phplint overtrue/',
|
||||||
'add_composer_tool phpstan phpstan phpstan/ scoped',
|
'add_tool https://github.com/phpstan/phpstan/releases/latest/download/phpstan.phar phpstan "-V"',
|
||||||
'add_tool https://phar.phpunit.de/phpunit-7.4.0.phar,https://phar.phpunit.de/phpunit-7.phar phpunit "--version"',
|
'add_tool https://phar.phpunit.de/phpunit-7.4.0.phar,https://phar.phpunit.de/phpunit-7.phar phpunit "--version"',
|
||||||
'add_pecl',
|
'add_pecl',
|
||||||
'add_tool https://www.phing.info/get/phing-latest.phar phing "-v"',
|
'add_tool https://www.phing.info/get/phing-latest.phar phing "-v"',
|
||||||
@@ -702,7 +669,6 @@ describe('Tools tests', () => {
|
|||||||
'add_devtools phpize',
|
'add_devtools phpize',
|
||||||
'add_protoc latest',
|
'add_protoc latest',
|
||||||
'add_symfony latest',
|
'add_symfony latest',
|
||||||
'add_upsun latest',
|
|
||||||
'add_composer_tool vapor-cli vapor-cli laravel/ scoped',
|
'add_composer_tool vapor-cli vapor-cli laravel/ scoped',
|
||||||
'add_tool https://github.com/wp-cli/builds/blob/gh-pages/phar/wp-cli.phar?raw=true wp-cli "--version"',
|
'add_tool https://github.com/wp-cli/builds/blob/gh-pages/phar/wp-cli.phar?raw=true wp-cli "--version"',
|
||||||
'add_tool https://github.com/php/pie/releases/latest/download/pie.phar pie "-V"'
|
'add_tool https://github.com/php/pie/releases/latest/download/pie.phar pie "-V"'
|
||||||
@@ -717,7 +683,7 @@ describe('Tools tests', () => {
|
|||||||
|
|
||||||
it.each([
|
it.each([
|
||||||
[
|
[
|
||||||
'backward-compatibility-check, behat, blackfire, blackfire-player, churn, composer-dependency-analyser, composer-normalize, composer-require-checker, composer-unused, cpx:2.0.0, cs2pr:1.2.3, ecs, flex, grpc_php_plugin:1.2.3, infection, laravel-cloud, mago:0.26.1, name-collision-detector, phan, phan:1.2.3, phing:1.2.3, phinx, phive:1.2.3, php-config, phpcbf, phpcpd, phpcs, phpdoc, phpize, phpmd, phpspec, phpunit-bridge:5.6, phpunit-polyfills:1.0.1, protoc:v1.2.3, psalm, rector, symfony-cli, upsun-cli:5.16.0, vapor-cli, wp-cli, pie',
|
'backward-compatibility-check, behat, blackfire, blackfire-player, churn, composer-dependency-analyser, composer-normalize, composer-require-checker, composer-unused, cpx:2.0.0, cs2pr:1.2.3, ecs, flex, grpc_php_plugin:1.2.3, infection, laravel-cloud, mago:0.26.1, name-collision-detector, phan, phan:1.2.3, phing:1.2.3, phinx, phive:1.2.3, php-config, phpcbf, phpcpd, phpcs, phpdoc, phpize, phpmd, phpspec, phpunit-bridge:5.6, phpunit-polyfills:1.0.1, protoc:v1.2.3, psalm, rector, symfony-cli, vapor-cli, wp-cli, pie',
|
||||||
[
|
[
|
||||||
'add_tool https://github.com/shivammathur/composer-cache/releases/latest/download/composer-7.4-stable.phar,https://artifacts.setup-php.com/composer/composer-7.4-stable.phar,https://dl.cloudsmith.io/public/shivammathur/composer-cache/raw/files/composer-7.4-stable.phar,https://getcomposer.org/composer-stable.phar composer',
|
'add_tool https://github.com/shivammathur/composer-cache/releases/latest/download/composer-7.4-stable.phar,https://artifacts.setup-php.com/composer/composer-7.4-stable.phar,https://dl.cloudsmith.io/public/shivammathur/composer-cache/raw/files/composer-7.4-stable.phar,https://getcomposer.org/composer-stable.phar composer',
|
||||||
'add_composer_tool behat behat behat/ scoped',
|
'add_composer_tool behat behat behat/ scoped',
|
||||||
@@ -756,7 +722,6 @@ describe('Tools tests', () => {
|
|||||||
'add_composer_tool rector rector rector/ scoped',
|
'add_composer_tool rector rector rector/ scoped',
|
||||||
'add_composer_tool backward-compatibility-check backward-compatibility-check roave/ scoped',
|
'add_composer_tool backward-compatibility-check backward-compatibility-check roave/ scoped',
|
||||||
'add_symfony latest',
|
'add_symfony latest',
|
||||||
'add_upsun 5.16.0',
|
|
||||||
'add_composer_tool vapor-cli vapor-cli laravel/ scoped',
|
'add_composer_tool vapor-cli vapor-cli laravel/ scoped',
|
||||||
'add_tool https://github.com/wp-cli/builds/blob/gh-pages/phar/wp-cli.phar?raw=true wp-cli "--version"',
|
'add_tool https://github.com/wp-cli/builds/blob/gh-pages/phar/wp-cli.phar?raw=true wp-cli "--version"',
|
||||||
'add_composer_tool easy-coding-standard easy-coding-standard symplify/ scoped',
|
'add_composer_tool easy-coding-standard easy-coding-standard symplify/ scoped',
|
||||||
@@ -772,14 +737,14 @@ describe('Tools tests', () => {
|
|||||||
|
|
||||||
it.each([
|
it.each([
|
||||||
[
|
[
|
||||||
'blackfire, blackfire-player:1.2.3, cs2pr, churn, deployer, does_not_exist, flex, mago, name-collision-detector, phinx, phive:0.13.2, php-config, phpize, phpmd, simple-phpunit, symfony, upsun-cli, wp, pie',
|
'blackfire, blackfire-player:1.2.3, cs2pr, churn, deployer, does_not_exist, flex, mago, name-collision-detector, phinx, phive:0.13.2, php-config, phpize, phpmd, simple-phpunit, symfony, wp, pie',
|
||||||
[
|
[
|
||||||
'Add-Tool https://github.com/shivammathur/composer-cache/releases/latest/download/composer-7.4-stable.phar,https://artifacts.setup-php.com/composer/composer-7.4-stable.phar,https://dl.cloudsmith.io/public/shivammathur/composer-cache/raw/files/composer-7.4-stable.phar,https://getcomposer.org/composer-stable.phar composer',
|
'Add-Tool https://github.com/shivammathur/composer-cache/releases/latest/download/composer-7.4-stable.phar,https://artifacts.setup-php.com/composer/composer-7.4-stable.phar,https://dl.cloudsmith.io/public/shivammathur/composer-cache/raw/files/composer-7.4-stable.phar,https://getcomposer.org/composer-stable.phar composer',
|
||||||
'Add-Blackfire',
|
'Add-Blackfire',
|
||||||
'blackfire-player is not a windows tool',
|
'blackfire-player is not a windows tool',
|
||||||
'Add-Tool https://github.com/staabm/annotate-pull-request-from-checkstyle/releases/latest/download/cs2pr cs2pr "-V"',
|
'Add-Tool https://github.com/staabm/annotate-pull-request-from-checkstyle/releases/latest/download/cs2pr cs2pr "-V"',
|
||||||
'Add-Tool https://github.com/bmitch/churn-php/releases/latest/download/churn.phar churn "-V"',
|
'Add-Tool https://github.com/bmitch/churn-php/releases/latest/download/churn.phar churn "-V"',
|
||||||
'Add-Tool https://github.com/deployphp/deployer/releases/latest/download/deployer.phar,https://deployer.org/deployer.phar deployer "-V"',
|
'Add-Tool https://deployer.org/deployer.phar deployer "-V"',
|
||||||
'Tool does_not_exist is not supported',
|
'Tool does_not_exist is not supported',
|
||||||
'Add-ComposerTool flex flex symfony/ global',
|
'Add-ComposerTool flex flex symfony/ global',
|
||||||
'Add-Mago',
|
'Add-Mago',
|
||||||
@@ -791,7 +756,6 @@ describe('Tools tests', () => {
|
|||||||
'Add-Tool https://github.com/phpmd/phpmd/releases/latest/download/phpmd.phar phpmd "--version"',
|
'Add-Tool https://github.com/phpmd/phpmd/releases/latest/download/phpmd.phar phpmd "--version"',
|
||||||
'Add-ComposerTool phpunit-bridge phpunit-bridge symfony/ global',
|
'Add-ComposerTool phpunit-bridge phpunit-bridge symfony/ global',
|
||||||
'Add-Symfony',
|
'Add-Symfony',
|
||||||
'Add-Upsun latest',
|
|
||||||
'Add-Tool https://github.com/wp-cli/builds/blob/gh-pages/phar/wp-cli.phar?raw=true wp-cli "--version"',
|
'Add-Tool https://github.com/wp-cli/builds/blob/gh-pages/phar/wp-cli.phar?raw=true wp-cli "--version"',
|
||||||
'Add-Tool https://github.com/php/pie/releases/latest/download/pie.phar pie "-V"'
|
'Add-Tool https://github.com/php/pie/releases/latest/download/pie.phar pie "-V"'
|
||||||
]
|
]
|
||||||
@@ -866,20 +830,19 @@ describe('Tools tests', () => {
|
|||||||
});
|
});
|
||||||
|
|
||||||
it.each`
|
it.each`
|
||||||
tools_csv | os | script
|
tools_csv | os | script
|
||||||
${'phpunit:9.5.0@sha256:' + 'a'.repeat(64)} | ${'linux'} | ${'add_tool https://phar.phpunit.de/phpunit-9.5.0.phar,https://phar.phpunit.de/phpunit-9.phar phpunit "--version" sha256:' + 'a'.repeat(64)}
|
${'phpunit:9.5.0@sha256:' + 'a'.repeat(64)} | ${'linux'} | ${'add_tool https://phar.phpunit.de/phpunit-9.5.0.phar,https://phar.phpunit.de/phpunit-9.phar phpunit "--version" sha256:' + 'a'.repeat(64)}
|
||||||
${'phpunit:9.5.0@sha256:' + 'a'.repeat(64)} | ${'win32'} | ${'Add-Tool https://phar.phpunit.de/phpunit-9.5.0.phar,https://phar.phpunit.de/phpunit-9.phar phpunit "--version" sha256:' + 'a'.repeat(64)}
|
${'phpunit:9.5.0@sha256:' + 'a'.repeat(64)} | ${'win32'} | ${'Add-Tool https://phar.phpunit.de/phpunit-9.5.0.phar,https://phar.phpunit.de/phpunit-9.phar phpunit "--version" sha256:' + 'a'.repeat(64)}
|
||||||
${'composer:2.9.8@sha256:' + 'b'.repeat(64)} | ${'linux'} | ${'composer 2.9.8 sha256:' + 'b'.repeat(64)}
|
${'composer:2.9.8@sha256:' + 'b'.repeat(64)} | ${'linux'} | ${'composer 2.9.8 sha256:' + 'b'.repeat(64)}
|
||||||
${'cs2pr:1.2.3@sha256:' + 'd'.repeat(64)} | ${'linux'} | ${'add_tool https://github.com/staabm/annotate-pull-request-from-checkstyle/releases/download/1.2.3/cs2pr cs2pr "-V" sha256:' + 'd'.repeat(64)}
|
${'cs2pr:1.2.3@sha256:' + 'd'.repeat(64)} | ${'linux'} | ${'add_tool https://github.com/staabm/annotate-pull-request-from-checkstyle/releases/download/1.2.3/cs2pr cs2pr "-V" sha256:' + 'd'.repeat(64)}
|
||||||
${'deployer:7.5.12@sha256:' + 'e'.repeat(64)} | ${'linux'} | ${'add_tool https://github.com/deployphp/deployer/releases/download/v7.5.12/deployer.phar,https://deployer.org/releases/v7.5.12/deployer.phar deployer "-V" sha256:' + 'e'.repeat(64)}
|
${'phive:0.15.3@sha512:' + 'c'.repeat(128)} | ${'darwin'} | ${'add_tool https://github.com/phar-io/phive/releases/download/0.15.3/phive-0.15.3.phar phive "status" sha512:' + 'c'.repeat(128)}
|
||||||
${'phive:0.15.3@sha512:' + 'c'.repeat(128)} | ${'darwin'} | ${'add_tool https://github.com/phar-io/phive/releases/download/0.15.3/phive-0.15.3.phar phive "status" sha512:' + 'c'.repeat(128)}
|
${'phinx:1.2.3@sha256:' + 'a'.repeat(64)} | ${'linux'} | ${'add_log "$cross" "phinx" "Checksum verification is not supported for phinx"'}
|
||||||
${'phinx:1.2.3@sha256:' + 'a'.repeat(64)} | ${'linux'} | ${'add_log "$cross" "phinx" "Checksum verification is not supported for phinx"'}
|
${'pecl:1.2.3@sha256:' + 'a'.repeat(64)} | ${'linux'} | ${'add_log "$cross" "pecl" "Checksum verification is not supported for pecl"'}
|
||||||
${'pecl:1.2.3@sha256:' + 'a'.repeat(64)} | ${'linux'} | ${'add_log "$cross" "pecl" "Checksum verification is not supported for pecl"'}
|
${'phpunit:9.5.0@sha256:invalid'} | ${'linux'} | ${'add_log "$cross" "phpunit" "Invalid sha256 checksum, expected 64 hexadecimal characters"'}
|
||||||
${'phpunit:9.5.0@sha256:invalid'} | ${'linux'} | ${'add_log "$cross" "phpunit" "Invalid sha256 checksum, expected 64 hexadecimal characters"'}
|
${'composer:2.9.8@SHA256:' + 'b'.repeat(64)} | ${'linux'} | ${'composer 2.9.8 sha256:' + 'b'.repeat(64)}
|
||||||
${'composer:2.9.8@SHA256:' + 'b'.repeat(64)} | ${'linux'} | ${'composer 2.9.8 sha256:' + 'b'.repeat(64)}
|
${'composer:2.9.8@sha384:' + 'b'.repeat(96)} | ${'linux'} | ${'add_log "$cross" "composer" "Unsupported checksum algorithm sha384, expected sha256 or sha512"'}
|
||||||
${'composer:2.9.8@sha384:' + 'b'.repeat(96)} | ${'linux'} | ${'add_log "$cross" "composer" "Unsupported checksum algorithm sha384, expected sha256 or sha512"'}
|
${'composer:2.9.8@md5:' + 'b'.repeat(32)} | ${'linux'} | ${'add_log "$cross" "composer" "Unsupported checksum algorithm md5, expected sha256 or sha512"'}
|
||||||
${'composer:2.9.8@md5:' + 'b'.repeat(32)} | ${'linux'} | ${'add_log "$cross" "composer" "Unsupported checksum algorithm md5, expected sha256 or sha512"'}
|
${'composer:2.9.8@sha256' + 'b'.repeat(64)} | ${'linux'} | ${'add_log "$cross" "composer" "Invalid checksum syntax, expected @sha256:<hash> or @sha512:<hash>"'}
|
||||||
${'composer:2.9.8@sha256' + 'b'.repeat(64)} | ${'linux'} | ${'add_log "$cross" "composer" "Invalid checksum syntax, expected @sha256:<hash> or @sha512:<hash>"'}
|
|
||||||
`(
|
`(
|
||||||
'checking addTools with checksum: $tools_csv, $os',
|
'checking addTools with checksum: $tools_csv, $os',
|
||||||
async ({tools_csv, os, script}) => {
|
async ({tools_csv, os, script}) => {
|
||||||
@@ -985,14 +948,26 @@ describe('Tools tests', () => {
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
const readFileSync = fs.readFileSync;
|
let result: string = '';
|
||||||
jest.spyOn(fs, 'readFileSync').mockImplementation((filePath, options) => {
|
await jest.isolateModulesAsync(async () => {
|
||||||
if (String(filePath).includes('tools.json')) {
|
jest.doMock('fs', () => ({
|
||||||
return brokenToolsJson;
|
...jest.requireActual('fs'),
|
||||||
}
|
readFileSync: (
|
||||||
return readFileSync(filePath, options);
|
filePath: fs.PathOrFileDescriptor,
|
||||||
|
options?: unknown
|
||||||
|
) => {
|
||||||
|
if (String(filePath).includes('tools.json')) {
|
||||||
|
return brokenToolsJson;
|
||||||
|
}
|
||||||
|
return (jest.requireActual('fs') as typeof fs).readFileSync(
|
||||||
|
filePath,
|
||||||
|
options as fs.ObjectEncodingOptions & {flag?: string}
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}));
|
||||||
|
const isolatedTools = jest.requireActual<typeof tools>('../src/tools');
|
||||||
|
result = await isolatedTools.addTools('broken-tool', '7.4', 'linux');
|
||||||
});
|
});
|
||||||
const result = await tools.addTools('broken-tool', '7.4', 'linux');
|
|
||||||
|
|
||||||
expect(result).toContain(
|
expect(result).toContain(
|
||||||
'add_log "$cross" "broken-tool" "broken-tool has no function defined. Please report this issue."'
|
'add_log "$cross" "broken-tool" "broken-tool has no function defined. Please report this issue."'
|
||||||
|
|||||||
+10
-20
@@ -1,13 +1,8 @@
|
|||||||
import {fileURLToPath} from 'url';
|
|
||||||
import {jest} from '@jest/globals';
|
|
||||||
import fs from 'fs';
|
import fs from 'fs';
|
||||||
import os from 'os';
|
import os from 'os';
|
||||||
import * as path from 'path';
|
import * as path from 'path';
|
||||||
const fetchMock = jest.fn<typeof import('../src/fetch.js').fetch>();
|
import * as utils from '../src/utils';
|
||||||
jest.unstable_mockModule('../src/fetch.js', () => ({fetch: fetchMock}));
|
import * as fetchModule from '../src/fetch';
|
||||||
const utils = await import('../src/utils.js');
|
|
||||||
|
|
||||||
const dirname = path.dirname(fileURLToPath(import.meta.url));
|
|
||||||
|
|
||||||
describe('Utils tests', () => {
|
describe('Utils tests', () => {
|
||||||
it('checking readEnv', async () => {
|
it('checking readEnv', async () => {
|
||||||
@@ -45,24 +40,19 @@ describe('Utils tests', () => {
|
|||||||
});
|
});
|
||||||
|
|
||||||
it('checking parseVersion', async () => {
|
it('checking parseVersion', async () => {
|
||||||
const fetchSpy = fetchMock.mockResolvedValue({
|
const fetchSpy = jest.spyOn(fetchModule, 'fetch').mockResolvedValue({
|
||||||
data: fs.readFileSync(
|
data: fs.readFileSync(
|
||||||
path.join(dirname, '../src/configs/php-versions.json'),
|
path.join(__dirname, '../src/configs/php-versions.json'),
|
||||||
'utf8'
|
'utf8'
|
||||||
)
|
)
|
||||||
});
|
});
|
||||||
expect(await utils.parseVersion('latest')).toBe('8.6');
|
expect(await utils.parseVersion('latest')).toBe('8.5');
|
||||||
expect(await utils.parseVersion('highest')).toBe('8.6');
|
expect(await utils.parseVersion('nightly')).toBe('8.6');
|
||||||
expect(await utils.parseVersion('8.x')).toBe('8.6');
|
|
||||||
expect(await utils.parseVersion('nightly')).toBe('8.7');
|
|
||||||
expect(await utils.parseVersion('master')).toBe('8.7');
|
expect(await utils.parseVersion('master')).toBe('8.7');
|
||||||
expect(await utils.parseVersion('8.7')).toBe('8.7');
|
expect(await utils.parseVersion('8.7')).toBe('8.7');
|
||||||
expect(await utils.parseVersion('8.7.0')).toBe('8.7');
|
expect(await utils.parseVersion('8.7.0')).toBe('8.7');
|
||||||
expect(await utils.parseVersion('7')).toBe('7.0');
|
expect(await utils.parseVersion('7')).toBe('7.0');
|
||||||
expect(await utils.parseVersion('7.4')).toBe('7.4');
|
expect(await utils.parseVersion('7.4')).toBe('7.4');
|
||||||
expect(await utils.parseVersion('8.10')).toBe('8.10');
|
|
||||||
expect(await utils.parseVersion('10')).toBe('10.0');
|
|
||||||
expect(await utils.parseVersion('10.0')).toBe('10.0');
|
|
||||||
expect(await utils.parseVersion('5.x')).toBe('5.6');
|
expect(await utils.parseVersion('5.x')).toBe('5.6');
|
||||||
expect(await utils.parseVersion('pre')).toBe('pre');
|
expect(await utils.parseVersion('pre')).toBe('pre');
|
||||||
expect(await utils.parseVersion('pre-installed')).toBe('pre');
|
expect(await utils.parseVersion('pre-installed')).toBe('pre');
|
||||||
@@ -334,8 +324,8 @@ describe('Utils tests', () => {
|
|||||||
"Could not find '.phpenv-version' file."
|
"Could not find '.phpenv-version' file."
|
||||||
);
|
);
|
||||||
|
|
||||||
const existsSync = jest.spyOn(fs, 'existsSync').mockReturnValue(false);
|
const existsSync = jest.spyOn(fs, 'existsSync').mockImplementation();
|
||||||
const readFileSync = jest.spyOn(fs, 'readFileSync').mockReturnValue('');
|
const readFileSync = jest.spyOn(fs, 'readFileSync').mockImplementation();
|
||||||
|
|
||||||
existsSync.mockReturnValue(true);
|
existsSync.mockReturnValue(true);
|
||||||
readFileSync.mockReturnValue('8.1');
|
readFileSync.mockReturnValue('8.1');
|
||||||
@@ -401,8 +391,8 @@ describe('Utils tests', () => {
|
|||||||
});
|
});
|
||||||
|
|
||||||
it('readPHPVersion rejects unsupported values from each source', async () => {
|
it('readPHPVersion rejects unsupported values from each source', async () => {
|
||||||
const existsSync = jest.spyOn(fs, 'existsSync').mockReturnValue(false);
|
const existsSync = jest.spyOn(fs, 'existsSync').mockImplementation();
|
||||||
const readFileSync = jest.spyOn(fs, 'readFileSync').mockReturnValue('');
|
const readFileSync = jest.spyOn(fs, 'readFileSync').mockImplementation();
|
||||||
|
|
||||||
process.env['php-version'] = '$0';
|
process.env['php-version'] = '$0';
|
||||||
await expect(utils.readPHPVersion()).rejects.toThrow('php-version input');
|
await expect(utils.readPHPVersion()).rejects.toThrow('php-version input');
|
||||||
|
|||||||
Vendored
+1157
File diff suppressed because it is too large
Load Diff
Vendored
+1
-1
File diff suppressed because one or more lines are too long
Vendored
-3
@@ -1,3 +0,0 @@
|
|||||||
{
|
|
||||||
"type": "module"
|
|
||||||
}
|
|
||||||
+1
-6
@@ -1,5 +1,5 @@
|
|||||||
import {createRequire} from 'node:module';
|
|
||||||
import typescriptEslint from '@typescript-eslint/eslint-plugin';
|
import typescriptEslint from '@typescript-eslint/eslint-plugin';
|
||||||
|
import {importX} from 'eslint-plugin-import-x';
|
||||||
import jest from 'eslint-plugin-jest';
|
import jest from 'eslint-plugin-jest';
|
||||||
import prettierRecommended from 'eslint-plugin-prettier/recommended';
|
import prettierRecommended from 'eslint-plugin-prettier/recommended';
|
||||||
import eslintConfigPrettier from 'eslint-config-prettier';
|
import eslintConfigPrettier from 'eslint-config-prettier';
|
||||||
@@ -7,11 +7,6 @@ import globals from 'globals';
|
|||||||
import tsParser from '@typescript-eslint/parser';
|
import tsParser from '@typescript-eslint/parser';
|
||||||
import js from '@eslint/js';
|
import js from '@eslint/js';
|
||||||
|
|
||||||
// Until import-x supports minimatch 11, use its CommonJS entry point to avoid
|
|
||||||
// the removed makeRe import in no-internal-modules, unused by these presets.
|
|
||||||
// https://github.com/un-ts/eslint-plugin-import-x/pull/570
|
|
||||||
const {importX} = createRequire(import.meta.url)('eslint-plugin-import-x');
|
|
||||||
|
|
||||||
export default [
|
export default [
|
||||||
js.configs.recommended,
|
js.configs.recommended,
|
||||||
...typescriptEslint.configs['flat/recommended'],
|
...typescriptEslint.configs['flat/recommended'],
|
||||||
|
|||||||
+2
-6
@@ -1,15 +1,11 @@
|
|||||||
export default {
|
module.exports = {
|
||||||
clearMocks: true,
|
clearMocks: true,
|
||||||
moduleFileExtensions: ['js', 'ts'],
|
moduleFileExtensions: ['js', 'ts'],
|
||||||
extensionsToTreatAsEsm: ['.ts'],
|
|
||||||
moduleNameMapper: {
|
|
||||||
'^(\\.{1,2}/.*)\\.js$': '$1'
|
|
||||||
},
|
|
||||||
testEnvironment: 'node',
|
testEnvironment: 'node',
|
||||||
testMatch: ['**/*.test.ts'],
|
testMatch: ['**/*.test.ts'],
|
||||||
testRunner: 'jest-circus/runner',
|
testRunner: 'jest-circus/runner',
|
||||||
transform: {
|
transform: {
|
||||||
'^.+\\.ts$': ['ts-jest', {tsconfig: 'tsconfig.test.json', useESM: true}]
|
'^.+\\.ts$': ['ts-jest', {tsconfig: 'tsconfig.test.json'}]
|
||||||
},
|
},
|
||||||
verbose: true,
|
verbose: true,
|
||||||
collectCoverage: true
|
collectCoverage: true
|
||||||
|
|||||||
Generated
+172
-306
@@ -1,12 +1,12 @@
|
|||||||
{
|
{
|
||||||
"name": "setup-php",
|
"name": "setup-php",
|
||||||
"version": "2.40.1",
|
"version": "2.40.0",
|
||||||
"lockfileVersion": 3,
|
"lockfileVersion": 3,
|
||||||
"requires": true,
|
"requires": true,
|
||||||
"packages": {
|
"packages": {
|
||||||
"": {
|
"": {
|
||||||
"name": "setup-php",
|
"name": "setup-php",
|
||||||
"version": "2.40.1",
|
"version": "2.40.0",
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@actions/exec": "^3.0.0",
|
"@actions/exec": "^3.0.0",
|
||||||
@@ -16,24 +16,24 @@
|
|||||||
"@eslint/compat": "^2.1.1",
|
"@eslint/compat": "^2.1.1",
|
||||||
"@eslint/js": "^10.0.1",
|
"@eslint/js": "^10.0.1",
|
||||||
"@types/jest": "^30.0.0",
|
"@types/jest": "^30.0.0",
|
||||||
"@types/node": "^26.6.6",
|
"@types/node": "^26.6.4",
|
||||||
"@typescript-eslint/eslint-plugin": "^8.73.0",
|
"@typescript-eslint/eslint-plugin": "^8.71.1",
|
||||||
"@typescript-eslint/parser": "^8.73.0",
|
"@typescript-eslint/parser": "^8.71.1",
|
||||||
"@typescript/native": "npm:typescript@^7.0.2",
|
"@typescript/native": "npm:typescript@^7.0.2",
|
||||||
"@vercel/ncc": "^0.45.0",
|
"@vercel/ncc": "^0.45.0",
|
||||||
"eslint": "^10.15.0",
|
"eslint": "^10.12.0",
|
||||||
"eslint-config-prettier": "^10.1.8",
|
"eslint-config-prettier": "^10.1.8",
|
||||||
"eslint-import-resolver-typescript": "^4.4.5",
|
"eslint-import-resolver-typescript": "^4.4.5",
|
||||||
"eslint-plugin-import-x": "^4.18.1",
|
"eslint-plugin-import-x": "^4.17.1",
|
||||||
"eslint-plugin-jest": "^29.17.1",
|
"eslint-plugin-jest": "^29.16.6",
|
||||||
"eslint-plugin-prettier": "^5.5.7",
|
"eslint-plugin-prettier": "^5.5.6",
|
||||||
"globals": "^17.14.0",
|
"globals": "^17.13.0",
|
||||||
"jest": "^30.5.2",
|
"jest": "^30.5.2",
|
||||||
"jest-circus": "^30.5.2",
|
"jest-circus": "^30.5.2",
|
||||||
"nock": "^15.0.6",
|
"nock": "^15.0.1",
|
||||||
"prettier": "^3.10.1",
|
"prettier": "^3.9.9",
|
||||||
"simple-git-hooks": "^2.14.0",
|
"simple-git-hooks": "^2.14.0",
|
||||||
"ts-jest": "^29.4.15",
|
"ts-jest": "^29.4.14",
|
||||||
"typescript": "npm:@typescript/typescript6@^6.0.2"
|
"typescript": "npm:@typescript/typescript6@^6.0.2"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
@@ -592,17 +592,6 @@
|
|||||||
"keyv": "^5.6.0"
|
"keyv": "^5.6.0"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/@dual-bundle/import-meta-resolve": {
|
|
||||||
"version": "4.2.1",
|
|
||||||
"resolved": "https://registry.npmjs.org/@dual-bundle/import-meta-resolve/-/import-meta-resolve-4.2.1.tgz",
|
|
||||||
"integrity": "sha512-id+7YRUgoUX6CgV0DtuhirQWodeeA7Lf4i2x71JS/vtA5pRb/hIGWlw+G6MeXvsM+MXrz0VAydTGElX1rAfgPg==",
|
|
||||||
"dev": true,
|
|
||||||
"license": "MIT",
|
|
||||||
"funding": {
|
|
||||||
"type": "github",
|
|
||||||
"url": "https://github.com/sponsors/JounQin"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"node_modules/@emnapi/core": {
|
"node_modules/@emnapi/core": {
|
||||||
"version": "1.10.0",
|
"version": "1.10.0",
|
||||||
"resolved": "https://registry.npmjs.org/@emnapi/core/-/core-1.10.0.tgz",
|
"resolved": "https://registry.npmjs.org/@emnapi/core/-/core-1.10.0.tgz",
|
||||||
@@ -688,15 +677,15 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/@eslint/config-array": {
|
"node_modules/@eslint/config-array": {
|
||||||
"version": "0.23.7",
|
"version": "0.23.5",
|
||||||
"resolved": "https://registry.npmjs.org/@eslint/config-array/-/config-array-0.23.7.tgz",
|
"resolved": "https://registry.npmjs.org/@eslint/config-array/-/config-array-0.23.5.tgz",
|
||||||
"integrity": "sha512-Ix1tmZjA7/OmE7ROAfORe83hVnqlDzLpZVHFjHQt5mvLm1U03qMexpaxKqFIL362QV32SoPaZqmKQr3tdqFY2w==",
|
"integrity": "sha512-Y3kKLvC1dvTOT+oGlqNQ1XLqK6D1HU2YXPc52NmAlJZbMMWDzGYXMiPRJ8TYD39muD/OTjlZmNJ4ib7dvSrMBA==",
|
||||||
"dev": true,
|
"dev": true,
|
||||||
"license": "Apache-2.0",
|
"license": "Apache-2.0",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@eslint/object-schema": "^3.0.5",
|
"@eslint/object-schema": "^3.0.5",
|
||||||
"debug": "^4.3.1",
|
"debug": "^4.3.1",
|
||||||
"minimatch": "^11.0.5"
|
"minimatch": "^10.2.4"
|
||||||
},
|
},
|
||||||
"engines": {
|
"engines": {
|
||||||
"node": "^20.19.0 || ^22.13.0 || >=24"
|
"node": "^20.19.0 || ^22.13.0 || >=24"
|
||||||
@@ -839,13 +828,6 @@
|
|||||||
"url": "https://github.com/sponsors/nzakas"
|
"url": "https://github.com/sponsors/nzakas"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/@isaacs/nonrecursive-glob-match": {
|
|
||||||
"version": "1.1.0",
|
|
||||||
"resolved": "https://registry.npmjs.org/@isaacs/nonrecursive-glob-match/-/nonrecursive-glob-match-1.1.0.tgz",
|
|
||||||
"integrity": "sha512-GPm/Dbvk5RLmhRnxXIa7nTpK0xtl4E0wj0MslsuNiJ1FIROU+2+9lgUC/dgF7Ey4QCWhfEsgxilMRMCdHPfDfw==",
|
|
||||||
"dev": true,
|
|
||||||
"license": "BlueOak-1.0.0"
|
|
||||||
},
|
|
||||||
"node_modules/@istanbuljs/load-nyc-config": {
|
"node_modules/@istanbuljs/load-nyc-config": {
|
||||||
"version": "1.1.0",
|
"version": "1.1.0",
|
||||||
"resolved": "https://registry.npmjs.org/@istanbuljs/load-nyc-config/-/load-nyc-config-1.1.0.tgz",
|
"resolved": "https://registry.npmjs.org/@istanbuljs/load-nyc-config/-/load-nyc-config-1.1.0.tgz",
|
||||||
@@ -863,16 +845,6 @@
|
|||||||
"node": ">=8"
|
"node": ">=8"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/@istanbuljs/load-nyc-config/node_modules/argparse": {
|
|
||||||
"version": "1.0.10",
|
|
||||||
"resolved": "https://registry.npmjs.org/argparse/-/argparse-1.0.10.tgz",
|
|
||||||
"integrity": "sha512-o5Roy6tNG4SL/FOkCAN6RzjiakZS25RLYFrcMttJqbdd8BWrnA+fGz57iN5Pb06pvBGvl5gQ0B48dJlslXvoTg==",
|
|
||||||
"dev": true,
|
|
||||||
"license": "MIT",
|
|
||||||
"dependencies": {
|
|
||||||
"sprintf-js": "~1.0.2"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"node_modules/@istanbuljs/load-nyc-config/node_modules/find-up": {
|
"node_modules/@istanbuljs/load-nyc-config/node_modules/find-up": {
|
||||||
"version": "4.1.0",
|
"version": "4.1.0",
|
||||||
"resolved": "https://registry.npmjs.org/find-up/-/find-up-4.1.0.tgz",
|
"resolved": "https://registry.npmjs.org/find-up/-/find-up-4.1.0.tgz",
|
||||||
@@ -887,20 +859,6 @@
|
|||||||
"node": ">=8"
|
"node": ">=8"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/@istanbuljs/load-nyc-config/node_modules/js-yaml": {
|
|
||||||
"version": "3.15.2",
|
|
||||||
"resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-3.15.2.tgz",
|
|
||||||
"integrity": "sha512-6EuL879VkRA+1Cz578mKMiKvjPNEuk6+r1JaFzoSWejZmtf7xWbIyw1e3KkxlkzTIt9Taw6JBhEppG7utc1P+w==",
|
|
||||||
"dev": true,
|
|
||||||
"license": "MIT",
|
|
||||||
"dependencies": {
|
|
||||||
"argparse": "^1.0.7",
|
|
||||||
"esprima": "^4.0.0"
|
|
||||||
},
|
|
||||||
"bin": {
|
|
||||||
"js-yaml": "bin/js-yaml.js"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"node_modules/@istanbuljs/load-nyc-config/node_modules/locate-path": {
|
"node_modules/@istanbuljs/load-nyc-config/node_modules/locate-path": {
|
||||||
"version": "5.0.0",
|
"version": "5.0.0",
|
||||||
"resolved": "https://registry.npmjs.org/locate-path/-/locate-path-5.0.0.tgz",
|
"resolved": "https://registry.npmjs.org/locate-path/-/locate-path-5.0.0.tgz",
|
||||||
@@ -1386,9 +1344,9 @@
|
|||||||
"license": "MIT"
|
"license": "MIT"
|
||||||
},
|
},
|
||||||
"node_modules/@mswjs/interceptors": {
|
"node_modules/@mswjs/interceptors": {
|
||||||
"version": "0.45.14",
|
"version": "0.44.0",
|
||||||
"resolved": "https://registry.npmjs.org/@mswjs/interceptors/-/interceptors-0.45.14.tgz",
|
"resolved": "https://registry.npmjs.org/@mswjs/interceptors/-/interceptors-0.44.0.tgz",
|
||||||
"integrity": "sha512-2y8lEnhEKzgxSoALB7ibIPpUJ68YqWmvGjYO2D6Z4dAmMAr7kG9Poh6HiW1poT+okHGSr6LgsbqO8rDDH7MsSg==",
|
"integrity": "sha512-IYHevRStF4ijM20GI9c9Ndhw483NSAjCydQhUr4/zIB0BNLsTVw3vFAxTo6TlvX4QnV60wEHttUa9539TTAq+A==",
|
||||||
"dev": true,
|
"dev": true,
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
@@ -1397,7 +1355,7 @@
|
|||||||
"debug": "^4.4.3",
|
"debug": "^4.4.3",
|
||||||
"is-node-process": "^1.2.0",
|
"is-node-process": "^1.2.0",
|
||||||
"outvariant": "^1.4.3",
|
"outvariant": "^1.4.3",
|
||||||
"rettime": "^0.11.12"
|
"rettime": "^0.11.11"
|
||||||
},
|
},
|
||||||
"engines": {
|
"engines": {
|
||||||
"node": ">=22"
|
"node": ">=22"
|
||||||
@@ -1913,9 +1871,9 @@
|
|||||||
"license": "MIT"
|
"license": "MIT"
|
||||||
},
|
},
|
||||||
"node_modules/@types/node": {
|
"node_modules/@types/node": {
|
||||||
"version": "26.6.6",
|
"version": "26.6.4",
|
||||||
"resolved": "https://registry.npmjs.org/@types/node/-/node-26.6.6.tgz",
|
"resolved": "https://registry.npmjs.org/@types/node/-/node-26.6.4.tgz",
|
||||||
"integrity": "sha512-MzQj+8Kx3XI40OmUAE6Qoh58ZMNstNNMwn2nfd3qWsfe7nDNSqJNzes4njhz6AHwrSHOffSLwXU6yb474Q4aog==",
|
"integrity": "sha512-ldVPDCzj7fsaGZrLB0NuHuTvJcsNasysBAqMolr/cgxrLd1xbqxIr3XJiPnHHJUCxj5sNF1vnRj9aWnrVh5Jcg==",
|
||||||
"dev": true,
|
"dev": true,
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
@@ -1947,17 +1905,17 @@
|
|||||||
"license": "MIT"
|
"license": "MIT"
|
||||||
},
|
},
|
||||||
"node_modules/@typescript-eslint/eslint-plugin": {
|
"node_modules/@typescript-eslint/eslint-plugin": {
|
||||||
"version": "8.74.0",
|
"version": "8.71.1",
|
||||||
"resolved": "https://registry.npmjs.org/@typescript-eslint/eslint-plugin/-/eslint-plugin-8.74.0.tgz",
|
"resolved": "https://registry.npmjs.org/@typescript-eslint/eslint-plugin/-/eslint-plugin-8.71.1.tgz",
|
||||||
"integrity": "sha512-z3KXk1+Vm+d82ZRplOoC89ho4Rf1da5ju6sx8//92GnN532U62DGPjECXkkVqtYzIv0zoJlpO39SX2Z9tk6LVw==",
|
"integrity": "sha512-nNlBf6HuotqMgZvSkWD5hNdemiBIxQ2NmrlgfcUIeZRs+BbakjscCQRq/Hb74EFVnFiSWWdL12JruqwBy3ERDw==",
|
||||||
"dev": true,
|
"dev": true,
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@eslint-community/regexpp": "^4.12.2",
|
"@eslint-community/regexpp": "^4.12.2",
|
||||||
"@typescript-eslint/scope-manager": "8.74.0",
|
"@typescript-eslint/scope-manager": "8.71.1",
|
||||||
"@typescript-eslint/type-utils": "8.74.0",
|
"@typescript-eslint/type-utils": "8.71.1",
|
||||||
"@typescript-eslint/utils": "8.74.0",
|
"@typescript-eslint/utils": "8.71.1",
|
||||||
"@typescript-eslint/visitor-keys": "8.74.0",
|
"@typescript-eslint/visitor-keys": "8.71.1",
|
||||||
"ignore": "^7.0.5",
|
"ignore": "^7.0.5",
|
||||||
"natural-compare": "^1.4.0",
|
"natural-compare": "^1.4.0",
|
||||||
"ts-api-utils": "^2.5.0"
|
"ts-api-utils": "^2.5.0"
|
||||||
@@ -1970,22 +1928,22 @@
|
|||||||
"url": "https://opencollective.com/typescript-eslint"
|
"url": "https://opencollective.com/typescript-eslint"
|
||||||
},
|
},
|
||||||
"peerDependencies": {
|
"peerDependencies": {
|
||||||
"@typescript-eslint/parser": "^8.74.0",
|
"@typescript-eslint/parser": "^8.71.1",
|
||||||
"eslint": "^8.57.0 || ^9.0.0 || ^10.0.0",
|
"eslint": "^8.57.0 || ^9.0.0 || ^10.0.0",
|
||||||
"typescript": ">=4.8.4 <6.1.0"
|
"typescript": ">=4.8.4 <6.1.0"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/@typescript-eslint/parser": {
|
"node_modules/@typescript-eslint/parser": {
|
||||||
"version": "8.74.0",
|
"version": "8.71.1",
|
||||||
"resolved": "https://registry.npmjs.org/@typescript-eslint/parser/-/parser-8.74.0.tgz",
|
"resolved": "https://registry.npmjs.org/@typescript-eslint/parser/-/parser-8.71.1.tgz",
|
||||||
"integrity": "sha512-ecr8AYdig7avVkxaHdQvxHnIJ/mOyliO4Gv/uWF8q69vBew/z3sexqBwHUZX5Vql+Ns0w4sH6gBLkICGbOvJkA==",
|
"integrity": "sha512-oM/5sAqz/l1v/zYK1qTOPrn2+JIrBGC1V6uNYucRO5gh6eT9vWJ/RhPbGE59byvZEUQ4VP6XkLBaS5Jti5jpvw==",
|
||||||
"dev": true,
|
"dev": true,
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@typescript-eslint/scope-manager": "8.74.0",
|
"@typescript-eslint/scope-manager": "8.71.1",
|
||||||
"@typescript-eslint/types": "8.74.0",
|
"@typescript-eslint/types": "8.71.1",
|
||||||
"@typescript-eslint/typescript-estree": "8.74.0",
|
"@typescript-eslint/typescript-estree": "8.71.1",
|
||||||
"@typescript-eslint/visitor-keys": "8.74.0",
|
"@typescript-eslint/visitor-keys": "8.71.1",
|
||||||
"debug": "^4.4.3"
|
"debug": "^4.4.3"
|
||||||
},
|
},
|
||||||
"engines": {
|
"engines": {
|
||||||
@@ -2000,49 +1958,15 @@
|
|||||||
"typescript": ">=4.8.4 <6.1.0"
|
"typescript": ">=4.8.4 <6.1.0"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/@typescript-eslint/parser/node_modules/@typescript-eslint/typescript-estree": {
|
|
||||||
"version": "8.74.0",
|
|
||||||
"resolved": "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-8.74.0.tgz",
|
|
||||||
"integrity": "sha512-wL348k6l92DNG+kPP5rVpKwNBoz7a3xRZy3TPKc1uymQttd7u7gcMv3eENmcuh4CjC4mO3FTM0DYstFXMyDLuw==",
|
|
||||||
"dev": true,
|
|
||||||
"license": "MIT",
|
|
||||||
"dependencies": {
|
|
||||||
"@typescript-eslint/project-service": "8.74.0",
|
|
||||||
"@typescript-eslint/tsconfig-utils": "8.74.0",
|
|
||||||
"@typescript-eslint/types": "8.74.0",
|
|
||||||
"@typescript-eslint/visitor-keys": "8.74.0",
|
|
||||||
"debug": "^4.4.3",
|
|
||||||
"minimatch": "^11.0.1",
|
|
||||||
"semver": "^7.7.3",
|
|
||||||
"tinyglobby": "^0.2.15",
|
|
||||||
"ts-api-utils": "^2.5.0"
|
|
||||||
},
|
|
||||||
"engines": {
|
|
||||||
"node": "^18.18.0 || ^20.9.0 || >=21.1.0"
|
|
||||||
},
|
|
||||||
"funding": {
|
|
||||||
"type": "opencollective",
|
|
||||||
"url": "https://opencollective.com/typescript-eslint"
|
|
||||||
},
|
|
||||||
"peerDependencies": {
|
|
||||||
"@typescript/native": "npm:typescript@>=7.1.0-dev.20261009.1 || >=7.1.0-beta <7.1.0-dev",
|
|
||||||
"typescript": ">=4.8.4 <6.1.0"
|
|
||||||
},
|
|
||||||
"peerDependenciesMeta": {
|
|
||||||
"@typescript/native": {
|
|
||||||
"optional": true
|
|
||||||
}
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"node_modules/@typescript-eslint/project-service": {
|
"node_modules/@typescript-eslint/project-service": {
|
||||||
"version": "8.74.0",
|
"version": "8.71.1",
|
||||||
"resolved": "https://registry.npmjs.org/@typescript-eslint/project-service/-/project-service-8.74.0.tgz",
|
"resolved": "https://registry.npmjs.org/@typescript-eslint/project-service/-/project-service-8.71.1.tgz",
|
||||||
"integrity": "sha512-z/mymuE+JlEeSFIv3Mo70EvgG1Zz74Hl0IDfExfXutARAP834bt+MppTD7mVAwmZO0GdxdOAi0jbTam749eH6g==",
|
"integrity": "sha512-Oijc9RUsohHjncg6iGi7gCtjnEjYt9FWv9u6ygK8uKcHK5eLjLAkqERQ9BaytbpceOFdk6kifPCS/zAZE+A99g==",
|
||||||
"dev": true,
|
"dev": true,
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@typescript-eslint/tsconfig-utils": "^8.74.0",
|
"@typescript-eslint/tsconfig-utils": "^8.71.1",
|
||||||
"@typescript-eslint/types": "^8.74.0",
|
"@typescript-eslint/types": "^8.71.1",
|
||||||
"debug": "^4.4.3"
|
"debug": "^4.4.3"
|
||||||
},
|
},
|
||||||
"engines": {
|
"engines": {
|
||||||
@@ -2057,14 +1981,14 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/@typescript-eslint/scope-manager": {
|
"node_modules/@typescript-eslint/scope-manager": {
|
||||||
"version": "8.74.0",
|
"version": "8.71.1",
|
||||||
"resolved": "https://registry.npmjs.org/@typescript-eslint/scope-manager/-/scope-manager-8.74.0.tgz",
|
"resolved": "https://registry.npmjs.org/@typescript-eslint/scope-manager/-/scope-manager-8.71.1.tgz",
|
||||||
"integrity": "sha512-kpOdpu4CpWN5U38ox3f727DwWRBtUAVhyUJtqTBYe5gf2wYoxac7PgKP14txrxN7ICVtcjlLdzjqfRgpSnDKvQ==",
|
"integrity": "sha512-1YUDZXdTnXLlob03SFHBipdyMBsDVm7zoSz0ytTJ39dk5J1TgsTK03VlR/dLXG/RLLUrPcYbD4rp23BmHxHP0w==",
|
||||||
"dev": true,
|
"dev": true,
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@typescript-eslint/types": "8.74.0",
|
"@typescript-eslint/types": "8.71.1",
|
||||||
"@typescript-eslint/visitor-keys": "8.74.0"
|
"@typescript-eslint/visitor-keys": "8.71.1"
|
||||||
},
|
},
|
||||||
"engines": {
|
"engines": {
|
||||||
"node": "^18.18.0 || ^20.9.0 || >=21.1.0"
|
"node": "^18.18.0 || ^20.9.0 || >=21.1.0"
|
||||||
@@ -2075,9 +1999,9 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/@typescript-eslint/tsconfig-utils": {
|
"node_modules/@typescript-eslint/tsconfig-utils": {
|
||||||
"version": "8.74.0",
|
"version": "8.71.1",
|
||||||
"resolved": "https://registry.npmjs.org/@typescript-eslint/tsconfig-utils/-/tsconfig-utils-8.74.0.tgz",
|
"resolved": "https://registry.npmjs.org/@typescript-eslint/tsconfig-utils/-/tsconfig-utils-8.71.1.tgz",
|
||||||
"integrity": "sha512-p07wAuaS6BjCYgOSXKJi4YhvTnAf7fiG37e9THcpnYaQEt2QiTTYZWKwUFNgeRiywiMudazhzgddAirZ0GgHtQ==",
|
"integrity": "sha512-oTvkml5SxXhgg+WWKhod5qWQICDXtOB+/Hi9VdPKFAANJ2b7YOgMffgvzXuqog7R6A/JtrzRf128dsxummyWhg==",
|
||||||
"dev": true,
|
"dev": true,
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
"engines": {
|
"engines": {
|
||||||
@@ -2092,15 +2016,15 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/@typescript-eslint/type-utils": {
|
"node_modules/@typescript-eslint/type-utils": {
|
||||||
"version": "8.74.0",
|
"version": "8.71.1",
|
||||||
"resolved": "https://registry.npmjs.org/@typescript-eslint/type-utils/-/type-utils-8.74.0.tgz",
|
"resolved": "https://registry.npmjs.org/@typescript-eslint/type-utils/-/type-utils-8.71.1.tgz",
|
||||||
"integrity": "sha512-CV3Y3la8l3F9ANfxcfpgSSiQgJTe4IeLEoZV4O/gcW86Ugp8X6SKiQ0vm+QegXaRIbbDMokZZSF3A1CgiU/kPw==",
|
"integrity": "sha512-kH3t3jZCYv2PZSBEWPKTariLrCaoF1CLoPitYFBJOhAGEwWnSRAtGEifrfrpBa4K9JlwWNZotgA5w3/wLSk/FQ==",
|
||||||
"dev": true,
|
"dev": true,
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@typescript-eslint/types": "8.74.0",
|
"@typescript-eslint/types": "8.71.1",
|
||||||
"@typescript-eslint/typescript-estree": "8.74.0",
|
"@typescript-eslint/typescript-estree": "8.71.1",
|
||||||
"@typescript-eslint/utils": "8.74.0",
|
"@typescript-eslint/utils": "8.71.1",
|
||||||
"debug": "^4.4.3",
|
"debug": "^4.4.3",
|
||||||
"ts-api-utils": "^2.5.0"
|
"ts-api-utils": "^2.5.0"
|
||||||
},
|
},
|
||||||
@@ -2116,19 +2040,33 @@
|
|||||||
"typescript": ">=4.8.4 <6.1.0"
|
"typescript": ">=4.8.4 <6.1.0"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/@typescript-eslint/type-utils/node_modules/@typescript-eslint/typescript-estree": {
|
"node_modules/@typescript-eslint/types": {
|
||||||
"version": "8.74.0",
|
"version": "8.71.1",
|
||||||
"resolved": "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-8.74.0.tgz",
|
"resolved": "https://registry.npmjs.org/@typescript-eslint/types/-/types-8.71.1.tgz",
|
||||||
"integrity": "sha512-wL348k6l92DNG+kPP5rVpKwNBoz7a3xRZy3TPKc1uymQttd7u7gcMv3eENmcuh4CjC4mO3FTM0DYstFXMyDLuw==",
|
"integrity": "sha512-ybYnPTUwg3VQQOFEiBPLs8Jxl1ry2vXdn1kVKguomBbvxpetdu3MKTNDqFNUrlG8ylP9MpZosmXMFYlGQHk1oQ==",
|
||||||
|
"dev": true,
|
||||||
|
"license": "MIT",
|
||||||
|
"engines": {
|
||||||
|
"node": "^18.18.0 || ^20.9.0 || >=21.1.0"
|
||||||
|
},
|
||||||
|
"funding": {
|
||||||
|
"type": "opencollective",
|
||||||
|
"url": "https://opencollective.com/typescript-eslint"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"node_modules/@typescript-eslint/typescript-estree": {
|
||||||
|
"version": "8.71.1",
|
||||||
|
"resolved": "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-8.71.1.tgz",
|
||||||
|
"integrity": "sha512-pSKSEK1JJpHs6KiKVtABCE4iJK5d7FLFzDXQNBQ2oRY7LEd3UwOt3TZemTgu9syTIf56dJWlTn/pdmrO9oKUXQ==",
|
||||||
"dev": true,
|
"dev": true,
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@typescript-eslint/project-service": "8.74.0",
|
"@typescript-eslint/project-service": "8.71.1",
|
||||||
"@typescript-eslint/tsconfig-utils": "8.74.0",
|
"@typescript-eslint/tsconfig-utils": "8.71.1",
|
||||||
"@typescript-eslint/types": "8.74.0",
|
"@typescript-eslint/types": "8.71.1",
|
||||||
"@typescript-eslint/visitor-keys": "8.74.0",
|
"@typescript-eslint/visitor-keys": "8.71.1",
|
||||||
"debug": "^4.4.3",
|
"debug": "^4.4.3",
|
||||||
"minimatch": "^11.0.1",
|
"minimatch": "^10.2.2",
|
||||||
"semver": "^7.7.3",
|
"semver": "^7.7.3",
|
||||||
"tinyglobby": "^0.2.15",
|
"tinyglobby": "^0.2.15",
|
||||||
"ts-api-utils": "^2.5.0"
|
"ts-api-utils": "^2.5.0"
|
||||||
@@ -2141,40 +2079,20 @@
|
|||||||
"url": "https://opencollective.com/typescript-eslint"
|
"url": "https://opencollective.com/typescript-eslint"
|
||||||
},
|
},
|
||||||
"peerDependencies": {
|
"peerDependencies": {
|
||||||
"@typescript/native": "npm:typescript@>=7.1.0-dev.20261009.1 || >=7.1.0-beta <7.1.0-dev",
|
|
||||||
"typescript": ">=4.8.4 <6.1.0"
|
"typescript": ">=4.8.4 <6.1.0"
|
||||||
},
|
|
||||||
"peerDependenciesMeta": {
|
|
||||||
"@typescript/native": {
|
|
||||||
"optional": true
|
|
||||||
}
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"node_modules/@typescript-eslint/types": {
|
|
||||||
"version": "8.74.0",
|
|
||||||
"resolved": "https://registry.npmjs.org/@typescript-eslint/types/-/types-8.74.0.tgz",
|
|
||||||
"integrity": "sha512-MpnMrJCVNpP1iVL8NiHkQZgQqIMBH5ewDGUPBh1pqQXwFtMFjsl1M03QcYPXmv6stCKEiF0PN7CGbU1ZbXFzEA==",
|
|
||||||
"dev": true,
|
|
||||||
"license": "MIT",
|
|
||||||
"engines": {
|
|
||||||
"node": "^18.18.0 || ^20.9.0 || >=21.1.0"
|
|
||||||
},
|
|
||||||
"funding": {
|
|
||||||
"type": "opencollective",
|
|
||||||
"url": "https://opencollective.com/typescript-eslint"
|
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/@typescript-eslint/utils": {
|
"node_modules/@typescript-eslint/utils": {
|
||||||
"version": "8.74.0",
|
"version": "8.71.1",
|
||||||
"resolved": "https://registry.npmjs.org/@typescript-eslint/utils/-/utils-8.74.0.tgz",
|
"resolved": "https://registry.npmjs.org/@typescript-eslint/utils/-/utils-8.71.1.tgz",
|
||||||
"integrity": "sha512-IpWXPxXXomzxyTcvjhZJexgdvtTR1TooLAPpuxzaGqQ8BHll1lf4Ysp/BTE/l0U5TJ+x1j7B4bEM8pLRrvY+XA==",
|
"integrity": "sha512-CBjT6gfAz3DW2j9Q4moFnqt208Aq+506sVGXfpRcyAeqn0EpayL0mjdWoCO2t3RC7GewNrFxdeehuEaPg6DMzQ==",
|
||||||
"dev": true,
|
"dev": true,
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@eslint-community/eslint-utils": "^4.9.1",
|
"@eslint-community/eslint-utils": "^4.9.1",
|
||||||
"@typescript-eslint/scope-manager": "8.74.0",
|
"@typescript-eslint/scope-manager": "8.71.1",
|
||||||
"@typescript-eslint/types": "8.74.0",
|
"@typescript-eslint/types": "8.71.1",
|
||||||
"@typescript-eslint/typescript-estree": "8.74.0"
|
"@typescript-eslint/typescript-estree": "8.71.1"
|
||||||
},
|
},
|
||||||
"engines": {
|
"engines": {
|
||||||
"node": "^18.18.0 || ^20.9.0 || >=21.1.0"
|
"node": "^18.18.0 || ^20.9.0 || >=21.1.0"
|
||||||
@@ -2188,48 +2106,14 @@
|
|||||||
"typescript": ">=4.8.4 <6.1.0"
|
"typescript": ">=4.8.4 <6.1.0"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/@typescript-eslint/utils/node_modules/@typescript-eslint/typescript-estree": {
|
|
||||||
"version": "8.74.0",
|
|
||||||
"resolved": "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-8.74.0.tgz",
|
|
||||||
"integrity": "sha512-wL348k6l92DNG+kPP5rVpKwNBoz7a3xRZy3TPKc1uymQttd7u7gcMv3eENmcuh4CjC4mO3FTM0DYstFXMyDLuw==",
|
|
||||||
"dev": true,
|
|
||||||
"license": "MIT",
|
|
||||||
"dependencies": {
|
|
||||||
"@typescript-eslint/project-service": "8.74.0",
|
|
||||||
"@typescript-eslint/tsconfig-utils": "8.74.0",
|
|
||||||
"@typescript-eslint/types": "8.74.0",
|
|
||||||
"@typescript-eslint/visitor-keys": "8.74.0",
|
|
||||||
"debug": "^4.4.3",
|
|
||||||
"minimatch": "^11.0.1",
|
|
||||||
"semver": "^7.7.3",
|
|
||||||
"tinyglobby": "^0.2.15",
|
|
||||||
"ts-api-utils": "^2.5.0"
|
|
||||||
},
|
|
||||||
"engines": {
|
|
||||||
"node": "^18.18.0 || ^20.9.0 || >=21.1.0"
|
|
||||||
},
|
|
||||||
"funding": {
|
|
||||||
"type": "opencollective",
|
|
||||||
"url": "https://opencollective.com/typescript-eslint"
|
|
||||||
},
|
|
||||||
"peerDependencies": {
|
|
||||||
"@typescript/native": "npm:typescript@>=7.1.0-dev.20261009.1 || >=7.1.0-beta <7.1.0-dev",
|
|
||||||
"typescript": ">=4.8.4 <6.1.0"
|
|
||||||
},
|
|
||||||
"peerDependenciesMeta": {
|
|
||||||
"@typescript/native": {
|
|
||||||
"optional": true
|
|
||||||
}
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"node_modules/@typescript-eslint/visitor-keys": {
|
"node_modules/@typescript-eslint/visitor-keys": {
|
||||||
"version": "8.74.0",
|
"version": "8.71.1",
|
||||||
"resolved": "https://registry.npmjs.org/@typescript-eslint/visitor-keys/-/visitor-keys-8.74.0.tgz",
|
"resolved": "https://registry.npmjs.org/@typescript-eslint/visitor-keys/-/visitor-keys-8.71.1.tgz",
|
||||||
"integrity": "sha512-XSZmOtMUbWCBIM+2BK134FyMFxmll1mW2mPLk/PSwYQYzGIPMgJAqL929U4qXVizLv7Xq5b7r41/o7Ombuwk0g==",
|
"integrity": "sha512-0GxiUGqMU0qXJt58cBsiG3DP8lUmBaFo2vChtUX+CT7PnR3v/VGLLrzVP4K9r1lNiZXjHYefMBbPunplr09v6w==",
|
||||||
"dev": true,
|
"dev": true,
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@typescript-eslint/types": "8.74.0",
|
"@typescript-eslint/types": "8.71.1",
|
||||||
"eslint-visitor-keys": "^5.0.0"
|
"eslint-visitor-keys": "^5.0.0"
|
||||||
},
|
},
|
||||||
"engines": {
|
"engines": {
|
||||||
@@ -3113,6 +2997,13 @@
|
|||||||
"url": "https://github.com/sponsors/jonschlinkert"
|
"url": "https://github.com/sponsors/jonschlinkert"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"node_modules/argparse": {
|
||||||
|
"version": "2.0.1",
|
||||||
|
"resolved": "https://registry.npmjs.org/argparse/-/argparse-2.0.1.tgz",
|
||||||
|
"integrity": "sha512-8+9WqebbFzpX9OR+Wa6O29asIogeRMzcGtAINdpMHHyAg10f05aSFVBbcEqGf/PXw1EjAZ+q2/bEBg3DvurK3Q==",
|
||||||
|
"dev": true,
|
||||||
|
"license": "Python-2.0"
|
||||||
|
},
|
||||||
"node_modules/babel-jest": {
|
"node_modules/babel-jest": {
|
||||||
"version": "30.5.2",
|
"version": "30.5.2",
|
||||||
"resolved": "https://registry.npmjs.org/babel-jest/-/babel-jest-30.5.2.tgz",
|
"resolved": "https://registry.npmjs.org/babel-jest/-/babel-jest-30.5.2.tgz",
|
||||||
@@ -3487,9 +3378,9 @@
|
|||||||
"license": "MIT"
|
"license": "MIT"
|
||||||
},
|
},
|
||||||
"node_modules/cross-spawn": {
|
"node_modules/cross-spawn": {
|
||||||
"version": "7.1.2",
|
"version": "7.0.6",
|
||||||
"resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-7.1.2.tgz",
|
"resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-7.0.6.tgz",
|
||||||
"integrity": "sha512-8BPK2r+sKWC8sDinRwLwrFMq2lXTBBwzYYEB9LiCznfMurOi4FOvQflq3XOLGG+HPdMSVpe+k/s96+AtDEOgPg==",
|
"integrity": "sha512-uV2QOWP2nWzsy2aMp8aRibhi9dlzF5Hgh5SHaB9OiTGEyDTiJJyx0uy51QXdyWbtAHNua4XJzUKca3OzKUd3vA==",
|
||||||
"dev": true,
|
"dev": true,
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
@@ -3639,9 +3530,9 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/eslint": {
|
"node_modules/eslint": {
|
||||||
"version": "10.16.0",
|
"version": "10.12.0",
|
||||||
"resolved": "https://registry.npmjs.org/eslint/-/eslint-10.16.0.tgz",
|
"resolved": "https://registry.npmjs.org/eslint/-/eslint-10.12.0.tgz",
|
||||||
"integrity": "sha512-Xu3PRLG/wCaZWZ20gkExUcNqL2mWWsXTR+Lln3Sof4Y9WuA678fH9hrlQ8B6UNwbTnsKdDdBYOd2jxtycXVTGQ==",
|
"integrity": "sha512-npHjrHb2o4ehH3mE+YuxABR+0gyb0aVWCIolgJDArwCiHEIsonBm3ZKjel5b0U5+a+MbEvIyRCGCzD3eKKK2NA==",
|
||||||
"dev": true,
|
"dev": true,
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
"workspaces": [
|
"workspaces": [
|
||||||
@@ -3650,11 +3541,11 @@
|
|||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@eslint-community/eslint-utils": "^4.8.0",
|
"@eslint-community/eslint-utils": "^4.8.0",
|
||||||
"@eslint-community/regexpp": "^4.12.2",
|
"@eslint-community/regexpp": "^4.12.2",
|
||||||
"@eslint/config-array": "^0.23.7",
|
"@eslint/config-array": "^0.23.5",
|
||||||
"@eslint/config-helpers": "^0.7.0",
|
"@eslint/config-helpers": "^0.7.0",
|
||||||
"@eslint/core": "^1.2.1",
|
"@eslint/core": "^1.2.1",
|
||||||
"@eslint/plugin-kit": "^0.7.3",
|
"@eslint/plugin-kit": "^0.7.3",
|
||||||
"@humanfs/node": "^0.16.8",
|
"@humanfs/node": "^0.16.6",
|
||||||
"@humanwhocodes/module-importer": "^1.0.1",
|
"@humanwhocodes/module-importer": "^1.0.1",
|
||||||
"@humanwhocodes/retry": "^0.4.2",
|
"@humanwhocodes/retry": "^0.4.2",
|
||||||
"@types/estree": "^1.0.6",
|
"@types/estree": "^1.0.6",
|
||||||
@@ -3675,7 +3566,7 @@
|
|||||||
"imurmurhash": "^0.1.4",
|
"imurmurhash": "^0.1.4",
|
||||||
"is-glob": "^4.0.0",
|
"is-glob": "^4.0.0",
|
||||||
"json-stable-stringify-without-jsonify": "^1.0.1",
|
"json-stable-stringify-without-jsonify": "^1.0.1",
|
||||||
"minimatch": "^11.0.5",
|
"minimatch": "^10.2.5",
|
||||||
"natural-compare": "^1.4.0",
|
"natural-compare": "^1.4.0",
|
||||||
"optionator": "^0.9.3"
|
"optionator": "^0.9.3"
|
||||||
},
|
},
|
||||||
@@ -3774,20 +3665,18 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/eslint-plugin-import-x": {
|
"node_modules/eslint-plugin-import-x": {
|
||||||
"version": "4.18.1",
|
"version": "4.17.1",
|
||||||
"resolved": "https://registry.npmjs.org/eslint-plugin-import-x/-/eslint-plugin-import-x-4.18.1.tgz",
|
"resolved": "https://registry.npmjs.org/eslint-plugin-import-x/-/eslint-plugin-import-x-4.17.1.tgz",
|
||||||
"integrity": "sha512-D1h++38NS2Z40zf8jbd2OHqDrnIFRKpdp8sL0jP4xSDGZj6MNwEQua8F+r3tOWjcHrsWuhHOJ7wASWioJ31tfg==",
|
"integrity": "sha512-4cdstYkKCyjumM2Q9NSI03K8D2a9F4Ssz33K2lv2hQa4KmR9jPLwk3uWGtNvclfqBrPGfGuMBwsGMbe6dMRbfg==",
|
||||||
"dev": true,
|
"dev": true,
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@typescript-eslint/types": "^8.56.0",
|
"@typescript-eslint/types": "^8.56.0",
|
||||||
"cjs-module-lexer": "^2.2.1",
|
|
||||||
"comment-parser": "^1.4.1",
|
"comment-parser": "^1.4.1",
|
||||||
"debug": "^4.4.1",
|
"debug": "^4.4.1",
|
||||||
"es-module-lexer": "^3.0.3",
|
|
||||||
"eslint-import-context": "^0.1.9",
|
"eslint-import-context": "^0.1.9",
|
||||||
"is-glob": "^4.0.3",
|
"is-glob": "^4.0.3",
|
||||||
"minimatch": "^9.0.3 || ^10.1.2 || ^11.0.1",
|
"minimatch": "^9.0.3 || ^10.1.2",
|
||||||
"semver": "^7.7.2",
|
"semver": "^7.7.2",
|
||||||
"stable-hash-x": "^0.2.0",
|
"stable-hash-x": "^0.2.0",
|
||||||
"unrs-resolver": "^1.9.2"
|
"unrs-resolver": "^1.9.2"
|
||||||
@@ -3812,17 +3701,10 @@
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/eslint-plugin-import-x/node_modules/es-module-lexer": {
|
|
||||||
"version": "3.0.5",
|
|
||||||
"resolved": "https://registry.npmjs.org/es-module-lexer/-/es-module-lexer-3.0.5.tgz",
|
|
||||||
"integrity": "sha512-RNq2lKJw53c7z9QRHeiKeA6Ez0oikOqiBGdmxQhKDxEiOX1g5QJR4IoFVwicn8uCZcRWNrXC3NZaJihgK7aEbg==",
|
|
||||||
"dev": true,
|
|
||||||
"license": "MIT"
|
|
||||||
},
|
|
||||||
"node_modules/eslint-plugin-jest": {
|
"node_modules/eslint-plugin-jest": {
|
||||||
"version": "29.17.2",
|
"version": "29.16.6",
|
||||||
"resolved": "https://registry.npmjs.org/eslint-plugin-jest/-/eslint-plugin-jest-29.17.2.tgz",
|
"resolved": "https://registry.npmjs.org/eslint-plugin-jest/-/eslint-plugin-jest-29.16.6.tgz",
|
||||||
"integrity": "sha512-PkDicB9njFXWby0rfpHSMGLkNf37c6EavIDUPNXVv1BGRLyr1nnea4jRc1EFOlUTZCW5iGzVGGHXb/siEf+QmQ==",
|
"integrity": "sha512-q8TVr0rlNvUD0XnafGWkwtPeX+tTl2llP86EDl3sJtwWrQA/JT9SIu2hLLZbhhX6fT5SDE4O0gIKyZUujKnkYA==",
|
||||||
"dev": true,
|
"dev": true,
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
@@ -3850,14 +3732,14 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/eslint-plugin-prettier": {
|
"node_modules/eslint-plugin-prettier": {
|
||||||
"version": "5.5.7",
|
"version": "5.5.6",
|
||||||
"resolved": "https://registry.npmjs.org/eslint-plugin-prettier/-/eslint-plugin-prettier-5.5.7.tgz",
|
"resolved": "https://registry.npmjs.org/eslint-plugin-prettier/-/eslint-plugin-prettier-5.5.6.tgz",
|
||||||
"integrity": "sha512-WjHyn3GrFd+ZR0rzsLiM4zJZ35PZMOE0SUIxzGmnWNG0126yNfJKJzObmmkYDwHJfGlkz3PSlzyG9ez/LJntwg==",
|
"integrity": "sha512-ifetmTcxWfz+4qRW3pH/ujdTq2jQIj59AxJMIN26K5avYgU8dxycUETQonWiW+wPrYXA0j3Try0l1CnwVQtDqQ==",
|
||||||
"dev": true,
|
"dev": true,
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"prettier-linter-helpers": "^1.0.1",
|
"prettier-linter-helpers": "^1.0.1",
|
||||||
"synckit": "^0.12.3"
|
"synckit": "^0.11.13"
|
||||||
},
|
},
|
||||||
"engines": {
|
"engines": {
|
||||||
"node": "^14.18.0 || >=16.0.0"
|
"node": "^14.18.0 || >=16.0.0"
|
||||||
@@ -3880,23 +3762,6 @@
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/eslint-plugin-prettier/node_modules/synckit": {
|
|
||||||
"version": "0.12.3",
|
|
||||||
"resolved": "https://registry.npmjs.org/synckit/-/synckit-0.12.3.tgz",
|
|
||||||
"integrity": "sha512-U+/AXT6LWsxnj2vz9HeUuPWBNgdWxjyIEjEPdbJARC9txmgPzo2VEdqnFo4hHaNyMPtycyVJrSaQYeQv/PoyyA==",
|
|
||||||
"dev": true,
|
|
||||||
"license": "MIT",
|
|
||||||
"dependencies": {
|
|
||||||
"@dual-bundle/import-meta-resolve": "^4.2.1",
|
|
||||||
"@pkgr/core": "^0.3.6"
|
|
||||||
},
|
|
||||||
"engines": {
|
|
||||||
"node": "^14.18.0 || >=16.0.0"
|
|
||||||
},
|
|
||||||
"funding": {
|
|
||||||
"url": "https://opencollective.com/synckit"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"node_modules/eslint-scope": {
|
"node_modules/eslint-scope": {
|
||||||
"version": "9.1.2",
|
"version": "9.1.2",
|
||||||
"resolved": "https://registry.npmjs.org/eslint-scope/-/eslint-scope-9.1.2.tgz",
|
"resolved": "https://registry.npmjs.org/eslint-scope/-/eslint-scope-9.1.2.tgz",
|
||||||
@@ -3983,20 +3848,6 @@
|
|||||||
"url": "https://opencollective.com/eslint"
|
"url": "https://opencollective.com/eslint"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/esprima": {
|
|
||||||
"version": "4.0.1",
|
|
||||||
"resolved": "https://registry.npmjs.org/esprima/-/esprima-4.0.1.tgz",
|
|
||||||
"integrity": "sha512-eGuFFw7Upda+g4p+QHvnW0RyTX/SVeJBDM/gCtMARO0cLuT2HcEKnTPvhjV6aGeqrCB/sbNop0Kszm0jsaWU4A==",
|
|
||||||
"dev": true,
|
|
||||||
"license": "BSD-2-Clause",
|
|
||||||
"bin": {
|
|
||||||
"esparse": "bin/esparse.js",
|
|
||||||
"esvalidate": "bin/esvalidate.js"
|
|
||||||
},
|
|
||||||
"engines": {
|
|
||||||
"node": ">=4"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"node_modules/esquery": {
|
"node_modules/esquery": {
|
||||||
"version": "1.7.0",
|
"version": "1.7.0",
|
||||||
"resolved": "https://registry.npmjs.org/esquery/-/esquery-1.7.0.tgz",
|
"resolved": "https://registry.npmjs.org/esquery/-/esquery-1.7.0.tgz",
|
||||||
@@ -4254,15 +4105,15 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/glob": {
|
"node_modules/glob": {
|
||||||
"version": "14.0.7",
|
"version": "13.0.6",
|
||||||
"resolved": "https://registry.npmjs.org/glob/-/glob-14.0.7.tgz",
|
"resolved": "https://registry.npmjs.org/glob/-/glob-13.0.6.tgz",
|
||||||
"integrity": "sha512-ob8P0VbyEjcLG2ycNYmzYhZj65kkcN5b7tt5moGhTq3rkXtuU8MB+i0GIzPtLnSHVF2DkK4M+nQRojDvsOGVJw==",
|
"integrity": "sha512-Wjlyrolmm8uDpm/ogGyXZXb1Z+Ca2B8NbJwqBVg0axK9GbBeoS7yGV6vjXnYdGm6X53iehEuxxbyiKp8QmN4Vw==",
|
||||||
"dev": true,
|
"dev": true,
|
||||||
"license": "BlueOak-1.0.0",
|
"license": "BlueOak-1.0.0",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"minimatch": "^11.0.5",
|
"minimatch": "^10.2.2",
|
||||||
"minipass": "^7.1.3",
|
"minipass": "^7.1.3",
|
||||||
"path-scurry": "^3.0.0"
|
"path-scurry": "^2.0.2"
|
||||||
},
|
},
|
||||||
"engines": {
|
"engines": {
|
||||||
"node": "18 || 20 || >=22"
|
"node": "18 || 20 || >=22"
|
||||||
@@ -4285,9 +4136,9 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/globals": {
|
"node_modules/globals": {
|
||||||
"version": "17.14.0",
|
"version": "17.13.0",
|
||||||
"resolved": "https://registry.npmjs.org/globals/-/globals-17.14.0.tgz",
|
"resolved": "https://registry.npmjs.org/globals/-/globals-17.13.0.tgz",
|
||||||
"integrity": "sha512-UtdkTVyAJePQv0J2M9Xe4L0ruNSDV314XiIJsADI2Zf40bcdAonE/D/OhAU8AT99oij9mhLByb+NvA3QWZYgCg==",
|
"integrity": "sha512-RwMTC61u7hrG3ZJMkZQOK4JLJrKS8QtoTii63EmWvFXHqycY9FObBJQCbsLxSO8kjKhWE5kV1GC+Vb1g3RI0Zg==",
|
||||||
"dev": true,
|
"dev": true,
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
"engines": {
|
"engines": {
|
||||||
@@ -5140,6 +4991,29 @@
|
|||||||
"dev": true,
|
"dev": true,
|
||||||
"license": "MIT"
|
"license": "MIT"
|
||||||
},
|
},
|
||||||
|
"node_modules/js-yaml": {
|
||||||
|
"version": "4.3.2",
|
||||||
|
"resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-4.3.2.tgz",
|
||||||
|
"integrity": "sha512-SFNOvSJ+Dgf/9An904Yx+CgSlIPCkIpao4qo51lpee25TIRejdH3rhR4EZMGoNx3/TP3O+wzWuiTFl4sqbltzA==",
|
||||||
|
"dev": true,
|
||||||
|
"funding": [
|
||||||
|
{
|
||||||
|
"type": "github",
|
||||||
|
"url": "https://github.com/sponsors/puzrin"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"type": "github",
|
||||||
|
"url": "https://github.com/sponsors/nodeca"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"license": "MIT",
|
||||||
|
"dependencies": {
|
||||||
|
"argparse": "^2.0.1"
|
||||||
|
},
|
||||||
|
"bin": {
|
||||||
|
"js-yaml": "bin/js-yaml.js"
|
||||||
|
}
|
||||||
|
},
|
||||||
"node_modules/jsesc": {
|
"node_modules/jsesc": {
|
||||||
"version": "3.1.0",
|
"version": "3.1.0",
|
||||||
"resolved": "https://registry.npmjs.org/jsesc/-/jsesc-3.1.0.tgz",
|
"resolved": "https://registry.npmjs.org/jsesc/-/jsesc-3.1.0.tgz",
|
||||||
@@ -5302,17 +5176,16 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/minimatch": {
|
"node_modules/minimatch": {
|
||||||
"version": "11.0.10",
|
"version": "10.2.6",
|
||||||
"resolved": "https://registry.npmjs.org/minimatch/-/minimatch-11.0.10.tgz",
|
"resolved": "https://registry.npmjs.org/minimatch/-/minimatch-10.2.6.tgz",
|
||||||
"integrity": "sha512-L3/cjhQ5E6lft0VCp/2mO3Ic74RnutKy3rz7iGwp/6w1hKcO262g2rbfacFyw6eBig5OdI0nu5PpuA0/WQs9Tw==",
|
"integrity": "sha512-vpLQEs+VLCr1nU0BXS07maYoFwlDAH0gngQuuttxIwutDFEMHq2blX+8vpgxDdK3J1PwjCJiep77OitTZ4Ll1A==",
|
||||||
"dev": true,
|
"dev": true,
|
||||||
"license": "BlueOak-1.0.0",
|
"license": "BlueOak-1.0.0",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@isaacs/nonrecursive-glob-match": "^1.1.0",
|
"brace-expansion": "^5.0.8"
|
||||||
"brace-expansion": "^5.0.12"
|
|
||||||
},
|
},
|
||||||
"engines": {
|
"engines": {
|
||||||
"node": "20 || >=22"
|
"node": "18 || 20 || >=22"
|
||||||
},
|
},
|
||||||
"funding": {
|
"funding": {
|
||||||
"url": "https://github.com/sponsors/isaacs"
|
"url": "https://github.com/sponsors/isaacs"
|
||||||
@@ -5376,16 +5249,16 @@
|
|||||||
"license": "MIT"
|
"license": "MIT"
|
||||||
},
|
},
|
||||||
"node_modules/nock": {
|
"node_modules/nock": {
|
||||||
"version": "15.0.7",
|
"version": "15.0.1",
|
||||||
"resolved": "https://registry.npmjs.org/nock/-/nock-15.0.7.tgz",
|
"resolved": "https://registry.npmjs.org/nock/-/nock-15.0.1.tgz",
|
||||||
"integrity": "sha512-BH7UHCRo/zHX0PT0oyz6RH0KZwkYo6TiSF5eJ3gg8lrvtSW6aKiNAXTmWUbHxmjMfvvrTT0ygl7/WM15XoAthg==",
|
"integrity": "sha512-Mjx5Xl4t9vP13eUZPWqwwpjjXNjvhUTo1qTdryVM3+7t6Z2w6WHZ9GVZk/zQ8Ym1vbmloWaglye3cloyHAJ8FA==",
|
||||||
"dev": true,
|
"dev": true,
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@mswjs/interceptors": "^0.45.14"
|
"@mswjs/interceptors": "^0.44.0"
|
||||||
},
|
},
|
||||||
"engines": {
|
"engines": {
|
||||||
"node": ">=22.20.0"
|
"node": ">=20.12.1"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/node-addon-api": {
|
"node_modules/node-addon-api": {
|
||||||
@@ -5558,9 +5431,9 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/path-scurry": {
|
"node_modules/path-scurry": {
|
||||||
"version": "3.0.0",
|
"version": "2.0.2",
|
||||||
"resolved": "https://registry.npmjs.org/path-scurry/-/path-scurry-3.0.0.tgz",
|
"resolved": "https://registry.npmjs.org/path-scurry/-/path-scurry-2.0.2.tgz",
|
||||||
"integrity": "sha512-1pTbQqH1wIwMi/eleQ5leFTTCkzFsPcgXNjwOA8YGGW/W4/kHT3dssE7Z6NH+zuqNLOzOB0uaD61yl7cAcVhgg==",
|
"integrity": "sha512-3O/iVVsJAPsOnpwWIeD+d6z/7PmqApyQePUtCndjatj/9I5LylHvt5qluFaBT3I5h3r1ejfR056c+FCv+NnNXg==",
|
||||||
"dev": true,
|
"dev": true,
|
||||||
"license": "BlueOak-1.0.0",
|
"license": "BlueOak-1.0.0",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
@@ -5694,9 +5567,9 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/prettier": {
|
"node_modules/prettier": {
|
||||||
"version": "3.10.1",
|
"version": "3.9.9",
|
||||||
"resolved": "https://registry.npmjs.org/prettier/-/prettier-3.10.1.tgz",
|
"resolved": "https://registry.npmjs.org/prettier/-/prettier-3.9.9.tgz",
|
||||||
"integrity": "sha512-70vp3ZUYoPlFbF9uiTdXHUUCGEIp7d4+6p+8DYbkm2jP7x/3i/paXVF6dopSI3zd/CEitrZN1rc4i85xWmmXlg==",
|
"integrity": "sha512-Z/CJHIkdujO/OtN7nXUii0Rf3VT5SRuhjBA82Xvu2XhBUgX3nhP67T0LHceBdQLex7OOFGTox+Q5Yg8Jk2Qivg==",
|
||||||
"dev": true,
|
"dev": true,
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
"bin": {
|
"bin": {
|
||||||
@@ -5842,9 +5715,9 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/rettime": {
|
"node_modules/rettime": {
|
||||||
"version": "0.11.13",
|
"version": "0.11.12",
|
||||||
"resolved": "https://registry.npmjs.org/rettime/-/rettime-0.11.13.tgz",
|
"resolved": "https://registry.npmjs.org/rettime/-/rettime-0.11.12.tgz",
|
||||||
"integrity": "sha512-kzDWDmrxn6KPqqyFaBcXtV+GzaUzgYulSrWBetyxsPZjlXabWoeg3uZJU+zK/TnFUtkWC2Yw7J/VAWYnzy0tRA==",
|
"integrity": "sha512-5ExtR1ppiDBQkVoPw5NAqdbfH4Iq2VOmQKHMtUoaFxA9bo2krzFYBtyq6K40xxbYp+2w/YOr6D+1ToF6tTN53A==",
|
||||||
"dev": true,
|
"dev": true,
|
||||||
"license": "MIT"
|
"license": "MIT"
|
||||||
},
|
},
|
||||||
@@ -5922,13 +5795,6 @@
|
|||||||
"node": ">=0.10.0"
|
"node": ">=0.10.0"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/sprintf-js": {
|
|
||||||
"version": "1.0.3",
|
|
||||||
"resolved": "https://registry.npmjs.org/sprintf-js/-/sprintf-js-1.0.3.tgz",
|
|
||||||
"integrity": "sha512-D9cPgkvLlV3t3IzL0D0YLvGA9Ahk4PcvVwUbN0dSGr1aP0Nrt4AEnTUbuGvquEC0mA64Gqt1fzirlRs5ibXx8g==",
|
|
||||||
"dev": true,
|
|
||||||
"license": "BSD-3-Clause"
|
|
||||||
},
|
|
||||||
"node_modules/stable-hash-x": {
|
"node_modules/stable-hash-x": {
|
||||||
"version": "0.2.0",
|
"version": "0.2.0",
|
||||||
"resolved": "https://registry.npmjs.org/stable-hash-x/-/stable-hash-x-0.2.0.tgz",
|
"resolved": "https://registry.npmjs.org/stable-hash-x/-/stable-hash-x-0.2.0.tgz",
|
||||||
@@ -6112,15 +5978,15 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/ts-jest": {
|
"node_modules/ts-jest": {
|
||||||
"version": "29.4.15",
|
"version": "29.4.14",
|
||||||
"resolved": "https://registry.npmjs.org/ts-jest/-/ts-jest-29.4.15.tgz",
|
"resolved": "https://registry.npmjs.org/ts-jest/-/ts-jest-29.4.14.tgz",
|
||||||
"integrity": "sha512-s2qmEUYFRqbjz1wv0EmccNPVOb45HOFpFuhzQJLKShYVisuTbCFPIIAIV2EuK5rIxb4BejLDbH7dnBZfYjybUQ==",
|
"integrity": "sha512-+943G6wCX5E3VpzTQhBGBFntCmdT+QAkTvUlp03edTONFBvqskuXPhpyX16xdUotO4P5HQKyppldSWjocoltLQ==",
|
||||||
"dev": true,
|
"dev": true,
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"bs-logger": "^0.2.6",
|
"bs-logger": "^0.2.6",
|
||||||
"fast-json-stable-stringify": "^2.1.0",
|
"fast-json-stable-stringify": "^2.1.0",
|
||||||
"handlebars": "^4.7.10",
|
"handlebars": "^4.7.9",
|
||||||
"json5": "^2.2.3",
|
"json5": "^2.2.3",
|
||||||
"lodash.memoize": "^4.1.2",
|
"lodash.memoize": "^4.1.2",
|
||||||
"make-error": "^1.3.6",
|
"make-error": "^1.3.6",
|
||||||
|
|||||||
+17
-15
@@ -1,9 +1,8 @@
|
|||||||
{
|
{
|
||||||
"name": "setup-php",
|
"name": "setup-php",
|
||||||
"version": "2.40.1",
|
"version": "2.40.0",
|
||||||
"private": false,
|
"private": false,
|
||||||
"description": "Setup PHP for use with GitHub Actions",
|
"description": "Setup PHP for use with GitHub Actions",
|
||||||
"type": "module",
|
|
||||||
"main": "lib/install.js",
|
"main": "lib/install.js",
|
||||||
"types": "lib/install.d.ts",
|
"types": "lib/install.d.ts",
|
||||||
"directories": {
|
"directories": {
|
||||||
@@ -43,29 +42,32 @@
|
|||||||
"@eslint/compat": "^2.1.1",
|
"@eslint/compat": "^2.1.1",
|
||||||
"@eslint/js": "^10.0.1",
|
"@eslint/js": "^10.0.1",
|
||||||
"@types/jest": "^30.0.0",
|
"@types/jest": "^30.0.0",
|
||||||
"@types/node": "^26.6.6",
|
"@types/node": "^26.6.4",
|
||||||
"@typescript-eslint/eslint-plugin": "^8.73.0",
|
"@typescript-eslint/eslint-plugin": "^8.71.1",
|
||||||
"@typescript-eslint/parser": "^8.73.0",
|
"@typescript-eslint/parser": "^8.71.1",
|
||||||
"@typescript/native": "npm:typescript@^7.0.2",
|
"@typescript/native": "npm:typescript@^7.0.2",
|
||||||
"@vercel/ncc": "^0.45.0",
|
"@vercel/ncc": "^0.45.0",
|
||||||
"eslint": "^10.15.0",
|
"eslint": "^10.12.0",
|
||||||
"eslint-config-prettier": "^10.1.8",
|
"eslint-config-prettier": "^10.1.8",
|
||||||
"eslint-import-resolver-typescript": "^4.4.5",
|
"eslint-import-resolver-typescript": "^4.4.5",
|
||||||
"eslint-plugin-import-x": "^4.18.1",
|
"eslint-plugin-import-x": "^4.17.1",
|
||||||
"eslint-plugin-jest": "^29.17.1",
|
"eslint-plugin-jest": "^29.16.6",
|
||||||
"eslint-plugin-prettier": "^5.5.7",
|
"eslint-plugin-prettier": "^5.5.6",
|
||||||
"globals": "^17.14.0",
|
"globals": "^17.13.0",
|
||||||
"jest": "^30.5.2",
|
"jest": "^30.5.2",
|
||||||
"jest-circus": "^30.5.2",
|
"jest-circus": "^30.5.2",
|
||||||
"nock": "^15.0.6",
|
"nock": "^15.0.1",
|
||||||
"prettier": "^3.10.1",
|
"prettier": "^3.9.9",
|
||||||
"simple-git-hooks": "^2.14.0",
|
"simple-git-hooks": "^2.14.0",
|
||||||
"ts-jest": "^29.4.15",
|
"ts-jest": "^29.4.14",
|
||||||
"typescript": "npm:@typescript/typescript6@^6.0.2"
|
"typescript": "npm:@typescript/typescript6@^6.0.2"
|
||||||
},
|
},
|
||||||
"overrides": {
|
"overrides": {
|
||||||
"glob": "^14.0.3",
|
"@babel/core": "^7.29.7",
|
||||||
"minimatch": "^11.0.10"
|
"js-yaml": "^4.2.0",
|
||||||
|
"test-exclude": "^7.0.1",
|
||||||
|
"glob": "^13.0.6",
|
||||||
|
"minimatch": "^10.2.1"
|
||||||
},
|
},
|
||||||
"bugs": {
|
"bugs": {
|
||||||
"url": "https://github.com/shivammathur/setup-php/issues"
|
"url": "https://github.com/shivammathur/setup-php/issues"
|
||||||
|
|||||||
+1
-1
@@ -1,4 +1,4 @@
|
|||||||
import * as utils from './utils.js';
|
import * as utils from './utils';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Add script to set custom ini values for unix
|
* Add script to set custom ini values for unix
|
||||||
|
|||||||
@@ -1,10 +1,10 @@
|
|||||||
{
|
{
|
||||||
"lowest": "8.1",
|
"lowest": "8.1",
|
||||||
"highest": "8.6",
|
"highest": "8.5",
|
||||||
"latest": "8.6",
|
"latest": "8.5",
|
||||||
"nightly": "8.7",
|
"nightly": "8.6",
|
||||||
"master": "8.7",
|
"master": "8.7",
|
||||||
"5.x": "5.6",
|
"5.x": "5.6",
|
||||||
"7.x": "7.4",
|
"7.x": "7.4",
|
||||||
"8.x": "8.6"
|
"8.x": "8.5"
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -0,0 +1,111 @@
|
|||||||
|
{
|
||||||
|
"amqp": "php-amqp/php-amqp",
|
||||||
|
"apcu": "apcu/apcu",
|
||||||
|
"apfd": "m6w6/ext-apfd",
|
||||||
|
"arrow": "flow-php/arrow-ext",
|
||||||
|
"ast": "nikic/php-ast",
|
||||||
|
"biscuit_php": "ptondereau/biscuit-php",
|
||||||
|
"bitset": "pecl/bitset",
|
||||||
|
"brotli": "kjdev/brotli",
|
||||||
|
"bsdiff": "bsdiff/bsdiff",
|
||||||
|
"csv": "girgias/csv",
|
||||||
|
"dbus": "pecl/dbus",
|
||||||
|
"decimal": "php-decimal/ext-decimal",
|
||||||
|
"deepclone": "symfony/deepclone",
|
||||||
|
"dio": "pecl/dio",
|
||||||
|
"ds": "php-ds/ext-ds",
|
||||||
|
"ev": "osmanov/pecl-ev",
|
||||||
|
"event": "osmanov/pecl-event",
|
||||||
|
"excel": "iliaal/php-excel",
|
||||||
|
"excimer": "wikimedia/excimer",
|
||||||
|
"fast_uuid": "iliaal/fast_uuid",
|
||||||
|
"fastchart": "iliaal/fastchart",
|
||||||
|
"fastjson": "iliaal/fastjson",
|
||||||
|
"geospatial": "php-geospatial/geospatial",
|
||||||
|
"glfw": "mario-deluna/php-glfw",
|
||||||
|
"grpc": "grpc/grpc-php-ext",
|
||||||
|
"hdr_histogram": "beberlei/hdrhistogram",
|
||||||
|
"hdrhistogram": "beberlei/hdrhistogram",
|
||||||
|
"highlighter": "yiipress/highlighter",
|
||||||
|
"http": "m6w6/ext-http",
|
||||||
|
"igbinary": "igbinary/igbinary",
|
||||||
|
"imagick": "imagick/imagick",
|
||||||
|
"inotify": "arnaud-lb/inotify",
|
||||||
|
"ip2location": "ip2location/ip2location-pie",
|
||||||
|
"ip2proxy": "ip2location/ip2proxy-pie",
|
||||||
|
"json_post": "m6w6/ext-json_post",
|
||||||
|
"jsonpath": "supermetrics/jsonpath",
|
||||||
|
"judy": "orieg/judy",
|
||||||
|
"krb5": "pecl/krb5",
|
||||||
|
"lchash": "iliaal/lchash",
|
||||||
|
"luasandbox": "wikimedia/luasandbox",
|
||||||
|
"lz4": "kjdev/lz4",
|
||||||
|
"lzf": "pecl/lzf",
|
||||||
|
"mailparse": "pecl/mailparse",
|
||||||
|
"maxminddb": "maxmind-db/reader-ext",
|
||||||
|
"mcrypt": "pecl/mcrypt",
|
||||||
|
"mdparser": "iliaal/mdparser",
|
||||||
|
"memcached": "php-memcached/php-memcached",
|
||||||
|
"memprof": "arnaud-lb/memprof",
|
||||||
|
"mjml": "kcs/mjml",
|
||||||
|
"mongodb": "mongodb/mongodb-extension",
|
||||||
|
"msgpack": "msgpack/msgpack-php",
|
||||||
|
"mustache": "jbboehr/php-mustache",
|
||||||
|
"oci8": "oci8/oci8",
|
||||||
|
"openswoole": "openswoole/ext-openswoole",
|
||||||
|
"opentelemetry": "open-telemetry/ext-opentelemetry",
|
||||||
|
"operator": "jblo/operator",
|
||||||
|
"parallel": "pecl/parallel",
|
||||||
|
"pcov": "pecl/pcov",
|
||||||
|
"pdo_duckdb": "thomas-0816/pdo-duckdb-php",
|
||||||
|
"pdo_oci": "pecl/pdo_oci",
|
||||||
|
"pdo_sqlsrv": "microsoft/pdo_sqlsrv",
|
||||||
|
"pecl_http": "m6w6/ext-http",
|
||||||
|
"phalcon": "phalcon/cphalcon",
|
||||||
|
"phonetic": "iliaal/phonetic",
|
||||||
|
"phpser": "iliaal/phpser",
|
||||||
|
"phpstan_turbo": "phpstan/turbo",
|
||||||
|
"pkcs11": "gamringer/pkcs11",
|
||||||
|
"pq": "m6w6/ext-pq",
|
||||||
|
"quickhash": "derickr/quickhash",
|
||||||
|
"raphf": "m6w6/ext-raphf",
|
||||||
|
"rar": "cataphract/rar",
|
||||||
|
"rdkafka": "rdkafka/rdkafka",
|
||||||
|
"redis": "phpredis/phpredis",
|
||||||
|
"relay": "cachewerk/ext-relay",
|
||||||
|
"rpminfo": "remi/rpminfo",
|
||||||
|
"scrypt": "woohoolabs/php-scrypt",
|
||||||
|
"selinux": "pecl/selinux",
|
||||||
|
"snappy": "kjdev/snappy",
|
||||||
|
"solr": "pecl/solr",
|
||||||
|
"spx": "noisebynorthwest/php-spx",
|
||||||
|
"sqlsrv": "microsoft/sqlsrv",
|
||||||
|
"statgrab": "iliaal/statgrab",
|
||||||
|
"swoole": "swoole/swoole",
|
||||||
|
"swow": "swow/swow-extension",
|
||||||
|
"taint": "laruence/taint",
|
||||||
|
"tensor": "rubix/tensor_ext",
|
||||||
|
"timezonedb": "pecl/timezonedb",
|
||||||
|
"translit": "derickr/translit",
|
||||||
|
"uopz": "krakjoe/uopz",
|
||||||
|
"uuid": "pecl/uuid",
|
||||||
|
"uv": "amphp/uv",
|
||||||
|
"valkey_glide": "valkey-io/valkey-glide-php",
|
||||||
|
"vld": "derickr/vld",
|
||||||
|
"wikidiff2": "wikimedia/wikidiff2",
|
||||||
|
"win32service": "win32service/win32service",
|
||||||
|
"xattr": "pecl/xattr",
|
||||||
|
"xdebug": "xdebug/xdebug",
|
||||||
|
"xdiff": "pecl/xdiff",
|
||||||
|
"xlswriter": "viest/xlswriter",
|
||||||
|
"xmldiff": "pecl/xml-xmldiff",
|
||||||
|
"xpass": "remi/xpass",
|
||||||
|
"yac": "laruence/yac",
|
||||||
|
"yaconf": "laruence/yaconf",
|
||||||
|
"yaf": "laruence/yaf",
|
||||||
|
"yaml": "pecl/yaml",
|
||||||
|
"yar": "laruence/yar",
|
||||||
|
"yaz": "indexdata/yaz",
|
||||||
|
"zip": "pecl/zip",
|
||||||
|
"zstd": "kjdev/zstd"
|
||||||
|
}
|
||||||
+15
-71
@@ -3,77 +3,21 @@
|
|||||||
{
|
{
|
||||||
"owner": "phpunit",
|
"owner": "phpunit",
|
||||||
"pattern": [
|
"pattern": [
|
||||||
{ "regexp": "^\\d+\\)\\s.*$" },
|
{
|
||||||
{ "regexp": "^(.*Failed\\sasserting\\sthat.*)$", "message": 1 },
|
"regexp": "^\\d+\\)\\s.*$"
|
||||||
{ "regexp": "^\\s*$" },
|
},
|
||||||
{ "regexp": "^(.*):(\\d+)$", "file": 1, "line": 2 }
|
{
|
||||||
]
|
"regexp": "^(.*Failed\\sasserting\\sthat.*)$",
|
||||||
},
|
"message": 1
|
||||||
{
|
},
|
||||||
"owner": "phpunit-no-blank",
|
{
|
||||||
"pattern": [
|
"regexp": "^\\s*$"
|
||||||
{ "regexp": "^\\d+\\)\\s.*$" },
|
},
|
||||||
{ "regexp": "^(.*Failed\\sasserting\\sthat.*)$", "message": 1 },
|
{
|
||||||
{ "regexp": "^(.*):(\\d+)$", "file": 1, "line": 2 }
|
"regexp": "^(.*):(\\d+)$",
|
||||||
]
|
"file": 1,
|
||||||
},
|
"line": 2
|
||||||
{
|
}
|
||||||
"owner": "phpunit-custom-message",
|
|
||||||
"pattern": [
|
|
||||||
{ "regexp": "^\\d+\\)\\s.*$" },
|
|
||||||
{ "regexp": "^(?!.*Failed\\sasserting)(.+)$", "message": 1 },
|
|
||||||
{ "regexp": "^.*Failed\\sasserting\\sthat.*$" },
|
|
||||||
{ "regexp": "^(.*):(\\d+)$", "file": 1, "line": 2 }
|
|
||||||
]
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"owner": "phpunit-custom-message-blank",
|
|
||||||
"pattern": [
|
|
||||||
{ "regexp": "^\\d+\\)\\s.*$" },
|
|
||||||
{ "regexp": "^(?!.*Failed\\sasserting)(.+)$", "message": 1 },
|
|
||||||
{ "regexp": "^.*Failed\\sasserting\\sthat.*$" },
|
|
||||||
{ "regexp": "^\\s*$" },
|
|
||||||
{ "regexp": "^(.*):(\\d+)$", "file": 1, "line": 2 }
|
|
||||||
]
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"owner": "phpunit-other-blank",
|
|
||||||
"pattern": [
|
|
||||||
{ "regexp": "^\\d+\\)\\s.*$" },
|
|
||||||
{ "regexp": "^(?!.*Failed\\sasserting)(.+)$", "message": 1 },
|
|
||||||
{ "regexp": "^(?:\\s*|[-+@ ].*)$" },
|
|
||||||
{ "regexp": "^(.*):(\\d+)$", "file": 1, "line": 2 }
|
|
||||||
]
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"owner": "phpunit-other",
|
|
||||||
"pattern": [
|
|
||||||
{ "regexp": "^\\d+\\)\\s.*$" },
|
|
||||||
{ "regexp": "^(?!.*Failed\\sasserting)(.+)$", "message": 1 },
|
|
||||||
{ "regexp": "^(.*):(\\d+)$", "file": 1, "line": 2 }
|
|
||||||
]
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"owner": "phpunit-warning",
|
|
||||||
"severity": "warning",
|
|
||||||
"pattern": [
|
|
||||||
{ "regexp": "^There (?:was|were) \\d+ (?:(?:risky|skipped) tests?(?: suites?)?|(?:PHPUnit(?: test runner)? )?warnings?):$" },
|
|
||||||
{ "regexp": "^(?:(\\s*(/.*|[A-Za-z]:[\\\\/].*):(\\d+)|(?!-+$|There (?:was|were) \\d+ .+:$|\\d+ tests? triggered \\d+ .+:$|OK(?: \\(\\d+ tests?, \\d+ assertions?\\)|, but (?:there were issues|some tests were skipped|incomplete, skipped, or risky tests)!)$|(?:FAILURES|ERRORS|WARNINGS)!$|Tests: \\d+(?:,|\\.?$)|PHPUnit \\d+\\.\\S+ by |Triggered by:$).*)|Triggered by:)$", "message": 1, "file": 2, "line": 3, "loop": true }
|
|
||||||
]
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"owner": "phpunit-notice",
|
|
||||||
"severity": "notice",
|
|
||||||
"pattern": [
|
|
||||||
{ "regexp": "^There (?:was|were) \\d+ (?:incomplete tests?(?: suites?)?|(?:PHPUnit(?: test runner)? )?notices?):$" },
|
|
||||||
{ "regexp": "^(?:(\\s*(/.*|[A-Za-z]:[\\\\/].*):(\\d+)|(?!-+$|There (?:was|were) \\d+ .+:$|\\d+ tests? triggered \\d+ .+:$|OK(?: \\(\\d+ tests?, \\d+ assertions?\\)|, but (?:there were issues|some tests were skipped|incomplete, skipped, or risky tests)!)$|(?:FAILURES|ERRORS|WARNINGS)!$|Tests: \\d+(?:,|\\.?$)|PHPUnit \\d+\\.\\S+ by |Triggered by:$).*)|Triggered by:)$", "message": 1, "file": 2, "line": 3, "loop": true }
|
|
||||||
]
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"owner": "phpunit-issue",
|
|
||||||
"pattern": [
|
|
||||||
{ "regexp": "^\\d+ tests? triggered \\d+ (?:PHP(?:Unit)? )?(error|warning|notice)s?:$", "severity": 1 },
|
|
||||||
{ "regexp": "^(?:\\d+\\)\\s)?(?:(\\s*(/.*|[A-Za-z]:[\\\\/].*):(\\d+)|(?!-+$|There (?:was|were) \\d+ .+:$|\\d+ tests? triggered \\d+ .+:$|OK(?: \\(\\d+ tests?, \\d+ assertions?\\)|, but (?:there were issues|some tests were skipped|incomplete, skipped, or risky tests)!)$|(?:FAILURES|ERRORS|WARNINGS)!$|Tests: \\d+(?:,|\\.?$)|PHPUnit \\d+\\.\\S+ by |Triggered by:$).*)|Triggered by:)$", "message": 1, "file": 2, "line": 3, "loop": true }
|
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
|
|||||||
+5
-18
@@ -153,17 +153,12 @@
|
|||||||
"version_parameter": "-V"
|
"version_parameter": "-V"
|
||||||
},
|
},
|
||||||
"phpstan": {
|
"phpstan": {
|
||||||
"type": "composer",
|
"type": "phar",
|
||||||
"repository": "phpstan/phpstan",
|
"repository": "phpstan/phpstan",
|
||||||
"scope": "scoped",
|
"extension": ".phar",
|
||||||
"fallback": {
|
"domain": "https://github.com",
|
||||||
"type": "phar",
|
"version_prefix": "",
|
||||||
"repository": "phpstan/phpstan",
|
"version_parameter": "-V"
|
||||||
"extension": ".phar",
|
|
||||||
"domain": "https://github.com",
|
|
||||||
"version_prefix": "",
|
|
||||||
"version_parameter": "-V"
|
|
||||||
}
|
|
||||||
},
|
},
|
||||||
"pie": {
|
"pie": {
|
||||||
"type": "phar",
|
"type": "phar",
|
||||||
@@ -288,14 +283,6 @@
|
|||||||
"version_prefix": "v",
|
"version_prefix": "v",
|
||||||
"version_parameter": "-V"
|
"version_parameter": "-V"
|
||||||
},
|
},
|
||||||
"upsun-cli": {
|
|
||||||
"alias": "upsun",
|
|
||||||
"type": "custom-package",
|
|
||||||
"repository": "upsun/cli",
|
|
||||||
"domain": "https://github.com",
|
|
||||||
"version_prefix": "v",
|
|
||||||
"version_parameter": "--version"
|
|
||||||
},
|
|
||||||
"blackfire-player": {
|
"blackfire-player": {
|
||||||
"type": "custom-function",
|
"type": "custom-function",
|
||||||
"domain": "https://get.blackfire.io",
|
"domain": "https://get.blackfire.io",
|
||||||
|
|||||||
+114
-152
@@ -1,5 +1,5 @@
|
|||||||
{
|
{
|
||||||
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
"$schema": "http://json-schema.org/draft-07/schema#",
|
||||||
"$id": "https://raw.githubusercontent.com/shivammathur/setup-php/develop/src/configs/tools_schema.json",
|
"$id": "https://raw.githubusercontent.com/shivammathur/setup-php/develop/src/configs/tools_schema.json",
|
||||||
"type": "object",
|
"type": "object",
|
||||||
"title": "Tools",
|
"title": "Tools",
|
||||||
@@ -14,161 +14,123 @@
|
|||||||
"function": "function_name",
|
"function": "function_name",
|
||||||
"repository": "user/tool",
|
"repository": "user/tool",
|
||||||
"packagist": "user/tool",
|
"packagist": "user/tool",
|
||||||
"scope": "scoped",
|
"scope": "global, scoped",
|
||||||
"type": "composer",
|
"type": "phar, composer, custom-package or custom-function",
|
||||||
"version_parameter": "--version",
|
"version_parameter": "--version",
|
||||||
"version_prefix": "v",
|
"version_prefix": "v"
|
||||||
"fallback": {
|
|
||||||
"type": "phar",
|
|
||||||
"repository": "user/tool",
|
|
||||||
"domain": "https://github.com",
|
|
||||||
"extension": ".phar",
|
|
||||||
"version_prefix": "v",
|
|
||||||
"version_parameter": "--version"
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"additionalProperties": {
|
"items": {
|
||||||
"$ref": "#/$defs/tool"
|
"properties": {
|
||||||
},
|
"alias": {
|
||||||
"$defs": {
|
"$id": "#/items/properties/alias",
|
||||||
"tool": {
|
"type": "string",
|
||||||
"type": "object",
|
"title": "The alias schema",
|
||||||
"properties": {
|
"description": "Alias for a tool.",
|
||||||
"alias": {
|
"examples": [
|
||||||
"type": "string",
|
"tool_alias"
|
||||||
"title": "The alias schema",
|
]
|
||||||
"description": "Alias for a tool.",
|
|
||||||
"examples": [
|
|
||||||
"tool_alias"
|
|
||||||
]
|
|
||||||
},
|
|
||||||
"domain": {
|
|
||||||
"type": "string",
|
|
||||||
"title": "The domain schema",
|
|
||||||
"description": "Domain URL of the tool.",
|
|
||||||
"examples": [
|
|
||||||
"https://example.com"
|
|
||||||
]
|
|
||||||
},
|
|
||||||
"extension": {
|
|
||||||
"type": "string",
|
|
||||||
"title": "The extension schema",
|
|
||||||
"description": "File extension of the tool.",
|
|
||||||
"examples": [
|
|
||||||
".ext"
|
|
||||||
]
|
|
||||||
},
|
|
||||||
"fetch_latest": {
|
|
||||||
"type": "string",
|
|
||||||
"title": "The fetch_latest schema",
|
|
||||||
"description": "Fetch the latest version from GitHub releases.",
|
|
||||||
"enum": [
|
|
||||||
"true",
|
|
||||||
"false"
|
|
||||||
]
|
|
||||||
},
|
|
||||||
"function": {
|
|
||||||
"type": "string",
|
|
||||||
"title": "The function schema",
|
|
||||||
"description": "Function name in tools.ts which returns the script to setup the tool.",
|
|
||||||
"examples": [
|
|
||||||
"function_name"
|
|
||||||
]
|
|
||||||
},
|
|
||||||
"repository": {
|
|
||||||
"type": "string",
|
|
||||||
"title": "The repository schema",
|
|
||||||
"description": "GitHub repository of the tool.",
|
|
||||||
"examples": [
|
|
||||||
"user/tool"
|
|
||||||
]
|
|
||||||
},
|
|
||||||
"packagist": {
|
|
||||||
"type": "string",
|
|
||||||
"title": "The repository schema",
|
|
||||||
"description": "Packagist repository of the tool in case different from repository.",
|
|
||||||
"examples": [
|
|
||||||
"user/tool"
|
|
||||||
]
|
|
||||||
},
|
|
||||||
"scope": {
|
|
||||||
"type": "string",
|
|
||||||
"title": "The scope schema",
|
|
||||||
"description": "Scope of tool installation: global or scoped",
|
|
||||||
"enum": [
|
|
||||||
"global",
|
|
||||||
"scoped"
|
|
||||||
]
|
|
||||||
},
|
|
||||||
"type": {
|
|
||||||
"type": "string",
|
|
||||||
"title": "The type schema",
|
|
||||||
"description": "Type of tool: phar, composer, custom-package or custom-function.",
|
|
||||||
"enum": [
|
|
||||||
"phar",
|
|
||||||
"composer",
|
|
||||||
"custom-package",
|
|
||||||
"custom-function"
|
|
||||||
]
|
|
||||||
},
|
|
||||||
"version_parameter": {
|
|
||||||
"type": "string",
|
|
||||||
"title": "The version_parameter schema",
|
|
||||||
"description": "Parameter to get the tool version.",
|
|
||||||
"examples": [
|
|
||||||
"--version"
|
|
||||||
]
|
|
||||||
},
|
|
||||||
"version_prefix": {
|
|
||||||
"type": "string",
|
|
||||||
"title": "The version_prefix schema",
|
|
||||||
"description": "Prefix of the version in the download URL.",
|
|
||||||
"examples": [
|
|
||||||
"v"
|
|
||||||
]
|
|
||||||
},
|
|
||||||
"fallback": {
|
|
||||||
"$ref": "#/$defs/pharFallback"
|
|
||||||
}
|
|
||||||
},
|
},
|
||||||
"required": [
|
"domain": {
|
||||||
"type"
|
"$id": "#/items/properties/domain",
|
||||||
],
|
"type": "string",
|
||||||
"additionalProperties": true
|
"title": "The domain schema",
|
||||||
|
"description": "Domain URL of the tool.",
|
||||||
|
"examples": [
|
||||||
|
"https://example.com"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"extension": {
|
||||||
|
"$id": "#/items/properties/extension",
|
||||||
|
"type": "string",
|
||||||
|
"title": "The extension schema",
|
||||||
|
"description": "File extension of the tool.",
|
||||||
|
"examples": [
|
||||||
|
".ext"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"fetch_latest": {
|
||||||
|
"$id": "#/items/properties/fetch_latest",
|
||||||
|
"type": "string",
|
||||||
|
"title": "The fetch_latest schema",
|
||||||
|
"description": "Fetch the latest version from GitHub releases.",
|
||||||
|
"enum": [
|
||||||
|
"true",
|
||||||
|
"false"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"function": {
|
||||||
|
"$id": "#/items/properties/function",
|
||||||
|
"type": "string",
|
||||||
|
"title": "The function schema",
|
||||||
|
"description": "Function name in tools.ts which returns the script to setup the tool.",
|
||||||
|
"examples": [
|
||||||
|
"function_name"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"repository": {
|
||||||
|
"$id": "#/items/properties/repository",
|
||||||
|
"type": "string",
|
||||||
|
"title": "The repository schema",
|
||||||
|
"description": "GitHub repository of the tool.",
|
||||||
|
"examples": [
|
||||||
|
"user/tool"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"packagist": {
|
||||||
|
"$id": "#/items/properties/packagist",
|
||||||
|
"type": "string",
|
||||||
|
"title": "The repository schema",
|
||||||
|
"description": "Packagist repository of the tool in case different from repository.",
|
||||||
|
"examples": [
|
||||||
|
"user/tool"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"scope": {
|
||||||
|
"$id": "#/items/properties/scope",
|
||||||
|
"type": "string",
|
||||||
|
"title": "The scope schema",
|
||||||
|
"description": "Scope of tool installation: global or scoped",
|
||||||
|
"enum": [
|
||||||
|
"global",
|
||||||
|
"scoped"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"type": {
|
||||||
|
"$id": "#/items/properties/type",
|
||||||
|
"type": "string",
|
||||||
|
"title": "The type schema",
|
||||||
|
"description": "Type of tool: phar, composer, custom-package or custom-function.",
|
||||||
|
"enum": [
|
||||||
|
"phar",
|
||||||
|
"composer",
|
||||||
|
"custom-package",
|
||||||
|
"custom-function"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"version_parameter": {
|
||||||
|
"$id": "#/items/properties/version_parameter",
|
||||||
|
"type": "string",
|
||||||
|
"title": "The version_parameter schema",
|
||||||
|
"description": "Parameter to get the tool version.",
|
||||||
|
"examples": [
|
||||||
|
"--version"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"version_prefix": {
|
||||||
|
"$id": "#/items/properties/version_prefix",
|
||||||
|
"type": "string",
|
||||||
|
"title": "The version_prefix schema",
|
||||||
|
"description": "Prefix of the version in the download URL.",
|
||||||
|
"examples": [
|
||||||
|
"v"
|
||||||
|
]
|
||||||
|
}
|
||||||
},
|
},
|
||||||
"pharFallback": {
|
"required": [
|
||||||
"type": "object",
|
"type"
|
||||||
"title": "The fallback schema",
|
],
|
||||||
"description": "PHAR installation settings used when Composer installation fails.",
|
"additionalProperties": true
|
||||||
"properties": {
|
|
||||||
"type": {
|
|
||||||
"const": "phar"
|
|
||||||
},
|
|
||||||
"repository": {
|
|
||||||
"$ref": "#/$defs/tool/properties/repository"
|
|
||||||
},
|
|
||||||
"domain": {
|
|
||||||
"$ref": "#/$defs/tool/properties/domain"
|
|
||||||
},
|
|
||||||
"extension": {
|
|
||||||
"$ref": "#/$defs/tool/properties/extension"
|
|
||||||
},
|
|
||||||
"fetch_latest": {
|
|
||||||
"$ref": "#/$defs/tool/properties/fetch_latest"
|
|
||||||
},
|
|
||||||
"version_parameter": {
|
|
||||||
"$ref": "#/$defs/tool/properties/version_parameter"
|
|
||||||
},
|
|
||||||
"version_prefix": {
|
|
||||||
"$ref": "#/$defs/tool/properties/version_prefix"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"required": [
|
|
||||||
"type"
|
|
||||||
],
|
|
||||||
"additionalProperties": false
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
+3
-3
@@ -1,6 +1,6 @@
|
|||||||
import * as utils from './utils.js';
|
import * as utils from './utils';
|
||||||
import * as extensions from './extensions.js';
|
import * as extensions from './extensions';
|
||||||
import * as config from './config.js';
|
import * as config from './config';
|
||||||
|
|
||||||
export async function checkXdebugError(
|
export async function checkXdebugError(
|
||||||
extension: string,
|
extension: string,
|
||||||
|
|||||||
+6
-6
@@ -1,4 +1,4 @@
|
|||||||
import * as utils from './utils.js';
|
import * as utils from './utils';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Install and enable extensions for darwin
|
* Install and enable extensions for darwin
|
||||||
@@ -31,14 +31,14 @@ export async function addExtensionDarwin(
|
|||||||
case /.+-.+\/.+@.+/.test(extension):
|
case /.+-.+\/.+@.+/.test(extension):
|
||||||
add_script += await utils.parseExtensionSource(extension, ext_prefix);
|
add_script += await utils.parseExtensionSource(extension, ext_prefix);
|
||||||
return;
|
return;
|
||||||
// match 7.4relay...8.6relay
|
// match 7.4relay...8.5relay
|
||||||
// match 5.3blackfire...8.5blackfire
|
// match 5.3blackfire...8.5blackfire
|
||||||
// match 5.3blackfire-(semver)...8.5blackfire-(semver)
|
// match 5.3blackfire-(semver)...8.5blackfire-(semver)
|
||||||
// match couchbase, event, geos, ibm_db2, pdo_ibm, pdo_oci, oci8, http, pecl_http
|
// match couchbase, event, geos, ibm_db2, pdo_ibm, pdo_oci, oci8, http, pecl_http
|
||||||
// match 5.3ioncube...8.5ioncube
|
// match 5.3ioncube...8.5ioncube
|
||||||
// match 7.0phalcon3...7.3phalcon3, 7.2phalcon4...7.4phalcon4, and 7.4phalcon5...8.4phalcon5
|
// match 7.0phalcon3...7.3phalcon3, 7.2phalcon4...7.4phalcon4, and 7.4phalcon5...8.4phalcon5
|
||||||
// match 7.0zephir_parser...8.5zephir_parser
|
// match 7.0zephir_parser...8.5zephir_parser
|
||||||
case /^(7\.4|8\.[0-6])relay(-v?\d+\.\d+\.\d+|-nightly)?$/.test(
|
case /^(7\.4|8\.[0-5])relay(-v?\d+\.\d+\.\d+|-nightly)?$/.test(
|
||||||
version_extension
|
version_extension
|
||||||
):
|
):
|
||||||
case /^(5\.[3-6]|7\.[0-4]|8\.[0-5])blackfire(-\d+\.\d+\.\d+)?$/.test(
|
case /^(5\.[3-6]|7\.[0-4]|8\.[0-5])blackfire(-\d+\.\d+\.\d+)?$/.test(
|
||||||
@@ -180,7 +180,7 @@ export async function addExtensionWindows(
|
|||||||
add_script += await utils.joins(
|
add_script += await utils.joins(
|
||||||
'\nAdd-Extension',
|
'\nAdd-Extension',
|
||||||
ext_name,
|
ext_name,
|
||||||
ext_version
|
ext_version.replace('stable', '')
|
||||||
);
|
);
|
||||||
break;
|
break;
|
||||||
// match extensions for compiling from source
|
// match extensions for compiling from source
|
||||||
@@ -277,7 +277,7 @@ export async function addExtensionLinux(
|
|||||||
case /.+-.+\/.+@.+/.test(extension):
|
case /.+-.+\/.+@.+/.test(extension):
|
||||||
add_script += await utils.parseExtensionSource(extension, ext_prefix);
|
add_script += await utils.parseExtensionSource(extension, ext_prefix);
|
||||||
return;
|
return;
|
||||||
// match 7.4relay...8.6relay
|
// match 7.4relay...8.5relay
|
||||||
// match 5.3blackfire...8.5blackfire
|
// match 5.3blackfire...8.5blackfire
|
||||||
// match 5.3blackfire-(semver)...8.5blackfire-(semver)
|
// match 5.3blackfire-(semver)...8.5blackfire-(semver)
|
||||||
// match 5.3pdo_cubrid...7.2php_cubrid, 5.3cubrid...7.4cubrid
|
// match 5.3pdo_cubrid...7.2php_cubrid, 5.3cubrid...7.4cubrid
|
||||||
@@ -285,7 +285,7 @@ export async function addExtensionLinux(
|
|||||||
// match 5.3ioncube...8.5ioncube
|
// match 5.3ioncube...8.5ioncube
|
||||||
// match 7.0phalcon3...7.3phalcon3, 7.2phalcon4...7.4phalcon4, 7.4phalcon5...8.4phalcon5
|
// match 7.0phalcon3...7.3phalcon3, 7.2phalcon4...7.4phalcon4, 7.4phalcon5...8.4phalcon5
|
||||||
// match 7.0zephir_parser...8.5zephir_parser
|
// match 7.0zephir_parser...8.5zephir_parser
|
||||||
case /^(7\.4|8\.[0-6])relay(-v?\d+\.\d+\.\d+|-nightly)?$/.test(
|
case /^(7\.4|8\.[0-5])relay(-v?\d+\.\d+\.\d+|-nightly)?$/.test(
|
||||||
version_extension
|
version_extension
|
||||||
):
|
):
|
||||||
case /^(5\.[3-6]|7\.[0-4]|8\.[0-5])blackfire(-\d+\.\d+\.\d+)?$/.test(
|
case /^(5\.[3-6]|7\.[0-4]|8\.[0-5])blackfire(-\d+\.\d+\.\d+)?$/.test(
|
||||||
|
|||||||
+1
-1
@@ -16,7 +16,7 @@ export async function fetch(
|
|||||||
redirect_count = 5
|
redirect_count = 5
|
||||||
): Promise<Record<string, string>> {
|
): Promise<Record<string, string>> {
|
||||||
const headers: Record<string, string> = {
|
const headers: Record<string, string> = {
|
||||||
'User-Agent': `setup-php (${process.platform}; ${process.arch}; +https://setup-php.com)`
|
'User-Agent': `Mozilla/5.0 (${process.platform} ${process.arch}) setup-php`
|
||||||
};
|
};
|
||||||
if (auth_token) {
|
if (auth_token) {
|
||||||
headers['Authorization'] = 'Bearer ' + auth_token;
|
headers['Authorization'] = 'Bearer ' + auth_token;
|
||||||
|
|||||||
+8
-11
@@ -1,15 +1,11 @@
|
|||||||
import {fileURLToPath} from 'url';
|
|
||||||
import path from 'path';
|
import path from 'path';
|
||||||
import {exec} from '@actions/exec';
|
|
||||||
import fs from 'fs';
|
import fs from 'fs';
|
||||||
import * as config from './config.js';
|
import * as config from './config';
|
||||||
import * as core from './core.js';
|
import * as core from './core';
|
||||||
import * as coverage from './coverage.js';
|
import * as coverage from './coverage';
|
||||||
import * as extensions from './extensions.js';
|
import * as extensions from './extensions';
|
||||||
import * as tools from './tools.js';
|
import * as tools from './tools';
|
||||||
import * as utils from './utils.js';
|
import * as utils from './utils';
|
||||||
|
|
||||||
const dirname = path.dirname(fileURLToPath(import.meta.url));
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Build the script
|
* Build the script
|
||||||
@@ -19,7 +15,7 @@ const dirname = path.dirname(fileURLToPath(import.meta.url));
|
|||||||
export async function getScript(os: string): Promise<string> {
|
export async function getScript(os: string): Promise<string> {
|
||||||
const url = 'https://setup-php.com/sponsor';
|
const url = 'https://setup-php.com/sponsor';
|
||||||
const filename = os + (await utils.scriptExtension(os));
|
const filename = os + (await utils.scriptExtension(os));
|
||||||
const script_path = path.join(dirname, '../src/scripts', filename);
|
const script_path = path.join(__dirname, '../src/scripts', filename);
|
||||||
const run_path = script_path.replace(os, 'run');
|
const run_path = script_path.replace(os, 'run');
|
||||||
const extension_csv: string = utils.sanitizeShellInput(
|
const extension_csv: string = utils.sanitizeShellInput(
|
||||||
await utils.getInput('extensions', false),
|
await utils.getInput('extensions', false),
|
||||||
@@ -69,6 +65,7 @@ export async function run(): Promise<void> {
|
|||||||
const os: string = process.platform;
|
const os: string = process.platform;
|
||||||
const tool = await utils.scriptTool(os);
|
const tool = await utils.scriptTool(os);
|
||||||
const run_path = await getScript(os);
|
const run_path = await getScript(os);
|
||||||
|
const {exec} = await import('@actions/exec');
|
||||||
await exec(tool + run_path);
|
await exec(tool + run_path);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
+1
-1
@@ -1,5 +1,5 @@
|
|||||||
import * as cv from 'compare-versions';
|
import * as cv from 'compare-versions';
|
||||||
import * as fetch from './fetch.js';
|
import * as fetch from './fetch';
|
||||||
|
|
||||||
type RS = Record<string, string>;
|
type RS = Record<string, string>;
|
||||||
type RSRS = Record<string, RS>;
|
type RSRS = Record<string, RS>;
|
||||||
|
|||||||
@@ -168,12 +168,8 @@ patch_brew() {
|
|||||||
# Function to update dependencies.
|
# Function to update dependencies.
|
||||||
update_dependencies() {
|
update_dependencies() {
|
||||||
if ! [ -e /tmp/update_dependencies ]; then
|
if ! [ -e /tmp/update_dependencies ]; then
|
||||||
local repos=("$brew_repo")
|
for repo in "$brew_repo" "${core_repo:?}"; do
|
||||||
if [ -n "${HOMEBREW_NO_INSTALL_FROM_API:-}" ]; then
|
if [ -e "$repo" ]; then
|
||||||
repos+=("${core_repo:?}")
|
|
||||||
fi
|
|
||||||
for repo in "${repos[@]}"; do
|
|
||||||
if [ -d "$repo" ]; then
|
|
||||||
git_retry -C "$repo" fetch origin main && git -C "$repo" reset --hard origin/main || return $?
|
git_retry -C "$repo" fetch origin main && git -C "$repo" reset --hard origin/main || return $?
|
||||||
fi
|
fi
|
||||||
done
|
done
|
||||||
@@ -333,7 +329,7 @@ setup_php() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
# Variables
|
# Variables
|
||||||
version=${1:-'8.6'}
|
version=${1:-'8.5'}
|
||||||
ini=${2:-'production'}
|
ini=${2:-'production'}
|
||||||
src=${0%/*}/..
|
src=${0%/*}/..
|
||||||
php_formula=shivammathur/php/php@"$version"
|
php_formula=shivammathur/php/php@"$version"
|
||||||
@@ -345,6 +341,7 @@ export HOMEBREW_NO_AUTO_UPDATE=1
|
|||||||
export HOMEBREW_NO_ENV_HINTS=1
|
export HOMEBREW_NO_ENV_HINTS=1
|
||||||
export HOMEBREW_NO_INSTALL_CLEANUP=1
|
export HOMEBREW_NO_INSTALL_CLEANUP=1
|
||||||
export HOMEBREW_NO_INSTALLED_DEPENDENTS_CHECK=1
|
export HOMEBREW_NO_INSTALLED_DEPENDENTS_CHECK=1
|
||||||
|
export HOMEBREW_NO_INSTALL_FROM_API=1
|
||||||
|
|
||||||
# shellcheck source=.
|
# shellcheck source=.
|
||||||
. "${scripts:?}"/unix.sh
|
. "${scripts:?}"/unix.sh
|
||||||
|
|||||||
@@ -104,7 +104,6 @@ Function Add-Extension {
|
|||||||
[string]
|
[string]
|
||||||
$extension_version = ''
|
$extension_version = ''
|
||||||
)
|
)
|
||||||
$minimum_stability_requested = $PSBoundParameters.ContainsKey('stability') -and $extension_version -eq ''
|
|
||||||
$extension_backup = ''
|
$extension_backup = ''
|
||||||
$restore_startup_errors = $false
|
$restore_startup_errors = $false
|
||||||
try {
|
try {
|
||||||
@@ -116,7 +115,7 @@ Function Add-Extension {
|
|||||||
$extension_info = Get-PhpExtension -Path $php_dir | Where-Object { $_.Name -eq $extension -or $_.Handle -eq $extension }
|
$extension_info = Get-PhpExtension -Path $php_dir | Where-Object { $_.Name -eq $extension -or $_.Handle -eq $extension }
|
||||||
}
|
}
|
||||||
# Only suppress startup errors while probing a cached DLL or replacing an installed DLL.
|
# Only suppress startup errors while probing a cached DLL or replacing an installed DLL.
|
||||||
if($cached -or (($minimum_stability_requested -or ($extension_version -ne '' -and $extension_info.Version -ne $extension_version)) -and (Test-Path "$ext_dir\php_$extension.dll"))) {
|
if($cached -or ($extension_version -ne '' -and $extension_info.Version -ne $extension_version -and (Test-Path "$ext_dir\php_$extension.dll"))) {
|
||||||
$startup_errors = Get-PhpIniKey -Key display_startup_errors -Path "$php_dir\php.ini"
|
$startup_errors = Get-PhpIniKey -Key display_startup_errors -Path "$php_dir\php.ini"
|
||||||
if($startup_errors -notmatch '^(0|off|false|no)$') {
|
if($startup_errors -notmatch '^(0|off|false|no)$') {
|
||||||
$restore_startup_errors = $true
|
$restore_startup_errors = $true
|
||||||
@@ -148,7 +147,7 @@ Function Add-Extension {
|
|||||||
Remove-Item "$ext_dir\php_$extension.dll" -Force
|
Remove-Item "$ext_dir\php_$extension.dll" -Force
|
||||||
$extension_info = $null
|
$extension_info = $null
|
||||||
}
|
}
|
||||||
if ($null -ne $extension_info -and ($extension_info.State -eq 'Builtin' -or (-not $minimum_stability_requested -and ($extension_version -eq '' -or $extension_info.Version -eq $extension_version)))) {
|
if ($null -ne $extension_info -and ($extension_version -eq '' -or $extension_info.Version -eq $extension_version)) {
|
||||||
switch ($extension_info.State) {
|
switch ($extension_info.State) {
|
||||||
'Builtin' {
|
'Builtin' {
|
||||||
Add-Log $tick $extension "Enabled"
|
Add-Log $tick $extension "Enabled"
|
||||||
@@ -170,9 +169,8 @@ Function Add-Extension {
|
|||||||
if ($version -match '8.[1-4]' -and $stability -eq 'stable') {
|
if ($version -match '8.[1-4]' -and $stability -eq 'stable') {
|
||||||
$minimumStability = 'snapshot'
|
$minimumStability = 'snapshot'
|
||||||
}
|
}
|
||||||
$maximumStability = if ($extension_version -eq '') { 'stable' } else { $stability }
|
|
||||||
|
|
||||||
$params = @{ Extension = $extension; MinimumStability = $minimumStability; MaximumStability = $maximumStability; Path = $php_dir; AdditionalFilesPath = $deps_dir; NoDependencies = $true }
|
$params = @{ Extension = $extension; MinimumStability = $minimumStability; MaximumStability = $stability; Path = $php_dir; AdditionalFilesPath = $deps_dir; NoDependencies = $true }
|
||||||
if ($extension_version -ne '')
|
if ($extension_version -ne '')
|
||||||
{
|
{
|
||||||
$params["Version"] = $extension_version
|
$params["Version"] = $extension_version
|
||||||
|
|||||||
@@ -165,27 +165,19 @@ add_extension() {
|
|||||||
# Function to get the PECL version of an extension.
|
# Function to get the PECL version of an extension.
|
||||||
get_pecl_version() {
|
get_pecl_version() {
|
||||||
local extension=$1
|
local extension=$1
|
||||||
local requested=${2:-stable}
|
states=("stable" "rc" "preview" "beta" "alpha" "snapshot")
|
||||||
local states=("stable" "rc" "preview" "beta" "alpha" "devel" "snapshot")
|
stability="$(echo "$2" | grep -m 1 -Eio "($(IFS='|' ; echo "${states[*]}"))")"
|
||||||
local stability major_version response pecl_version pattern
|
IFS=' ' read -r -a states <<< "$(echo "${states[@]}" | grep -Eo "$stability.*")"
|
||||||
response=$(get -s -n "" "https://pecl.php.net/rest/r/$extension/allreleases.xml")
|
|
||||||
if [[ "$requested" =~ ^[0-9] ]]; then
|
|
||||||
# Preserve exact pins and PECL's case-sensitive archive directory names.
|
|
||||||
pecl_version=$(echo "$response" | grep -Fio "<v>$requested</v>" | head -n 1 | cut -d '>' -f 2 | cut -d '<' -f 1)
|
|
||||||
echo "${pecl_version:-$requested}"
|
|
||||||
return
|
|
||||||
fi
|
|
||||||
requested="$(echo "$requested" | tr '[:upper:]' '[:lower:]')"
|
|
||||||
[[ " ${states[*]} " = *" $requested "* ]] || return 0
|
|
||||||
IFS=' ' read -r -a states <<< "$(echo "${states[@]}" | grep -Eo ".*$requested")"
|
|
||||||
stability="$(IFS='|' ; echo "${states[*]}")"
|
|
||||||
major_version=${3:-'[0-9]+'}
|
major_version=${3:-'[0-9]+'}
|
||||||
pattern="v>($major_version\.[0-9]+(\.[0-9]+)?)[^<]*</v>[[:space:]]*<s>($stability)<"
|
pecl_rest='https://pecl.php.net/rest/r/'
|
||||||
if [[ "$requested" = rc || "$requested" = preview ]]; then
|
response=$(get -s -n "" "$pecl_rest$extension"/allreleases.xml)
|
||||||
pattern="$pattern|v>($major_version\.[0-9]+(\.[0-9]+)?)($stability)[0-9]*<"
|
for state in "${states[@]}"; do
|
||||||
fi
|
pecl_version=$(echo "$response" | grep -m 1 -Eio "($major_version\.[0-9]+\.[0-9]+${state}[0-9]+<)" | cut -d '<' -f 1)
|
||||||
# PECL orders releases by version, so select the first acceptable state.
|
[ -z "$pecl_version" ] && pecl_version=$(echo "$response" | grep -m 1 -Eio "v>(.*)<\/v>.*$state<" | grep -m 1 -Eo "($major_version\.[0-9]+\.[0-9]+.*)<" | cut -d '<' -f 1)
|
||||||
echo "$response" | grep -Eio "$pattern" | head -n 1 | cut -d '>' -f 2 | cut -d '<' -f 1
|
[ -n "$pecl_version" ] && break;
|
||||||
|
done
|
||||||
|
[ -z "$pecl_version" ] && pecl_version=$(echo "$response" | grep -m 1 -Eo "($major_version\.[0-9]+\.[0-9]+)<" | cut -d '<' -f 1)
|
||||||
|
echo "$pecl_version"
|
||||||
}
|
}
|
||||||
|
|
||||||
# Function to install PECL extensions and accept default options
|
# Function to install PECL extensions and accept default options
|
||||||
@@ -198,10 +190,7 @@ pecl_install() {
|
|||||||
# Install using the source interface as it allows for patching.
|
# Install using the source interface as it allows for patching.
|
||||||
if [[ $(printf "%s\n%s" "${version:?}" "8.3" | sort -V | head -n1) != "$version" ]]; then
|
if [[ $(printf "%s\n%s" "${version:?}" "8.3" | sort -V | head -n1) != "$version" ]]; then
|
||||||
extension_version=${extension##*-};
|
extension_version=${extension##*-};
|
||||||
if [ "$extension_version" = "${extension%-*}" ]; then
|
[ "$extension_version" = "${extension%-*}" ] && extension_version=$(get_pecl_version "$extension" "stable")
|
||||||
extension_version=$(get_pecl_version "$extension" "stable")
|
|
||||||
[ -n "$extension_version" ] || return 1
|
|
||||||
fi
|
|
||||||
add_extension_from_source "${extension%-*}" https://pecl.php.net "${extension%-*}" "${extension%-*}" "$extension_version" "$prefix" pecl
|
add_extension_from_source "${extension%-*}" https://pecl.php.net "${extension%-*}" "${extension%-*}" "$extension_version" "$prefix" pecl
|
||||||
check_extension "${extension%-*}" && return 0 || return 1;
|
check_extension "${extension%-*}" && return 0 || return 1;
|
||||||
else
|
else
|
||||||
@@ -228,7 +217,7 @@ add_pecl_extension() {
|
|||||||
local extension=$1
|
local extension=$1
|
||||||
local pecl_version=$2
|
local pecl_version=$2
|
||||||
local prefix=$3
|
local prefix=$3
|
||||||
if [[ $pecl_version =~ (alpha|beta|rc|snapshot|preview|devel) ]]; then
|
if [[ $pecl_version =~ .*(alpha|beta|rc|snapshot|preview).* ]]; then
|
||||||
pecl_version=$(get_pecl_version "$extension" "$pecl_version")
|
pecl_version=$(get_pecl_version "$extension" "$pecl_version")
|
||||||
fi
|
fi
|
||||||
# Cache versioned extensions using suffixless copies in extension_dir.
|
# Cache versioned extensions using suffixless copies in extension_dir.
|
||||||
@@ -245,21 +234,12 @@ add_pecl_extension() {
|
|||||||
[ -n "$pecl_version" ] && sudo rm -f "${ext_dir:?}/$extension-$pecl_version"
|
[ -n "$pecl_version" ] && sudo rm -f "${ext_dir:?}/$extension-$pecl_version"
|
||||||
[ -n "$pecl_version" ] && pecl_version="-$pecl_version"
|
[ -n "$pecl_version" ] && pecl_version="-$pecl_version"
|
||||||
pecl_install "$extension$pecl_version" || ( [ "${fail_fast:?}" = "false" ] && add_extension "$extension" "$(get_extension_prefix "$extension")" >/dev/null 2>&1)
|
pecl_install "$extension$pecl_version" || ( [ "${fail_fast:?}" = "false" ] && add_extension "$extension" "$(get_extension_prefix "$extension")" >/dev/null 2>&1)
|
||||||
if ! extension_version="$(php -d display_errors=0 -d display_startup_errors=0 -r "echo phpversion('$extension'); exit(extension_loaded('$extension') ? 0 : 1);" 2>/dev/null)"; then
|
extension_version="$(php -r "echo phpversion('$extension');")"
|
||||||
add_log "${cross:?}" "$extension" "Could not install $extension on PHP ${semver:?}"
|
|
||||||
return
|
|
||||||
fi
|
|
||||||
if [ -n "$pecl_version" ] && [ "${extension_version/-/}" != "${pecl_version#-}" ]; then
|
|
||||||
[ "${fail_fast:?}" = "true" ] && add_log "${cross:?}" "$extension-$extension_version" "Installed and enabled, but $extension$pecl_version was requested"
|
|
||||||
add_log "!" "$extension-$extension_version" "Installed and enabled, but $extension$pecl_version was requested"
|
|
||||||
echo "::warning::Installed $extension-$extension_version, but $extension$pecl_version was requested"
|
|
||||||
return
|
|
||||||
fi
|
|
||||||
if [ -n "$pecl_version" ] && [ "${extension_version/-/}" = "${pecl_version#-}" ]; then
|
if [ -n "$pecl_version" ] && [ "${extension_version/-/}" = "${pecl_version#-}" ]; then
|
||||||
sudo cp "${ext_dir:?}/$extension.so" "${ext_dir:?}/$extension$pecl_version" 2>/dev/null || true
|
sudo cp "${ext_dir:?}/$extension.so" "${ext_dir:?}/$extension-$extension_version" 2>/dev/null || true
|
||||||
fi
|
fi
|
||||||
[ -n "$extension_version" ] && extension_version="-$extension_version"
|
[ -n "$extension_version" ] && extension_version="-$extension_version"
|
||||||
add_log "${tick:?}" "$extension$extension_version" "Installed and enabled"
|
add_extension_log "$extension$extension_version" "Installed and enabled"
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -269,10 +249,6 @@ add_unstable_extension() {
|
|||||||
local stability=$2
|
local stability=$2
|
||||||
local prefix=$3
|
local prefix=$3
|
||||||
pecl_version=$(get_pecl_version "$extension" "$stability")
|
pecl_version=$(get_pecl_version "$extension" "$stability")
|
||||||
if [ -z "$pecl_version" ]; then
|
|
||||||
add_log "${cross:?}" "$extension-$stability" "No release found with minimum stability $stability"
|
|
||||||
return
|
|
||||||
fi
|
|
||||||
add_pecl_extension "$extension" "$pecl_version" "$prefix"
|
add_pecl_extension "$extension" "$pecl_version" "$prefix"
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -31,7 +31,7 @@ add_cubrid_helper() {
|
|||||||
set_cubrid_repo
|
set_cubrid_repo
|
||||||
set_cubrid_branch
|
set_cubrid_branch
|
||||||
patch_phpize
|
patch_phpize
|
||||||
read -r "${ext}_CONFIGURE_PREFIX_OPTS" <<< "SED=sed CMAKE_POLICY_VERSION_MINIMUM=3.5 CFLAGS=-std=gnu17"
|
read -r "${ext}_PREFIX_CONFIGURE_OPTS" <<< "CFLAGS=-Wno-implicit-function-declaration"
|
||||||
read -r "${ext}_CONFIGURE_OPTS" <<< "--with-php-config=$(command -v php-config)"
|
read -r "${ext}_CONFIGURE_OPTS" <<< "--with-php-config=$(command -v php-config)"
|
||||||
add_extension_from_source "$ext" https://github.com CUBRID "$cubrid_repo" "$cubrid_branch" extension
|
add_extension_from_source "$ext" https://github.com CUBRID "$cubrid_repo" "$cubrid_branch" extension
|
||||||
restore_phpize
|
restore_phpize
|
||||||
|
|||||||
@@ -75,7 +75,7 @@ add_http_latest() {
|
|||||||
if [ "$os" = "Linux" ]; then
|
if [ "$os" = "Linux" ]; then
|
||||||
add_http_dependencies
|
add_http_dependencies
|
||||||
package="php$version-http"
|
package="php$version-http"
|
||||||
add_ppa >/dev/null 2>&1
|
add_ppa ondrej/php >/dev/null 2>&1 || update_ppa ondrej/php
|
||||||
(check_package "$package" && install_packages "$package") || add_http_helper "$(get_http_version)" "$os"
|
(check_package "$package" && install_packages "$package") || add_http_helper "$(get_http_version)" "$os"
|
||||||
else
|
else
|
||||||
if ! [[ "${version:?}" =~ ${old_versions:?} ]]; then
|
if ! [[ "${version:?}" =~ ${old_versions:?} ]]; then
|
||||||
|
|||||||
@@ -51,32 +51,6 @@ Function Get-Oci8DLL() {
|
|||||||
return $null
|
return $null
|
||||||
}
|
}
|
||||||
|
|
||||||
# Function to restore OCI DLLs missing from a cached PHP build.
|
|
||||||
Function Add-BundledOci() {
|
|
||||||
$bundleVersion = $installed.FullVersion
|
|
||||||
# PHP 8.2.34 is the last Windows PHP 8.2 release containing the OCI DLLs.
|
|
||||||
if($version -eq '8.2' -and [version]$installed.Version -gt [version]'8.2.34') {
|
|
||||||
$bundleVersion = '8.2.34'
|
|
||||||
}
|
|
||||||
$threadSafety = if($ts) { '' } else { '-nts' }
|
|
||||||
$compiler = if($installed.VCVersion -ge 16) { 'vs' } elseif($version -eq '7.4') { 'vc' } else { 'VC' }
|
|
||||||
$asset = "php-$bundleVersion$threadSafety-Win32-$compiler$($installed.VCVersion)-$arch.zip"
|
|
||||||
$bundleDir = Join-Path ([IO.Path]::GetTempPath()) ([Guid]::NewGuid().ToString())
|
|
||||||
New-Item -ItemType Directory -Path $bundleDir > $null
|
|
||||||
try {
|
|
||||||
Get-File -Url "$php_windows/releases/$asset" -FallbackUrl "$php_windows/releases/archives/$asset" -OutFile "$bundleDir\php.zip"
|
|
||||||
Expand-Archive -Path "$bundleDir\php.zip" -DestinationPath $bundleDir -Force
|
|
||||||
Get-ChildItem "$bundleDir\ext\php_*oci*.dll" | ForEach-Object {
|
|
||||||
$dll = Get-PhpExtension -Path $_.FullName
|
|
||||||
if($dll.PhpVersion -eq $version -and $dll.Architecture -eq $arch -and $dll.ThreadSafe -eq $ts) {
|
|
||||||
Copy-Item $_.FullName $ext_dir -Force
|
|
||||||
}
|
|
||||||
}
|
|
||||||
} finally {
|
|
||||||
Remove-Item $bundleDir -Recurse -Force
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
# Function to install oci8 and pdo_oci.
|
# Function to install oci8 and pdo_oci.
|
||||||
Function Add-Oci() {
|
Function Add-Oci() {
|
||||||
Param (
|
Param (
|
||||||
@@ -89,10 +63,7 @@ Function Add-Oci() {
|
|||||||
try {
|
try {
|
||||||
$status = 'Enabled'
|
$status = 'Enabled'
|
||||||
Add-InstantClient
|
Add-InstantClient
|
||||||
if($version -lt '8.3') {
|
if($version -lt '8.4') {
|
||||||
if(-not(Get-ChildItem "$ext_dir\php_$extension*.dll")) {
|
|
||||||
Add-BundledOci
|
|
||||||
}
|
|
||||||
if($version -lt '5.6' -and $extension -eq 'oci8') {
|
if($version -lt '5.6' -and $extension -eq 'oci8') {
|
||||||
Add-Content -Value "`r`nextension=php_oci8.dll" -Path $php_dir\php.ini
|
Add-Content -Value "`r`nextension=php_oci8.dll" -Path $php_dir\php.ini
|
||||||
} else {
|
} else {
|
||||||
|
|||||||
@@ -1,11 +0,0 @@
|
|||||||
patch_pdo_cubrid() {
|
|
||||||
if [[ ${version:?} =~ ^7\.[0-2]$ ]] && [ -f cubrid_driver7.c ]; then
|
|
||||||
# Match the PHP 7 PDO callbacks and store zvals with the PHP 7 hash API.
|
|
||||||
sed -i.bak \
|
|
||||||
-e 's/const char \*sql, long sql_len/const char *sql, size_t sql_len/g' \
|
|
||||||
-e 's/static long cubrid_handle_doer/static zend_long cubrid_handle_doer/' \
|
|
||||||
-e 's/zend_hash_index_update_ptr(HASH_OF(arg), index, (void \*)\&tmp_zval)/zend_hash_index_update(HASH_OF(arg), index, \&tmp_zval)/' \
|
|
||||||
-e 's/(cubrid_retval = zend_hash_update(HASH_OF(arg), key, (void \*) \&tmp_zval)) == FAILURE/zend_hash_str_update(HASH_OF(arg), key, strlen(key), \&tmp_zval) == NULL/' \
|
|
||||||
cubrid_driver7.c
|
|
||||||
fi
|
|
||||||
}
|
|
||||||
@@ -36,7 +36,7 @@ add_phalcon_helper() {
|
|||||||
add_brew_extension "$extension" extension
|
add_brew_extension "$extension" extension
|
||||||
else
|
else
|
||||||
package="php${version:?}-$extension"
|
package="php${version:?}-$extension"
|
||||||
add_ppa >/dev/null 2>&1
|
add_ppa ondrej/php >/dev/null 2>&1 || update_ppa ondrej/php
|
||||||
[[ "$extension" =~ phalcon[4|5] ]] && (install_packages "php${version:?}-psr" || pecl_install psr || pecl_install psr-1.1.0)
|
[[ "$extension" =~ phalcon[4|5] ]] && (install_packages "php${version:?}-psr" || pecl_install psr || pecl_install psr-1.1.0)
|
||||||
(check_package "$package" && install_packages "$package") || pecl_install phalcon-"$(get_phalcon_version)" || add_phalcon_from_repo
|
(check_package "$package" && install_packages "$package") || pecl_install phalcon-"$(get_phalcon_version)" || add_phalcon_from_repo
|
||||||
fi
|
fi
|
||||||
|
|||||||
@@ -35,16 +35,12 @@ get_openssl_suffix() {
|
|||||||
# Change library paths in relay binary.
|
# Change library paths in relay binary.
|
||||||
change_library_paths() {
|
change_library_paths() {
|
||||||
if [ "$os" = "Darwin" ]; then
|
if [ "$os" = "Darwin" ]; then
|
||||||
dylibs="$(otool -L "${ext_dir:?}"/relay.so | grep -Eo '.*\.dylib' | cut -f1 -d ' ')"
|
otool -L "${ext_dir:?}"/relay.so | grep -q 'ssl.3.' && openssl_version='3' || openssl_version='1.1'
|
||||||
openssl_version="$(echo "$dylibs" | sed -nE 's|.*libssl\.([0-9.]+)\.dylib$|\1|p' | head -n 1)"
|
|
||||||
if [ -z "$openssl_version" ]; then
|
|
||||||
openssl_version="$(echo "$dylibs" | sed -nE 's|.*/openssl@([0-9.]+)/lib/libssl\.dylib$|\1|p' | head -n 1)"
|
|
||||||
fi
|
|
||||||
openssl_version="${openssl_version:-1.1}"
|
|
||||||
[ -e "${brew_prefix:?}"/opt/openssl@"$openssl_version" ] || {
|
[ -e "${brew_prefix:?}"/opt/openssl@"$openssl_version" ] || {
|
||||||
safe_brew install --skip-link openssl@"$openssl_version" &&
|
safe_brew install --skip-link openssl@"$openssl_version" &&
|
||||||
brew link --overwrite --force openssl@"$openssl_version"
|
brew link --overwrite --force openssl@"$openssl_version"
|
||||||
}
|
}
|
||||||
|
dylibs="$(otool -L "${ext_dir:?}"/relay.so | grep -Eo '.*\.dylib' | cut -f1 -d ' ')"
|
||||||
install_name_tool -change "$(echo "${dylibs}" | grep -E "libzstd.*dylib" | xargs)" "$brew_prefix"/opt/zstd/lib/libzstd.dylib "$ext_dir"/relay.so
|
install_name_tool -change "$(echo "${dylibs}" | grep -E "libzstd.*dylib" | xargs)" "$brew_prefix"/opt/zstd/lib/libzstd.dylib "$ext_dir"/relay.so
|
||||||
install_name_tool -change "$(echo "${dylibs}" | grep -E "liblz4.*dylib" | xargs)" "$brew_prefix"/opt/lz4/lib/liblz4.dylib "$ext_dir"/relay.so
|
install_name_tool -change "$(echo "${dylibs}" | grep -E "liblz4.*dylib" | xargs)" "$brew_prefix"/opt/lz4/lib/liblz4.dylib "$ext_dir"/relay.so
|
||||||
install_name_tool -change "$(echo "${dylibs}" | grep -E "libssl.*dylib" | xargs)" "$brew_prefix"/opt/openssl@"$openssl_version"/lib/libssl.dylib "$ext_dir"/relay.so
|
install_name_tool -change "$(echo "${dylibs}" | grep -E "libssl.*dylib" | xargs)" "$brew_prefix"/opt/openssl@"$openssl_version"/lib/libssl.dylib "$ext_dir"/relay.so
|
||||||
@@ -134,9 +130,7 @@ add_relay_helper() {
|
|||||||
fi
|
fi
|
||||||
if [ -e /tmp/relay.tar.gz ] && file /tmp/relay.tar.gz | grep -q 'gzip'; then
|
if [ -e /tmp/relay.tar.gz ] && file /tmp/relay.tar.gz | grep -q 'gzip'; then
|
||||||
sudo tar --strip-components=1 -xzf /tmp/relay.tar.gz -C "${ext_dir:?}"
|
sudo tar --strip-components=1 -xzf /tmp/relay.tar.gz -C "${ext_dir:?}"
|
||||||
if [ -e "${ext_dir:?}"/relay-pkg.so ]; then
|
sudo mv "${ext_dir:?}"/relay-pkg.so "${ext_dir:?}"/relay.so
|
||||||
sudo mv "${ext_dir:?}"/relay-pkg.so "${ext_dir:?}"/relay.so
|
|
||||||
fi
|
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -122,31 +122,25 @@ patch_extension() {
|
|||||||
fetch_extension() {
|
fetch_extension() {
|
||||||
local extension=$1
|
local extension=$1
|
||||||
local fetch=$2
|
local fetch=$2
|
||||||
local curl_opts=("${curl_opts[@]}" --retry 2)
|
|
||||||
if curl --help all 2>/dev/null | grep -- '--retry-all-errors' >/dev/null; then
|
|
||||||
curl_opts+=(--retry-all-errors)
|
|
||||||
fi
|
|
||||||
if [ "$fetch" = "clone" ]; then
|
if [ "$fetch" = "clone" ]; then
|
||||||
run_group "git clone -nv $url/$org/$repo /tmp/$repo-$release" "git clone"
|
run_group "git clone -nv $url/$org/$repo /tmp/$repo-$release" "git clone"
|
||||||
cd /tmp/"$repo-$release" || exit 1
|
cd /tmp/"$repo-$release" || exit 1
|
||||||
git checkout -q "$release"
|
git checkout -q "$release"
|
||||||
cd "${sub_dir:-.}" || exit 1
|
cd "$sub_dir" || exit 1
|
||||||
if [ -e .gitmodules ]; then
|
if [ -e .gitmodules ]; then
|
||||||
jobs="$(grep -c "\[submodule" .gitmodules)"
|
jobs="$(grep -c "\[submodule" .gitmodules)"
|
||||||
run_group "git submodule update --jobs $jobs --init --recursive" "git submodule"
|
run_group "git submodule update --jobs $jobs --init --recursive" "git submodule"
|
||||||
fi
|
fi
|
||||||
elif [ "$fetch" = "get" ]; then
|
elif [ "$fetch" = "get" ]; then
|
||||||
get -q -n /tmp/"$extension".tar.gz "$url/$org/$repo/archive/$release.tar.gz" || return 1
|
get -q -n /tmp/"$extension".tar.gz "$url/$org/$repo/archive/$release.tar.gz"
|
||||||
tar -tzf /tmp/"$extension".tar.gz >/dev/null 2>&1 || return 1
|
tar -xzf /tmp/"$extension".tar.gz -C /tmp
|
||||||
tar -xzf /tmp/"$extension".tar.gz -C /tmp || return 1
|
|
||||||
cd /tmp/"$repo"-"$release"/"$sub_dir" || exit
|
cd /tmp/"$repo"-"$release"/"$sub_dir" || exit
|
||||||
elif [ "$fetch" = "pecl" ]; then
|
elif [ "$fetch" = "pecl" ]; then
|
||||||
source="pecl"
|
source="pecl"
|
||||||
pecl_name=${extension/http/pecl_http}
|
pecl_name=${extension/http/pecl_http}
|
||||||
capital_pecl_name=$(echo "$pecl_name" | tr '[:lower:]' '[:upper:]')
|
capital_pecl_name=$(echo "$pecl_name" | tr '[:lower:]' '[:upper:]')
|
||||||
get -q -n /tmp/"$pecl_name".tgz https://pecl.php.net/get/"$pecl_name"-"$release".tgz https://pecl.php.net/get/"$capital_pecl_name"-"$release".tgz || return 1
|
get -q -n /tmp/"$pecl_name".tgz https://pecl.php.net/get/"$pecl_name"-"$release".tgz https://pecl.php.net/get/"$capital_pecl_name"-"$release".tgz
|
||||||
tar -tzf /tmp/"$pecl_name".tgz >/dev/null 2>&1 || return 1
|
tar -xzf /tmp/"$pecl_name".tgz -C /tmp
|
||||||
tar -xzf /tmp/"$pecl_name".tgz -C /tmp || return 1
|
|
||||||
cd /tmp/"$pecl_name"-"$release" 2>/dev/null || cd /tmp/"$capital_pecl_name"-"$release" 2>/dev/null || exit
|
cd /tmp/"$pecl_name"-"$release" 2>/dev/null || cd /tmp/"$capital_pecl_name"-"$release" 2>/dev/null || exit
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
@@ -171,7 +165,7 @@ add_extension_from_source() {
|
|||||||
(
|
(
|
||||||
add_devtools phpize >/dev/null 2>&1
|
add_devtools phpize >/dev/null 2>&1
|
||||||
disable_extension_helper "$extension"
|
disable_extension_helper "$extension"
|
||||||
fetch_extension "$extension" "$fetch" || exit 1
|
fetch_extension "$extension" "$fetch"
|
||||||
if ! [ "$(find . -maxdepth 1 -name '*.m4' -exec grep -H 'PHP_NEW_EXTENSION' {} \; | wc -l)" != "0" ]; then
|
if ! [ "$(find . -maxdepth 1 -name '*.m4' -exec grep -H 'PHP_NEW_EXTENSION' {} \; | wc -l)" != "0" ]; then
|
||||||
add_log "${cross:?}" "$source" "$source does not have a PHP extension"
|
add_log "${cross:?}" "$source" "$source does not have a PHP extension"
|
||||||
else
|
else
|
||||||
|
|||||||
+23
-38
@@ -6,31 +6,36 @@ add_sudo() {
|
|||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
# Function to select the package installer.
|
# Function to link apt-fast to apt-get
|
||||||
set_apt_install() {
|
link_apt_fast() {
|
||||||
local apt=apt-get
|
if ! command -v apt-fast >/dev/null; then
|
||||||
command -v apt-fast >/dev/null && apt=apt-fast
|
sudo ln -sf /usr/bin/apt-get /usr/bin/apt-fast
|
||||||
apt_install="sudo $debconf_fix $apt install -y --no-install-recommends -o Dpkg::Options::=--force-confnew"
|
trap "sudo rm -f /usr/bin/apt-fast 2>/dev/null" exit
|
||||||
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
# Function to setup environment for self-hosted runners.
|
# Function to setup environment for self-hosted runners.
|
||||||
self_hosted_helper() {
|
self_hosted_helper() {
|
||||||
sudo mkdir -p /opt/hostedtoolcache >/dev/null 2>&1 || true
|
if ! command -v apt-fast >/dev/null; then
|
||||||
local packages=()
|
sudo ln -sf /usr/bin/apt-get /usr/bin/apt-fast
|
||||||
mapfile -t packages < <(filter_packages apt-transport-https ca-certificates curl file make jq unzip autoconf automake gcc g++ gnupg)
|
trap "sudo rm -f /usr/bin/apt-fast 2>/dev/null" exit
|
||||||
if [ "${#packages[@]}" -gt 0 ]; then
|
|
||||||
install_packages "${packages[@]}"
|
|
||||||
fi
|
fi
|
||||||
|
sudo mkdir -p /opt/hostedtoolcache >/dev/null 2>&1 || true
|
||||||
|
install_packages apt-transport-https ca-certificates curl file make jq unzip autoconf automake gcc g++ gnupg
|
||||||
}
|
}
|
||||||
|
|
||||||
# Function to fix broken packages.
|
# Function to fix broken packages.
|
||||||
fix_broken_packages() {
|
fix_broken_packages() {
|
||||||
sudo apt --fix-broken install -o Dpkg::Options::=--force-confnew >/dev/null 2>&1
|
sudo apt --fix-broken install >/dev/null 2>&1
|
||||||
}
|
}
|
||||||
|
|
||||||
# Function to install a package
|
# Function to install a package
|
||||||
install_packages() {
|
install_packages() {
|
||||||
packages=("$@")
|
packages=("$@")
|
||||||
|
if ! [ -e /etc/dpkg/dpkg.cfg.d/force-confnew ]; then
|
||||||
|
echo "force-confnew" | sudo tee /etc/dpkg/dpkg.cfg.d/force-confnew >/dev/null 2>&1
|
||||||
|
trap "sudo rm -f /etc/dpkg/dpkg.cfg.d/force-confnew 2>/dev/null" exit
|
||||||
|
fi
|
||||||
$apt_install "${packages[@]}" >/dev/null 2>&1 || (update_lists && fix_broken_packages && $apt_install "${packages[@]}" >/dev/null 2>&1)
|
$apt_install "${packages[@]}" >/dev/null 2>&1 || (update_lists && fix_broken_packages && $apt_install "${packages[@]}" >/dev/null 2>&1)
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -85,26 +90,11 @@ check_package() {
|
|||||||
apt-cache policy "$1" 2>/dev/null | grep -q 'Candidate'
|
apt-cache policy "$1" 2>/dev/null | grep -q 'Candidate'
|
||||||
}
|
}
|
||||||
|
|
||||||
# Function to filter out installed packages
|
|
||||||
filter_packages() {
|
|
||||||
[ "$#" -gt 0 ] || return 0
|
|
||||||
local package architecture status
|
|
||||||
local -A installed=()
|
|
||||||
while IFS=$'\t' read -r package architecture status; do
|
|
||||||
[[ "$status" = [ih]'i ' ]] && status=1 || status=0
|
|
||||||
installed["$package"]=$(( ${installed["$package"]:-1} && status ))
|
|
||||||
installed["$package:$architecture"]=$status
|
|
||||||
done < <(dpkg-query -W -f='${Package}\t${Architecture}\t${db:Status-Abbrev}\n' -- "$@" 2>/dev/null)
|
|
||||||
for package in "$@"; do
|
|
||||||
[ "${installed[$package]:-0}" -eq 1 ] || printf '%s\n' "$package"
|
|
||||||
done
|
|
||||||
}
|
|
||||||
|
|
||||||
# Helper function to add an extension.
|
# Helper function to add an extension.
|
||||||
add_extension_helper() {
|
add_extension_helper() {
|
||||||
local extension=$1
|
local extension=$1
|
||||||
packages=(php"$version"-"$extension")
|
packages=(php"$version"-"$extension")
|
||||||
add_ppa >/dev/null 2>&1
|
add_ppa ondrej/php >/dev/null 2>&1 || update_ppa ondrej/php
|
||||||
[ "${debug:?}" = "debug" ] && check_package php"$version"-"$extension"-dbgsym && packages+=(php"$version"-"$extension"-dbgsym)
|
[ "${debug:?}" = "debug" ] && check_package php"$version"-"$extension"-dbgsym && packages+=(php"$version"-"$extension"-dbgsym)
|
||||||
(check_package "${packages[0]}" && install_packages "${packages[@]}") || pecl_install "$extension"
|
(check_package "${packages[0]}" && install_packages "${packages[@]}") || pecl_install "$extension"
|
||||||
add_extension_log "$extension" "Installed and enabled"
|
add_extension_log "$extension" "Installed and enabled"
|
||||||
@@ -124,11 +114,7 @@ add_devtools() {
|
|||||||
|
|
||||||
# Function to setup PHP from the shivammathur/php-builder builds.
|
# Function to setup PHP from the shivammathur/php-builder builds.
|
||||||
setup_php_builder() {
|
setup_php_builder() {
|
||||||
if [[ -n "${asan:-}" && "$version" =~ ${no_asan_builds:?} ]]; then
|
run_script "php-builder" "${runner:?}" "$version" "${debug:?}" "${ts:?}"
|
||||||
add_log "${cross:?}" "PHP" "ASAN is only supported for PHP 8.0+"
|
|
||||||
exit 1
|
|
||||||
fi
|
|
||||||
run_script "php-builder" "${runner:?}" "$version" "${debug:?}" "${ts:?}" "${asan:-}"
|
|
||||||
}
|
}
|
||||||
|
|
||||||
# Function to setup PHP 5.3, PHP 5.4 and PHP 5.5.
|
# Function to setup PHP 5.3, PHP 5.4 and PHP 5.5.
|
||||||
@@ -221,7 +207,7 @@ get_php_packages() {
|
|||||||
|
|
||||||
# Function to install packaged PHP
|
# Function to install packaged PHP
|
||||||
add_packaged_php() {
|
add_packaged_php() {
|
||||||
add_ppa >/dev/null 2>&1
|
add_ppa ondrej/php >/dev/null 2>&1 || update_ppa ondrej/php
|
||||||
IFS=' ' read -r -a packages <<<"$(get_php_packages)"
|
IFS=' ' read -r -a packages <<<"$(get_php_packages)"
|
||||||
install_packages "${packages[@]}"
|
install_packages "${packages[@]}"
|
||||||
}
|
}
|
||||||
@@ -241,9 +227,7 @@ update_php() {
|
|||||||
# Function to install PHP.
|
# Function to install PHP.
|
||||||
add_php() {
|
add_php() {
|
||||||
if [ "${runner:?}" = "self-hosted" ] || [ "${use_builds_cache:-true}" = "false" ]; then
|
if [ "${runner:?}" = "self-hosted" ] || [ "${use_builds_cache:-true}" = "false" ]; then
|
||||||
# Sury's Ubuntu archive does not publish the PHP CLI debug symbols.
|
if [[ "$version" =~ ${php_builder_versions:?} || "$ts" = "zts" ]]; then
|
||||||
if [[ "$version" =~ ${php_builder_versions:?} || "$ts" = "zts" || -n "${asan:-}" ||
|
|
||||||
( "$debug" = "debug" && "$ID $ID_LIKE" == *ubuntu* ) ]]; then
|
|
||||||
setup_php_builder
|
setup_php_builder
|
||||||
else
|
else
|
||||||
add_packaged_php
|
add_packaged_php
|
||||||
@@ -350,14 +334,15 @@ setup_php() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
# Variables
|
# Variables
|
||||||
version=${1:-'8.6'}
|
version=${1:-'8.5'}
|
||||||
ini=${2:-'production'}
|
ini=${2:-'production'}
|
||||||
src=${0%/*}/..
|
src=${0%/*}/..
|
||||||
debconf_fix="DEBIAN_FRONTEND=noninteractive"
|
debconf_fix="DEBIAN_FRONTEND=noninteractive"
|
||||||
|
apt_install="sudo $debconf_fix apt-fast install -y --no-install-recommends"
|
||||||
scripts="$src"/scripts
|
scripts="$src"/scripts
|
||||||
|
|
||||||
add_sudo >/dev/null 2>&1
|
add_sudo >/dev/null 2>&1
|
||||||
set_apt_install >/dev/null 2>&1
|
link_apt_fast >/dev/null 2>&1
|
||||||
|
|
||||||
. /etc/os-release
|
. /etc/os-release
|
||||||
# shellcheck source=.
|
# shellcheck source=.
|
||||||
|
|||||||
@@ -237,26 +237,6 @@ Function Add-ToolsHelper() {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
# Function to find the newest stable release containing a tool asset.
|
|
||||||
Function Get-LastRelease($url) {
|
|
||||||
$releases_url = $url.Split('/latest/download/')[0]
|
|
||||||
$asset = $url.Split('/')[-1]
|
|
||||||
$page = 1
|
|
||||||
do {
|
|
||||||
$releases = (Get-File -Url "${releases_url}?page=$page&q=prerelease%3Afalse").Content
|
|
||||||
foreach ($match in [regex]::Matches($releases, 'src="([^"]+/releases/expanded_assets/[^"]+)"')) {
|
|
||||||
$assets_url = $match.Groups[1].Value
|
|
||||||
if (-not $assets_url.StartsWith("$releases_url/expanded_assets/")) { continue }
|
|
||||||
$download_path = $assets_url.Substring('https://github.com'.Length).Replace('/expanded_assets/', '/download/') + "/$asset"
|
|
||||||
$assets = (Get-File -Url $assets_url).Content
|
|
||||||
if ($assets.Contains("href=`"$download_path`"")) {
|
|
||||||
return "https://github.com$download_path"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
$page++
|
|
||||||
} while ($releases.Contains('class="next_page"'))
|
|
||||||
}
|
|
||||||
|
|
||||||
# Function to add tools.
|
# Function to add tools.
|
||||||
Function Add-Tool() {
|
Function Add-Tool() {
|
||||||
Param (
|
Param (
|
||||||
@@ -304,22 +284,19 @@ Function Add-Tool() {
|
|||||||
} else {
|
} else {
|
||||||
$backup_path = "$tool_path.bak"
|
$backup_path = "$tool_path.bak"
|
||||||
if (Test-Path $tool_path) { Copy-Item $tool_path -Destination $backup_path -Force }
|
if (Test-Path $tool_path) { Copy-Item $tool_path -Destination $backup_path -Force }
|
||||||
$user_agent = "setup-php ($env:RUNNER_OS; $env:RUNNER_ARCH; +https://setup-php.com)"
|
|
||||||
foreach ($url in $urls){
|
foreach ($url in $urls){
|
||||||
try {
|
try {
|
||||||
$status_code = (Invoke-WebRequest -Passthru -Uri $url -UserAgent $user_agent -OutFile $tool_path).StatusCode
|
$status_code = (Invoke-WebRequest -Passthru -Uri $url -OutFile $tool_path).StatusCode
|
||||||
} catch {
|
} catch {
|
||||||
$status_code = 0
|
if($url -match '.*github.com.*releases.*latest.*') {
|
||||||
if($url -match '^https://github\.com/[^/]+/[^/]+/releases/latest/download/[^/?#]+$') {
|
|
||||||
try {
|
try {
|
||||||
$release_url = Get-LastRelease $url
|
$url = $url.replace("releases/latest/download", "releases/download/" + ([regex]::match((Get-File -Url ($url.split('/release')[0] + "/releases")).Content, "([0-9]+\.[0-9]+\.[0-9]+)/" + ($url.Substring($url.LastIndexOf("/") + 1))).Groups[0].Value).split('/')[0])
|
||||||
if ($release_url) {
|
$status_code = (Invoke-WebRequest -Passthru -Uri $url -OutFile $tool_path).StatusCode
|
||||||
$url = $release_url
|
|
||||||
$status_code = (Invoke-WebRequest -Passthru -Uri $url -UserAgent $user_agent -OutFile $tool_path).StatusCode
|
|
||||||
}
|
|
||||||
} catch {
|
} catch {
|
||||||
$status_code = 0
|
$status_code = 0
|
||||||
}
|
}
|
||||||
|
} else {
|
||||||
|
$status_code = 0
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if($status_code -eq 200 -and (Test-Path $tool_path)) {
|
if($status_code -eq 200 -and (Test-Path $tool_path)) {
|
||||||
@@ -398,33 +375,23 @@ Function Add-ComposerToolHelper() {
|
|||||||
composer global config --no-plugins allow-plugins."$prefix$tool" true >$null 2>&1
|
composer global config --no-plugins allow-plugins."$prefix$tool" true >$null 2>&1
|
||||||
}
|
}
|
||||||
composer global require $prefix$release $composer_args >$null 2>&1
|
composer global require $prefix$release $composer_args >$null 2>&1
|
||||||
if($LASTEXITCODE -ne 0) {
|
|
||||||
return
|
|
||||||
}
|
|
||||||
return composer global show $prefix$tool 2>&1 | findstr '^versions'
|
return composer global show $prefix$tool 2>&1 | findstr '^versions'
|
||||||
} else {
|
} else {
|
||||||
$release_stream = [System.IO.MemoryStream]::New([System.Text.Encoding]::ASCII.GetBytes($release))
|
$release_stream = [System.IO.MemoryStream]::New([System.Text.Encoding]::ASCII.GetBytes($release))
|
||||||
$scoped_dir_suffix = (Get-FileHash -InputStream $release_stream -Algorithm sha256).Hash
|
$scoped_dir_suffix = (Get-FileHash -InputStream $release_stream -Algorithm sha256).Hash
|
||||||
$scoped_dir = "$composer_bin\_tools\$tool-$scoped_dir_suffix"
|
$scoped_dir = "$composer_bin\_tools\$tool-$scoped_dir_suffix"
|
||||||
$unix_scoped_dir = $scoped_dir.replace('\', '/')
|
$unix_scoped_dir = $scoped_dir.replace('\', '/')
|
||||||
if(-not(Test-Path $scoped_dir\vendor\autoload.php)) {
|
if(-not(Test-Path $scoped_dir)) {
|
||||||
New-Item -ItemType Directory -Force -Path $scoped_dir > $null 2>&1
|
New-Item -ItemType Directory -Force -Path $scoped_dir > $null 2>&1
|
||||||
Set-Content -Path $scoped_dir\composer.json -Value "{}"
|
Set-Content -Path $scoped_dir\composer.json -Value "{}"
|
||||||
if((composer show $prefix$tool $tool_version -d $unix_scoped_dir -a 2>&1 | findstr '^type *: *composer-plugin') -and ($composer_args -ne '')) {
|
if((composer show $prefix$tool $tool_version -d $unix_scoped_dir -a 2>&1 | findstr '^type *: *composer-plugin') -and ($composer_args -ne '')) {
|
||||||
composer config -d $unix_scoped_dir --no-plugins allow-plugins."$prefix$tool" true >$null 2>&1
|
composer config -d $unix_scoped_dir --no-plugins allow-plugins."$prefix$tool" true >$null 2>&1
|
||||||
}
|
}
|
||||||
composer require $prefix$release -d $unix_scoped_dir $composer_args >$null 2>&1
|
composer require $prefix$release -d $unix_scoped_dir $composer_args >$null 2>&1
|
||||||
if($LASTEXITCODE -ne 0) {
|
|
||||||
return
|
|
||||||
}
|
|
||||||
}
|
|
||||||
$log = composer show $prefix$tool -d $unix_scoped_dir 2>&1 | findstr '^versions'
|
|
||||||
if(-not $log) {
|
|
||||||
return
|
|
||||||
}
|
}
|
||||||
[System.Environment]::SetEnvironmentVariable(($tool.replace('-', '_') + '_bin'), "$scoped_dir\vendor\bin")
|
[System.Environment]::SetEnvironmentVariable(($tool.replace('-', '_') + '_bin'), "$scoped_dir\vendor\bin")
|
||||||
Add-Path $scoped_dir\vendor\bin
|
Add-Path $scoped_dir\vendor\bin
|
||||||
return $log
|
return composer show $prefix$tool -d $unix_scoped_dir 2>&1 | findstr '^versions'
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -450,13 +417,7 @@ Function Add-ComposerTool() {
|
|||||||
[ValidateNotNull()]
|
[ValidateNotNull()]
|
||||||
[ValidateLength(1, [int]::MaxValue)]
|
[ValidateLength(1, [int]::MaxValue)]
|
||||||
[string]
|
[string]
|
||||||
$scope,
|
$scope
|
||||||
[Parameter(Position = 4, Mandatory = $false)]
|
|
||||||
[string]
|
|
||||||
$fallback_url,
|
|
||||||
[Parameter(Position = 5, Mandatory = $false)]
|
|
||||||
[string]
|
|
||||||
$fallback_version_parameter
|
|
||||||
)
|
)
|
||||||
$composer_args = ""
|
$composer_args = ""
|
||||||
if($composer_version.split('.')[0] -ne "1") {
|
if($composer_version.split('.')[0] -ne "1") {
|
||||||
@@ -472,13 +433,10 @@ Function Add-ComposerTool() {
|
|||||||
if(Test-Path $composer_bin\composer) {
|
if(Test-Path $composer_bin\composer) {
|
||||||
Copy-Item -Path "$bin_dir\composer" -Destination "$composer_bin\composer" -Force
|
Copy-Item -Path "$bin_dir\composer" -Destination "$composer_bin\composer" -Force
|
||||||
}
|
}
|
||||||
|
Add-ToolsHelper $tool
|
||||||
if($log) {
|
if($log) {
|
||||||
$tool_version = Get-ToolVersion "Write-Output" "$log"
|
$tool_version = Get-ToolVersion "Write-Output" "$log"
|
||||||
Add-ToolsHelper $tool
|
|
||||||
Add-Log $tick $tool "Added $tool $tool_version"
|
Add-Log $tick $tool "Added $tool $tool_version"
|
||||||
} elseif($fallback_url) {
|
|
||||||
Add-Log "!" $tool "Could not setup $tool using Composer. Falling back to PHAR."
|
|
||||||
Add-Tool $fallback_url $tool $fallback_version_parameter
|
|
||||||
} else {
|
} else {
|
||||||
Add-Log $cross $tool "Could not setup $tool"
|
Add-Log $cross $tool "Could not setup $tool"
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -203,33 +203,6 @@ add_tools_helper() {
|
|||||||
done
|
done
|
||||||
}
|
}
|
||||||
|
|
||||||
# Function to find the newest stable release containing a tool asset.
|
|
||||||
get_last_release() {
|
|
||||||
local releases_url="${1%/latest/download/*}"
|
|
||||||
local asset="${1##*/}"
|
|
||||||
local page=1 releases assets_url tag download_path
|
|
||||||
while true; do
|
|
||||||
releases=$(get -s -n "" "$releases_url?page=$page&q=prerelease%3Afalse") || return 1
|
|
||||||
while IFS= read -r assets_url; do
|
|
||||||
[[ "$assets_url" = "$releases_url/expanded_assets/"* ]] || continue
|
|
||||||
tag="${assets_url#"$releases_url/expanded_assets/"}"
|
|
||||||
download_path="${releases_url#https://github.com}/download/$tag/$asset"
|
|
||||||
if get -s -n "" "$assets_url" | grep -Fq "href=\"$download_path\""; then
|
|
||||||
printf 'https://github.com%s\n' "$download_path"
|
|
||||||
return 0
|
|
||||||
fi
|
|
||||||
done <<< "$(printf '%s' "$releases" | grep -Eo 'src="[^"]+/releases/expanded_assets/[^"]+"' | cut -d '"' -f 2)"
|
|
||||||
[[ "$releases" = *'class="next_page"'* ]] || return 1
|
|
||||||
page=$((page + 1))
|
|
||||||
done
|
|
||||||
}
|
|
||||||
|
|
||||||
# Download a tool with the setup-php user agent.
|
|
||||||
download_tool() {
|
|
||||||
local curl_opts=("${curl_opts[@]}" -A "setup-php ($RUNNER_OS; $RUNNER_ARCH; +https://setup-php.com)")
|
|
||||||
get -v -e "$@"
|
|
||||||
}
|
|
||||||
|
|
||||||
# Function to setup a remote tool.
|
# Function to setup a remote tool.
|
||||||
add_tool() {
|
add_tool() {
|
||||||
url=$1
|
url=$1
|
||||||
@@ -269,16 +242,10 @@ add_tool() {
|
|||||||
fi
|
fi
|
||||||
else
|
else
|
||||||
[ -f "$tool_path" ] && sudo cp -a "$tool_path" "$tool_path.bak"
|
[ -f "$tool_path" ] && sudo cp -a "$tool_path" "$tool_path.bak"
|
||||||
# Tools are single files, so let servers gzip them in transit when curl can decode it.
|
status_code=$(get -v -e "$tool_path" "${url[@]}")
|
||||||
local curl_opts=("${curl_opts[@]}")
|
if [ "$status_code" != "200" ] && [[ "${url[0]}" =~ .*github.com.*releases.*latest.* ]]; then
|
||||||
curl -V | grep -qw libz && curl_opts+=(--compressed)
|
url[0]="${url[0]//releases\/latest\/download/releases/download/$(get -s -n "" "$(echo "${url[0]}" | cut -d '/' -f '1-5')/releases" | grep -Eo -m 1 "([0-9]+\.[0-9]+\.[0-9]+)/$(echo "${url[0]}" | sed -e "s/.*\///")" | cut -d '/' -f 1)}"
|
||||||
status_code=$(download_tool "$tool_path" "${url[@]}")
|
status_code=$(get -v -e "$tool_path" "${url[0]}")
|
||||||
if [ "$status_code" != "200" ] && [[ "${url[0]}" =~ ^https://github\.com/[^/]+/[^/]+/releases/latest/download/[^/?#]+$ ]]; then
|
|
||||||
local release_url
|
|
||||||
if release_url=$(get_last_release "${url[0]}"); then
|
|
||||||
url[0]="$release_url"
|
|
||||||
status_code=$(download_tool "$tool_path" "${url[0]}")
|
|
||||||
fi
|
|
||||||
fi
|
fi
|
||||||
if [ "$status_code" = "200" ]; then
|
if [ "$status_code" = "200" ]; then
|
||||||
if [ -n "$checksum" ] && ! verify_checksum "$tool_path" "$checksum"; then
|
if [ -n "$checksum" ] && ! verify_checksum "$tool_path" "$checksum"; then
|
||||||
@@ -288,12 +255,8 @@ add_tool() {
|
|||||||
sudo cp -a "$tool_path" "$cache_path"
|
sudo cp -a "$tool_path" "$cache_path"
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
if [ "$status_code" != "200" ]; then
|
if [ "$status_code" != "200" ] && [ -f "$tool_path.bak" ]; then
|
||||||
if [ -f "$tool_path.bak" ]; then
|
sudo mv "$tool_path.bak" "$tool_path"
|
||||||
sudo mv "$tool_path.bak" "$tool_path"
|
|
||||||
else
|
|
||||||
sudo rm -f "$tool_path"
|
|
||||||
fi
|
|
||||||
fi
|
fi
|
||||||
sudo rm -f "$tool_path.bak"
|
sudo rm -f "$tool_path.bak"
|
||||||
fi
|
fi
|
||||||
@@ -330,20 +293,19 @@ add_composer_tool_helper() {
|
|||||||
if composer global show "$prefix$tool" "$tool_version" -a 2>&1 | grep -qE '^type *: *composer-plugin' && [ -n "$composer_args" ]; then
|
if composer global show "$prefix$tool" "$tool_version" -a 2>&1 | grep -qE '^type *: *composer-plugin' && [ -n "$composer_args" ]; then
|
||||||
composer global config --no-plugins allow-plugins."$prefix$tool" true >/dev/null 2>&1
|
composer global config --no-plugins allow-plugins."$prefix$tool" true >/dev/null 2>&1
|
||||||
fi
|
fi
|
||||||
composer global require "$prefix$release" "$composer_args" >/dev/null 2>&1 || return 1
|
composer global require "$prefix$release" "$composer_args" >/dev/null 2>&1
|
||||||
composer global show "$prefix$tool" 2>&1 | grep -E ^versions | sudo tee /tmp/composer.log >/dev/null 2>&1
|
composer global show "$prefix$tool" 2>&1 | grep -E ^versions | sudo tee /tmp/composer.log >/dev/null 2>&1
|
||||||
else
|
else
|
||||||
scoped_dir="$composer_bin/_tools/$tool-$(echo -n "$release" | shasum -a 256 | cut -d ' ' -f 1)"
|
scoped_dir="$composer_bin/_tools/$tool-$(echo -n "$release" | shasum -a 256 | cut -d ' ' -f 1)"
|
||||||
if ! [ -f "$scoped_dir/vendor/autoload.php" ]; then
|
if ! [ -d "$scoped_dir" ]; then
|
||||||
mkdir -p "$scoped_dir"
|
mkdir -p "$scoped_dir"
|
||||||
echo '{}' | tee "$scoped_dir/composer.json" >/dev/null
|
echo '{}' | tee "$scoped_dir/composer.json" >/dev/null
|
||||||
if composer show "$prefix$tool" "$tool_version" -d "$scoped_dir" -a 2>&1 | grep -qE '^type *: *composer-plugin' && [ -n "$composer_args" ]; then
|
if composer show "$prefix$tool" "$tool_version" -d "$scoped_dir" -a 2>&1 | grep -qE '^type *: *composer-plugin' && [ -n "$composer_args" ]; then
|
||||||
composer config -d "$scoped_dir" --no-plugins allow-plugins."$prefix$tool" true >/dev/null 2>&1
|
composer config -d "$scoped_dir" --no-plugins allow-plugins."$prefix$tool" true >/dev/null 2>&1
|
||||||
fi
|
fi
|
||||||
composer require "$prefix$release" -d "$scoped_dir" "$composer_args" >/dev/null 2>&1 || return 1
|
composer require "$prefix$release" -d "$scoped_dir" "$composer_args" >/dev/null 2>&1
|
||||||
|
composer show "$prefix$tool" -d "$scoped_dir" 2>&1 | grep -E ^versions | sudo tee /tmp/composer.log >/dev/null 2>&1
|
||||||
fi
|
fi
|
||||||
composer show "$prefix$tool" -d "$scoped_dir" 2>&1 | grep -E ^versions | sudo tee /tmp/composer.log >/dev/null 2>&1
|
|
||||||
[ -s /tmp/composer.log ] || return 1
|
|
||||||
add_path "$scoped_dir"/vendor/bin
|
add_path "$scoped_dir"/vendor/bin
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
@@ -354,7 +316,6 @@ add_composer_tool() {
|
|||||||
release=$2
|
release=$2
|
||||||
prefix=$3
|
prefix=$3
|
||||||
scope=$4
|
scope=$4
|
||||||
local fallback_url=${5:-} fallback_version_parameter=${6:-}
|
|
||||||
composer_args=
|
composer_args=
|
||||||
composer_major_version=$(cut -d'.' -f 1 /tmp/composer_version)
|
composer_major_version=$(cut -d'.' -f 1 /tmp/composer_version)
|
||||||
if [ "$composer_major_version" != "1" ]; then
|
if [ "$composer_major_version" != "1" ]; then
|
||||||
@@ -365,17 +326,11 @@ add_composer_tool() {
|
|||||||
return
|
return
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
sudo rm -f /tmp/composer.log
|
add_composer_tool_helper "$tool" "$release" "$prefix" "$scope" "$composer_args"
|
||||||
if add_composer_tool_helper "$tool" "$release" "$prefix" "$scope" "$composer_args" && [ -s /tmp/composer.log ]; then
|
tool_version=$(get_tool_version cat /tmp/composer.log)
|
||||||
tool_version=$(get_tool_version cat /tmp/composer.log)
|
([ -s /tmp/composer.log ] && add_log "$tick" "$tool" "Added $tool $tool_version"
|
||||||
add_tools_helper "$tool"
|
) || add_log "$cross" "$tool" "Could not setup $tool"
|
||||||
add_log "$tick" "$tool" "Added $tool $tool_version"
|
add_tools_helper "$tool"
|
||||||
elif [ -n "$fallback_url" ]; then
|
|
||||||
add_log "!" "$tool" "Could not setup $tool using Composer. Falling back to PHAR."
|
|
||||||
add_tool "$fallback_url" "$tool" "$fallback_version_parameter"
|
|
||||||
else
|
|
||||||
add_log "$cross" "$tool" "Could not setup $tool"
|
|
||||||
fi
|
|
||||||
if [ -e "$composer_bin/composer" ]; then
|
if [ -e "$composer_bin/composer" ]; then
|
||||||
sudo cp -a "$tool_path_dir/composer" "$composer_bin"
|
sudo cp -a "$tool_path_dir/composer" "$composer_bin"
|
||||||
fi
|
fi
|
||||||
|
|||||||
@@ -225,11 +225,6 @@ configure_brew() {
|
|||||||
tap_dir="$brew_repo"/Library/Taps
|
tap_dir="$brew_repo"/Library/Taps
|
||||||
core_repo="$tap_dir"/homebrew/homebrew-core
|
core_repo="$tap_dir"/homebrew/homebrew-core
|
||||||
|
|
||||||
if [ -d "$core_repo" ]; then
|
|
||||||
export HOMEBREW_NO_INSTALL_FROM_API=1
|
|
||||||
else
|
|
||||||
unset HOMEBREW_NO_INSTALL_FROM_API
|
|
||||||
fi
|
|
||||||
export HOMEBREW_CHANGE_ARCH_TO_ARM=1
|
export HOMEBREW_CHANGE_ARCH_TO_ARM=1
|
||||||
export HOMEBREW_NO_AUTO_UPDATE=1
|
export HOMEBREW_NO_AUTO_UPDATE=1
|
||||||
export HOMEBREW_NO_ENV_HINTS=1
|
export HOMEBREW_NO_ENV_HINTS=1
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
add_bazel() {
|
add_bazel() {
|
||||||
if ! command -v bazel; then
|
if ! command -v bazel; then
|
||||||
if [ "$(uname -s)" = "Linux" ]; then
|
if [ "$(uname -s)" = "Linux" ]; then
|
||||||
add_list bazel/apt https://storage.googleapis.com/bazel-apt https://releases.bazel.build/bazel-release.pub.gpg stable jdk1.8
|
add_list bazel/apt https://storage.googleapis.com/bazel-apt https://bazel.build/bazel-release.pub.gpg stable jdk1.8
|
||||||
install_packages bazel
|
install_packages bazel
|
||||||
else
|
else
|
||||||
safe_brew install bazel
|
safe_brew install bazel
|
||||||
|
|||||||
+107
-314
@@ -37,45 +37,35 @@ set_base_version() {
|
|||||||
|
|
||||||
# Helper function to update package lists.
|
# Helper function to update package lists.
|
||||||
update_lists_helper() {
|
update_lists_helper() {
|
||||||
local list=$1
|
list=$1
|
||||||
command -v sudo >/dev/null && SUDO=sudo
|
command -v sudo >/dev/null && SUDO=sudo
|
||||||
if [[ -n "$list" ]]; then
|
if [[ -n "$list" ]]; then
|
||||||
${SUDO} apt-get update -o Dir::Etc::sourcelist="$list" -o Dir::Etc::sourceparts="-" -o APT::Get::List-Cleanup="0" "${@:2}"
|
${SUDO} apt-get update -o Dir::Etc::sourcelist="$list" -o Dir::Etc::sourceparts="-" -o APT::Get::List-Cleanup="0"
|
||||||
else
|
else
|
||||||
${SUDO} apt-get update
|
${SUDO} apt-get update
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
# Search active APT files, including symlinks, without descending into directories.
|
|
||||||
grep_sources() (
|
|
||||||
shopt -s nullglob
|
|
||||||
local files=("$list_dir"/*.list "$list_dir"/*.sources)
|
|
||||||
(( ${#files[@]} )) && grep -d skip -D skip "$@" -- "${files[@]}"
|
|
||||||
)
|
|
||||||
|
|
||||||
# Function to update the package lists.
|
# Function to update the package lists.
|
||||||
update_lists() {
|
update_lists() {
|
||||||
local ppa=${1:-}
|
local ppa=${1:-}
|
||||||
local ppa_search=${2:-}
|
local ppa_search=${2:-}
|
||||||
|
local status_token=${3:-$ppa_search}
|
||||||
local list=
|
local list=
|
||||||
local status_file=/tmp/os_lists
|
local status_file=/tmp/os_lists
|
||||||
|
local hash_cmd
|
||||||
if [[ -n "$ppa" && -n "$ppa_search" ]]; then
|
if [[ -n "$ppa" && -n "$ppa_search" ]]; then
|
||||||
if [ -f "$ppa_search" ]; then
|
if [ -f "$ppa_search" ]; then
|
||||||
list="$ppa_search"
|
list="$ppa_search"
|
||||||
else
|
else
|
||||||
list="$(grep_sources -El -e "$ppa_search" 2>/dev/null | head -n 1)"
|
list="$(grep -Elr "$ppa_search" "$list_dir" 2>/dev/null | head -n 1)"
|
||||||
|
fi
|
||||||
|
hash_cmd="$(command -v sha256sum || command -v shasum)"
|
||||||
|
if [ -n "$status_token" ] && [ -n "$hash_cmd" ]; then
|
||||||
|
status_file=/tmp/os_lists_"$(echo -n "$status_token" | $hash_cmd | awk '{print $1}')"
|
||||||
|
elif [ -n "$status_token" ]; then
|
||||||
|
status_file=/tmp/os_lists_$(date +%s)
|
||||||
fi
|
fi
|
||||||
[ -n "$list" ] || return 1
|
|
||||||
status_file="/tmp/os_lists_refresh_${list##*/}"
|
|
||||||
[[ "${runner:-}" != self-hosted ]] && cmp -s "$list" "$status_file" && return 0
|
|
||||||
local output rc
|
|
||||||
output=$(LC_ALL=C update_lists_helper "$list" -o APT::Update::Error-Mode=any 2>&1) || {
|
|
||||||
rc=$?
|
|
||||||
[[ "${3:-}" = --on-missing-key && "$output" =~ $missing_key ]] || return "$rc"
|
|
||||||
"$4" "$ppa" "$list" "${BASH_REMATCH[2]}" || return 1
|
|
||||||
}
|
|
||||||
[[ "${runner:-}" = self-hosted ]] || cp "$list" "$status_file"
|
|
||||||
return
|
|
||||||
elif [ -e "$list_file" ] && grep -Eq '^deb |^Types: *deb' "$list_file"; then
|
elif [ -e "$list_file" ] && grep -Eq '^deb |^Types: *deb' "$list_file"; then
|
||||||
list="$list_file"
|
list="$list_file"
|
||||||
fi
|
fi
|
||||||
@@ -166,7 +156,7 @@ ubuntu_fingerprint() {
|
|||||||
ppa_uri="~${ppa%/*}/+archive/ubuntu/${ppa##*/}"
|
ppa_uri="~${ppa%/*}/+archive/ubuntu/${ppa##*/}"
|
||||||
get -s -n "" "${lp_api[0]}/$ppa_uri" | jq -er '.signing_key_fingerprint' 2>/dev/null \
|
get -s -n "" "${lp_api[0]}/$ppa_uri" | jq -er '.signing_key_fingerprint' 2>/dev/null \
|
||||||
|| get -s -n "" "${lp_api[1]}/$ppa_uri" | jq -er '.signing_key_fingerprint' 2>/dev/null \
|
|| get -s -n "" "${lp_api[1]}/$ppa_uri" | jq -er '.signing_key_fingerprint' 2>/dev/null \
|
||||||
|| { [ -n "${4:-}" ] && get -s -n "" "${4%.gpg}.fingerprint"; }
|
|| get -s -n "" "$ppa_sp/keys/$ppa.fingerprint"
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -180,48 +170,25 @@ debian_fingerprint() {
|
|||||||
gpg --list-packets "$release_pub" | grep -Eo 'fpr\sv4\s.*[a-zA-Z0-9]+' | head -n 1 | cut -d ' ' -f 3
|
gpg --list-packets "$release_pub" | grep -Eo 'fpr\sv4\s.*[a-zA-Z0-9]+' | head -n 1 | cut -d ' ' -f 3
|
||||||
}
|
}
|
||||||
|
|
||||||
# Check for a binary OpenPGP public keyring readable by APT.
|
|
||||||
is_gpg_keyring() {
|
|
||||||
local keys
|
|
||||||
[ -s "$1" ] && LC_ALL=C file -Lb -- "$1" | grep -Eiq '^(OpenPGP public key|PGP(/GPG)? (public key|key public ring))' || return 1
|
|
||||||
keys=$(gpg --batch --with-colons --show-keys "$1" 2>/dev/null) || return 1
|
|
||||||
[[ -z "${2:-}" ]] || awk -F: -v signer="$2" '$1 == "fpr" && $10 ~ (signer "$") {found=1} END {exit !found}' <<< "$keys"
|
|
||||||
}
|
|
||||||
|
|
||||||
# Function to add a GPG key.
|
# Function to add a GPG key.
|
||||||
add_key() (
|
add_key() {
|
||||||
local ppa=$1 ppa_url=$2 package_dist=$3 key_source=$4 key_file=$5
|
ppa=${1:-ondrej/php}
|
||||||
local mirror=${6:-} signer=${7:-} fingerprint sks_params
|
ppa_url=$2
|
||||||
local key_urls=("$key_source")
|
package_dist=$3
|
||||||
if [[ -z "$key_source" || "$key_source" = "$ppa_url" ]]; then
|
key_source=$4
|
||||||
key_urls=()
|
key_file=$5
|
||||||
if fingerprint="$("${ID}"_fingerprint "$ppa" "$ppa_url" "$package_dist" "$mirror")" && [[ "$fingerprint" =~ ^[[:xdigit:]]+$ ]]; then
|
key_urls=("$key_source")
|
||||||
sks_params="op=get&options=mr&exact=on&search=0x$fingerprint"
|
if [[ "$key_source" =~ launchpadcontent.net|debian.org ]]; then
|
||||||
key_urls=("${sks[@]/%/\/pks\/lookup\?"$sks_params"}")
|
fingerprint="$("${ID}"_fingerprint "$ppa" "$ppa_url" "$package_dist")"
|
||||||
fi
|
sks_params="op=get&options=mr&exact=on&search=0x$fingerprint"
|
||||||
|
key_urls=("${sks[@]/%/\/pks\/lookup\?"$sks_params"}")
|
||||||
fi
|
fi
|
||||||
[ -z "$mirror" ] || key_urls+=("$mirror")
|
key_urls+=("$ppa_sp/keys/$ppa.gpg")
|
||||||
local stage url input pending=
|
[ ! -e "$key_source" ] && get -q -n "$key_file" "${key_urls[@]}"
|
||||||
stage="$(mktemp -d)" || return 1
|
if [[ "$(file "$key_file")" =~ .*('Public-Key (old)'|'Secret-Key') ]]; then
|
||||||
trap 'rm -rf "$stage"; if [ -n "$pending" ]; then sudo rm -f -- "$pending"; fi' EXIT
|
sudo gpg --batch --yes --dearmor "$key_file" >/dev/null 2>&1 && sudo mv "$key_file".gpg "$key_file"
|
||||||
for url in "${key_urls[@]}"; do
|
fi
|
||||||
input=$url
|
}
|
||||||
if [ ! -f "$input" ]; then
|
|
||||||
input="$stage/download"
|
|
||||||
: > "$input"
|
|
||||||
(get -q -n "$input" "$url") || continue
|
|
||||||
fi
|
|
||||||
gpg --batch --yes --dearmor --output "$stage/key.gpg" "$input" >/dev/null 2>&1 || continue
|
|
||||||
is_gpg_keyring "$stage/key.gpg" "$signer" || continue
|
|
||||||
if [[ "$input" -ef "$key_file" ]] && { [[ "$key_file" = *.asc ]] || cmp -s "$input" "$stage/key.gpg"; }; then
|
|
||||||
return 0
|
|
||||||
fi
|
|
||||||
pending="$(sudo mktemp "$key_file.XXXXXXXX")" || return 1
|
|
||||||
sudo install -m 644 "$stage/key.gpg" "$pending" && sudo mv -f -- "$pending" "$key_file"
|
|
||||||
return
|
|
||||||
done
|
|
||||||
return 1
|
|
||||||
)
|
|
||||||
|
|
||||||
# Function to handle existing list files.
|
# Function to handle existing list files.
|
||||||
handle_existing_list() {
|
handle_existing_list() {
|
||||||
@@ -233,10 +200,10 @@ handle_existing_list() {
|
|||||||
echo "Repository $ppa ($branches) already exists" && return 1
|
echo "Repository $ppa ($branches) already exists" && return 1
|
||||||
fi
|
fi
|
||||||
if merged_components="$(merge_components_from_file "$check_lists_file" "$branches")"; then
|
if merged_components="$(merge_components_from_file "$check_lists_file" "$branches")"; then
|
||||||
printf '%s\n' "$merged_components" && return 0
|
sudo rm -f "$check_lists_file" && printf '%s\n' "$merged_components" && return 0
|
||||||
fi
|
fi
|
||||||
if [[ "$list_format" = "deb822" && "$check_lists_file" = *.list ]]; then
|
if [[ "$list_format" = "deb822" && "$check_lists_file" = *.list ]]; then
|
||||||
printf '%s\n' "$branches" && return 0
|
sudo rm -f "$check_lists_file" && printf '%s\n' "$branches" && return 0
|
||||||
fi
|
fi
|
||||||
echo "Repository $ppa ($branches) already exists" && return 1
|
echo "Repository $ppa ($branches) already exists" && return 1
|
||||||
}
|
}
|
||||||
@@ -250,43 +217,48 @@ write_list() {
|
|||||||
local components=$5
|
local components=$5
|
||||||
local key_file=$6
|
local key_file=$6
|
||||||
local list_basename="${ppa%%/*}"-"$ID"-"${ppa#*/}"-"$suite"
|
local list_basename="${ppa%%/*}"-"$ID"-"${ppa#*/}"-"$suite"
|
||||||
local arch list dest by_hash=
|
local arch
|
||||||
arch="$(dpkg --print-architecture)"
|
arch="$(dpkg --print-architecture)"
|
||||||
case "${url%/}" in
|
sudo rm -f "$list_dir"/"${ppa/\//-}".list "$list_dir"/"${ppa/\//-}".sources "$list_dir"/"$list_basename".list "$list_dir"/"$list_basename".sources || true
|
||||||
"$ppa_sp/sury"|"$ppa_sp/apache2") by_hash=' by-hash=force' ;;
|
|
||||||
esac
|
|
||||||
dest="$list_dir/$list_basename.$(get_sources_extension "$type")"
|
|
||||||
for list in "$list_dir/${ppa/\//-}".{list,sources} "$list_dir/$list_basename".{list,sources}; do
|
|
||||||
[[ "$list" = "$dest" ]] || remove_list_entry "$list" "$url" || return 1
|
|
||||||
done
|
|
||||||
preserve_list "$dest" "$url" || return 1
|
|
||||||
if [ "$type" = "deb822" ]; then
|
if [ "$type" = "deb822" ]; then
|
||||||
{
|
cat <<EOF | sudo tee "$list_dir"/"$list_basename".sources >/dev/null
|
||||||
printf '%s\n' "Types: deb" "URIs: $url" "Suites: $suite" "Components: $components" "Architectures: $arch" "Signed-By: $key_file"
|
Types: deb
|
||||||
if [ -n "$by_hash" ]; then printf '%s\n' 'By-Hash: force'; fi
|
URIs: $url
|
||||||
} | sudo tee "$dest" >/dev/null
|
Suites: $suite
|
||||||
|
Components: $components
|
||||||
|
Architectures: $arch
|
||||||
|
Signed-By: $key_file
|
||||||
|
EOF
|
||||||
else
|
else
|
||||||
echo "deb [arch=$arch signed-by=$key_file$by_hash] $url $suite $components" | sudo tee "$dest" >/dev/null 2>&1
|
echo "deb [arch=$arch signed-by=$key_file] $url $suite $components" | sudo tee "$list_dir"/"$list_basename".list >/dev/null 2>&1
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
# Function to check if a PPA and its lists exist
|
# Function to check if a PPA and its lists exist
|
||||||
check_lists() {
|
check_lists() {
|
||||||
local ppa=$1
|
local ppa=$1
|
||||||
local pattern=${2:-${3:-}}
|
local primary=${2:-}
|
||||||
|
local secondary=${3:-}
|
||||||
|
local status_token=${4:-$primary}
|
||||||
local match_file=
|
local match_file=
|
||||||
check_lists_file=
|
check_lists_file=
|
||||||
if [ -n "$pattern" ]; then
|
if [ -n "$primary" ]; then
|
||||||
match_file=$(grep_sources -El -e "$pattern" 2>/dev/null | head -n 1)
|
match_file=$(grep -Elr "$primary" "$list_dir" 2>/dev/null | head -n 1)
|
||||||
|
fi
|
||||||
|
if [ -z "$match_file" ] && [ -n "$secondary" ]; then
|
||||||
|
local candidate
|
||||||
|
candidate=$(grep -Elr "$secondary" "$list_dir" 2>/dev/null | head -n 1)
|
||||||
|
if [ -n "$candidate" ] && { [ -z "$primary" ] || grep -Eq "$primary" "$candidate"; }; then
|
||||||
|
match_file="$candidate"
|
||||||
|
fi
|
||||||
fi
|
fi
|
||||||
if [ -n "$match_file" ]; then
|
if [ -n "$match_file" ]; then
|
||||||
check_lists_file="$match_file"
|
|
||||||
[[ "${4:-}" != --lookup-only ]] || return 0
|
|
||||||
local list_count
|
local list_count
|
||||||
list_count="$(sudo find /var/lib/apt/lists -type f -name "*${ppa/\//_}*" | wc -l)"
|
list_count="$(sudo find /var/lib/apt/lists -type f -name "*${ppa/\//_}*" | wc -l)"
|
||||||
if [ "$list_count" = "0" ]; then
|
if [ "$list_count" = "0" ]; then
|
||||||
update_lists "$ppa" "$match_file"
|
update_lists "$ppa" "$match_file" "$status_token"
|
||||||
fi
|
fi
|
||||||
|
check_lists_file="$match_file"
|
||||||
return 0
|
return 0
|
||||||
fi
|
fi
|
||||||
return 1
|
return 1
|
||||||
@@ -294,19 +266,21 @@ check_lists() {
|
|||||||
|
|
||||||
# Function to add a sources list.
|
# Function to add a sources list.
|
||||||
add_list() {
|
add_list() {
|
||||||
local ppa=${1-$default_ppa}
|
ppa=${1-ondrej/php}
|
||||||
ppa_url=${2:-"$lpc_ppa/$ppa/ubuntu"}
|
ppa_url=${2:-"$lpc_ppa/$ppa/ubuntu"}
|
||||||
key_source=${3:-}
|
key_source=${3:-"$ppa_url"}
|
||||||
package_dist=${4:-"$VERSION_CODENAME"}
|
package_dist=${4:-"$VERSION_CODENAME"}
|
||||||
branches=${5:-main}
|
branches=${5:-main}
|
||||||
local list_format
|
local list_format
|
||||||
local list_extension
|
local list_extension
|
||||||
|
local status_token
|
||||||
local resolved_branches
|
local resolved_branches
|
||||||
local list_path=
|
local list_path=
|
||||||
list_format="$(get_sources_format)"
|
list_format="$(get_sources_format)"
|
||||||
list_extension="$(get_sources_extension "$list_format")"
|
list_extension="$(get_sources_extension "$list_format")"
|
||||||
|
status_token="${ppa_url}|${package_dist}|${branches}"
|
||||||
IFS='|' read -r primary_pattern secondary_pattern <<< "$(get_repo_patterns "$list_format" "$ppa_url" "$package_dist" "$branches")"
|
IFS='|' read -r primary_pattern secondary_pattern <<< "$(get_repo_patterns "$list_format" "$ppa_url" "$package_dist" "$branches")"
|
||||||
if check_lists "$ppa" "$primary_pattern" "$secondary_pattern" "${8:-}"; then
|
if check_lists "$ppa" "$primary_pattern" "$secondary_pattern" "$status_token"; then
|
||||||
list_path="$check_lists_file"
|
list_path="$check_lists_file"
|
||||||
if resolved_branches="$(handle_existing_list "$ppa" "$list_format" "$branches")"; then
|
if resolved_branches="$(handle_existing_list "$ppa" "$list_format" "$branches")"; then
|
||||||
branches="$resolved_branches"
|
branches="$resolved_branches"
|
||||||
@@ -314,25 +288,14 @@ add_list() {
|
|||||||
[ -n "$resolved_branches" ] && echo "$resolved_branches" && return 1
|
[ -n "$resolved_branches" ] && echo "$resolved_branches" && return 1
|
||||||
fi
|
fi
|
||||||
check_lists_file=
|
check_lists_file=
|
||||||
|
IFS='|' read -r primary_pattern secondary_pattern <<< "$(get_repo_patterns "$list_format" "$ppa_url" "$package_dist" "$branches")"
|
||||||
|
status_token="${ppa_url}|${package_dist}|${branches}"
|
||||||
fi
|
fi
|
||||||
[ -e "$key_source" ] && key_file=$key_source || key_file="$key_dir"/"${ppa/\//-}"-keyring.gpg
|
[ -e "$key_source" ] && key_file=$key_source || key_file="$key_dir"/"${ppa/\//-}"-keyring.gpg
|
||||||
add_key "$ppa" "$ppa_url" "$package_dist" "$key_source" "$key_file" "${6:-}" || return 1
|
add_key "$ppa" "$ppa_url" "$package_dist" "$key_source" "$key_file"
|
||||||
[[ -z "$list_path" ]] || remove_list_entry "$list_path" "$ppa_url" || return 1
|
write_list "$list_format" "$ppa" "$ppa_url" "$package_dist" "$branches" "$key_file"
|
||||||
write_list "$list_format" "$ppa" "$ppa_url" "$package_dist" "$branches" "$key_file" || return 1
|
|
||||||
list_path="$list_dir"/"${ppa%%/*}"-"$ID"-"${ppa#*/}"-"$package_dist"."$list_extension"
|
list_path="$list_dir"/"${ppa%%/*}"-"$ID"-"${ppa#*/}"-"$package_dist"."$list_extension"
|
||||||
# A caller requesting an index needs a successful refresh, even if APT has cached lists.
|
update_lists "$ppa" "$list_path" "$status_token"
|
||||||
if [ -n "${7:-}" ]; then
|
|
||||||
update_lists_helper "$list_path" -o APT::Update::Error-Mode=any || return 1
|
|
||||||
local index indexes
|
|
||||||
indexes=$(apt-get -o Dir::Etc::sourcelist="$list_path" -o Dir::Etc::sourceparts=- indextargets --format '$(FILENAME)' 'Identifier: Packages') || return 1
|
|
||||||
while IFS= read -r index; do
|
|
||||||
[ -s "$index" ] || continue
|
|
||||||
printf '%s\n' "$index" > "$7"
|
|
||||||
return
|
|
||||||
done <<< "$indexes"
|
|
||||||
return 1
|
|
||||||
fi
|
|
||||||
update_lists "$ppa" "$list_path"
|
|
||||||
. /etc/os-release
|
. /etc/os-release
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
@@ -346,187 +309,66 @@ check_ppa() {
|
|||||||
local list_format
|
local list_format
|
||||||
list_format="$(get_sources_format)"
|
list_format="$(get_sources_format)"
|
||||||
IFS='|' read -r primary_pattern secondary_pattern <<< "$(get_repo_patterns "$list_format" "$ppa_url" "$package_dist" "$branches")"
|
IFS='|' read -r primary_pattern secondary_pattern <<< "$(get_repo_patterns "$list_format" "$ppa_url" "$package_dist" "$branches")"
|
||||||
check_lists "$ppa" "$primary_pattern" "$secondary_pattern" || return 1
|
local status_token
|
||||||
}
|
status_token="${ppa_url}|${package_dist}|${branches}"
|
||||||
|
if check_lists "$ppa" "$primary_pattern" "$secondary_pattern" "$status_token"; then
|
||||||
# Remove matching entries from one APT file and invalidate its cached refresh.
|
return 0;
|
||||||
remove_list_entry() {
|
|
||||||
local list=$1 ppa_url=$2 uri filter
|
|
||||||
[[ -f "$list" ]] && grep -Fq -- "${ppa_url%/}" "$list" || return 0
|
|
||||||
uri=$(escape_regex "${ppa_url%/}")
|
|
||||||
[[ "$ppa_url" != //* ]] || uri="https?:$uri"
|
|
||||||
if [[ "$list" = *.sources ]]; then
|
|
||||||
# Match URIs within one deb822 paragraph, including folded fields.
|
|
||||||
local gap='([[:blank:]]|\r?\n(#[^\n]*\n)*[[:blank:]])'
|
|
||||||
filter='/^[[:space:]]*$/b
|
|
||||||
:stanza
|
|
||||||
$!{N; /\n[[:blank:]]*\r?$/!b stanza;}
|
|
||||||
/(^|\n)[Uu][Rr][Ii][Ss]:'"$gap*([^[:space:]]+$gap+)*$uri"'\/*([[:space:]]|$)/d'
|
|
||||||
else
|
else
|
||||||
filter="/^[[:blank:]]*deb(-src)?[[:blank:]]+(\\[[^]]*\\][[:blank:]]+)?$uri\\/*([[:space:]]|$)/d"
|
return 1;
|
||||||
fi
|
fi
|
||||||
sudo sed --follow-symlinks -Ei "$filter" "$list" || return 1
|
|
||||||
grep -q '[^[:space:]]' "$list" || sudo rm -f -- "$list" || return 1
|
|
||||||
sudo rm -f -- "/tmp/os_lists_refresh_${list##*/}" "${RUNNER_TEMP:-/tmp}/os_lists_${list##*/}" || return 1
|
|
||||||
}
|
|
||||||
|
|
||||||
# Keep any other entries at an active sibling path before publishing a managed source.
|
|
||||||
preserve_list() {
|
|
||||||
local list=$1 url saved stamp="${RUNNER_TEMP:-/tmp}/os_lists_${1##*/}"
|
|
||||||
[[ -e "$list" || -L "$list" ]] || return 0
|
|
||||||
if [[ -f "$stamp" ]] && tail -n +4 "$stamp" | cmp -s - "$list"; then
|
|
||||||
sudo rm -f -- "$list"
|
|
||||||
return
|
|
||||||
fi
|
|
||||||
shift
|
|
||||||
for url in "$@"; do remove_list_entry "$list" "$url" || return 1; done
|
|
||||||
[[ -e "$list" || -L "$list" ]] || return 0
|
|
||||||
saved=$(sudo mktemp --suffix=".${list##*.}" "${list%.*}.XXXXXXXX") && sudo mv -fT -- "$list" "$saved"
|
|
||||||
}
|
}
|
||||||
|
|
||||||
# Function to remove a PPA.
|
# Function to remove a PPA.
|
||||||
remove_list() {
|
remove_list() {
|
||||||
local ppa=${1-$default_ppa} list ppa_url
|
ppa=${1-ondrej/php}
|
||||||
local -a ppa_urls
|
|
||||||
[ -n "$2" ] && ppa_urls=("$2") || ppa_urls=("$lp_ppa/$ppa/ubuntu" "$lpc_ppa/$ppa/ubuntu")
|
[ -n "$2" ] && ppa_urls=("$2") || ppa_urls=("$lp_ppa/$ppa/ubuntu" "$lpc_ppa/$ppa/ubuntu")
|
||||||
for ppa_url in "${ppa_urls[@]}"; do
|
for ppa_url in "${ppa_urls[@]}"; do
|
||||||
while IFS= read -r -d '' list; do
|
grep -lr "$ppa_url" "$list_dir" | xargs -n1 sudo rm -f
|
||||||
remove_list_entry "$list" "$ppa_url" || return 1
|
|
||||||
done < <(grep_sources -FlZ --exclude="${3:-}" -e "${ppa_url%/}")
|
|
||||||
done
|
done
|
||||||
[[ ! -e "$key_dir/${ppa/\//-}-keyring" ]] || sudo rm -f "$key_dir/${ppa/\//-}-keyring"
|
sudo rm -f "$key_dir"/"${ppa/\//-}"-keyring /tmp/os_lists* || true
|
||||||
}
|
}
|
||||||
|
|
||||||
# Function to check if ubuntu ppa is up
|
# Function to check if ubuntu ppa is up
|
||||||
is_ubuntu_ppa_up() {
|
is_ubuntu_ppa_up() {
|
||||||
ppa=${1:-$default_ppa}
|
ppa=${1:-ondrej/php}
|
||||||
curl -s --connect-timeout 10 --max-time 10 --head --fail "$lpc_ppa/$ppa/ubuntu/dists/$VERSION_CODENAME/Release" > /dev/null
|
curl -s --connect-timeout 10 --max-time 10 --head --fail "$lpc_ppa/$ppa/ubuntu/dists/$VERSION_CODENAME/Release" > /dev/null
|
||||||
}
|
}
|
||||||
|
|
||||||
# Remove sources from caches that still have the old Launchpad mirrors.
|
# Function to add the PPA mirror.
|
||||||
remove_legacy_mirrors() {
|
|
||||||
local ppa old_ppa old_sp
|
|
||||||
for ppa in ondrej/php ondrej/apache2; do
|
|
||||||
old_ppa="//${ppa_sp#*://}/$ppa/ubuntu"
|
|
||||||
old_sp="//${sp#*://}/$ppa/ubuntu"
|
|
||||||
if grep_sources -Fq -e "$old_ppa" -e "$old_sp"; then
|
|
||||||
remove_list "$ppa" "$old_ppa" && remove_list "$ppa" "$old_sp" || return 1
|
|
||||||
fi
|
|
||||||
done
|
|
||||||
}
|
|
||||||
|
|
||||||
# Function to add the Sury mirror.
|
|
||||||
add_ppa_sp_mirror() {
|
add_ppa_sp_mirror() {
|
||||||
local ppa=$1 name=${1##*/} url="$ppa_sp/sury"
|
ppa=$1
|
||||||
[[ "$ppa" =~ $mirrored_ppas ]] || return 1
|
ppa_name="$(basename "$ppa")"
|
||||||
[ "$name" != apache2 ] || url="$ppa_sp/apache2"
|
|
||||||
local key_mirror="$ppa_sp/keys/sury/$name.gpg"
|
|
||||||
remove_list "$ppa" || true
|
remove_list "$ppa" || true
|
||||||
remove_legacy_mirrors || return 1
|
[ "${debug:?}" = "debug" ] && add_list sp/"$ppa_name" "$ppa_sp/$ppa/ubuntu" "$ppa_sp/$ppa/ubuntu/key.gpg" "$VERSION_CODENAME" "main/debug"
|
||||||
[ "${debug:?}" = "debug" ] && add_list "sp/$name" "$url" "$url/apt.gpg" "$VERSION_CODENAME" "main/debug" "$key_mirror"
|
add_list sp/"$ppa_name" "$ppa_sp/$ppa/ubuntu" "$ppa_sp/$ppa/ubuntu/key.gpg"
|
||||||
add_list "sp/$name" "$url" "$url/apt.gpg" "$VERSION_CODENAME" main "$key_mirror"
|
|
||||||
}
|
}
|
||||||
|
|
||||||
# Add a signed archive, using the mirror if APT cannot load a Packages index.
|
add_sury_list() {
|
||||||
# Arguments: [--keyring path primary-key-url mirror-key-url] list ID, primary URL, mirror URL, keyring, suite, components, optional source URLs to replace.
|
ppa=${1:-ondrej/php}
|
||||||
add_list_with_fallback() (
|
[ "${debug:?}" = "debug" ] && add_list "$ppa" "$sury"/"${ppa##*/}"/ "$sury"/"${ppa##*/}"/apt.gpg "$VERSION_CODENAME" "main/debug"
|
||||||
local managed_key='' key_url='' key_mirror=''
|
add_list "$ppa" "$sury"/"${ppa##*/}"/ "$sury"/"${ppa##*/}"/apt.gpg
|
||||||
if [[ "$1" = --keyring ]]; then
|
}
|
||||||
managed_key=$2 key_url=$3 key_mirror=$4
|
|
||||||
shift 4
|
|
||||||
fi
|
|
||||||
local ppa=$1 primary=$2 mirror=$3 key=$4 suite=${5:-$VERSION_CODENAME} components=${6:-main}
|
|
||||||
local repo=${ppa_sources[$ID/$ppa]:-$ppa} source stamp request cached_request cached_key index
|
|
||||||
local stage='' old_url
|
|
||||||
[[ -s "$key" || -n "$managed_key" ]] || return 1
|
|
||||||
sources_format="$(get_sources_format)"
|
|
||||||
source="${repo%%/*}-$ID-${repo#*/}-$suite.$(get_sources_extension "$sources_format")"
|
|
||||||
stamp="${RUNNER_TEMP:-/tmp}/os_lists_$source"
|
|
||||||
printf -v request '%q ' "$primary" "$mirror" "$components" "${@:7}"
|
|
||||||
if [[ -s "$list_dir/$source" && -s "$stamp" && ! "$key" -nt "$stamp" ]] &&
|
|
||||||
[[ -n "$(find "$stamp" -mtime -1 -print)" ]] &&
|
|
||||||
{ IFS= read -r cached_request && IFS= read -r index && IFS= read -r cached_key && cmp -s - "$list_dir/$source"; } < "$stamp" &&
|
|
||||||
[[ "$cached_request" = "$request" && "$cached_key" = "$key" && -s "$index" ]] &&
|
|
||||||
{ [[ "${require_mirror_by_hash:-}" != true ]] || ! grep -Fq "${mirror%/}" "$list_dir/$source" ||
|
|
||||||
grep -Eq '^By-Hash: force$| by-hash=force( |])' "$list_dir/$source"; }; then
|
|
||||||
# A cache can restore another source file after this archive was selected.
|
|
||||||
(( $# > 6 )) && grep_sources -qF --exclude="$source" -f <(printf '%s\n' "${@:7}") || return 0
|
|
||||||
else
|
|
||||||
stage=$(mktemp -d /tmp/setup-php-list.XXXXXXXX) || return 1
|
|
||||||
trap 'rm -rf "$stage"' EXIT
|
|
||||||
chmod 755 "$stage" || return 1
|
|
||||||
if [[ -z "$key" ]]; then
|
|
||||||
key="$stage/initial.gpg"
|
|
||||||
add_key "$repo" "$primary" "$suite" "$key_url" "$key" "$key_mirror" || return 1
|
|
||||||
fi
|
|
||||||
local url attempt_key output signer='' candidate="$stage/rotated.gpg"
|
|
||||||
for url in "$primary" "$mirror"; do
|
|
||||||
for attempt_key in "$key" "$candidate"; do
|
|
||||||
if [[ "$attempt_key" = "$candidate" ]]; then
|
|
||||||
[[ -n "$key_url" && "$output" =~ $missing_key ]] || break
|
|
||||||
if [[ "$signer" != "${BASH_REMATCH[2]}" ]]; then
|
|
||||||
signer=${BASH_REMATCH[2]}
|
|
||||||
rm -f "$candidate" || return 1
|
|
||||||
add_key "$repo" "$primary" "$suite" "$key_url" "$candidate" "$key_mirror" "$signer" || break
|
|
||||||
fi
|
|
||||||
[ -s "$candidate" ] || break
|
|
||||||
rm -f "$stage/$source" || return 1
|
|
||||||
fi
|
|
||||||
if output=$(list_dir="$stage" add_list "$repo" "$url" "$attempt_key" "$suite" "$components" '' "$stage/index" 2>&1); then
|
|
||||||
[[ -z "$output" ]] || printf '%s\n' "$output"
|
|
||||||
key=$attempt_key
|
|
||||||
break 2
|
|
||||||
fi
|
|
||||||
printf '%s\n' "$output" >&2
|
|
||||||
done
|
|
||||||
done
|
|
||||||
[ -s "$stage/index" ] || return 1
|
|
||||||
fi
|
|
||||||
for old_url in "${@:7}"; do
|
|
||||||
remove_list "$ppa" "$old_url" "$source" || return 1
|
|
||||||
done
|
|
||||||
[ -n "$stage" ] || return 0
|
|
||||||
sudo rm -f "/tmp/os_lists_refresh_$source" || return 1
|
|
||||||
if [[ "$key" = "$stage/"* ]]; then
|
|
||||||
list_with_key "$stage/$source" "$managed_key" > "$stage/publish" && mv -f "$stage/publish" "$stage/$source" || return 1
|
|
||||||
add_key "$repo" "$primary" "$suite" "$key" "$managed_key" || return 1
|
|
||||||
key=$managed_key
|
|
||||||
fi
|
|
||||||
preserve_list "$list_dir/$source" "$primary" "$mirror" "${@:7}" || return 1
|
|
||||||
sudo install -m 644 "$stage/$source" "$list_dir/$source" || return 1
|
|
||||||
{ printf '%s\n' "$request" && cat "$stage/index" && printf '%s\n' "$key" && cat "$stage/$source"; } > "$stage/stamp" && mv -fT "$stage/stamp" "$stamp"
|
|
||||||
)
|
|
||||||
|
|
||||||
# Function to add a PPA.
|
# Function to add a PPA.
|
||||||
add_ppa() {
|
add_ppa() {
|
||||||
set_base_version
|
set_base_version
|
||||||
ppa=${1:-$default_ppa}
|
ppa=${1:-ondrej/php}
|
||||||
if [[ "$ID ${ID_LIKE:-}" =~ ubuntu|debian && "$ppa" =~ $mirrored_ppas ]]; then
|
if [[ "$ID" = "ubuntu" || "$ID_LIKE" =~ ubuntu ]] && [[ "$ppa" =~ "ondrej/" ]]; then
|
||||||
remove_legacy_mirrors || return 1
|
if [ "$VERSION_ID" = "26.04" ]; then
|
||||||
local components=main name=${ppa##*/} primary="$sury/${ppa##*/}/" key_mirror="$ppa_sp/keys/sury/${ppa##*/}.gpg"
|
add_sury_list
|
||||||
if [[ "$name" = php && "$ID ${ID_LIKE:-}" != *ubuntu* ]]; then
|
|
||||||
[ "${debug:?}" != debug ] || components="main/debug main"
|
|
||||||
add_list "$ppa" "$primary" "${primary}apt.gpg" "$VERSION_CODENAME" "$components" "$key_mirror" '' --lookup-only ||
|
|
||||||
{ [ -n "$check_lists_file" ] && update_lists "$ppa" "$check_lists_file" --on-missing-key retry_sury_update; }
|
|
||||||
else
|
else
|
||||||
local mirror="$ppa_sp/sury/" managed_key="$key_dir/sury-$name-keyring.gpg" key=
|
if is_ubuntu_ppa_up "$ppa" ; then
|
||||||
local -a curl_opts=("${curl_opts[@]}" --connect-timeout 5 --max-time 15)
|
[ "${runner:?}" = "self-hosted" ] && find "$list_dir" -type f -name 'sp*' -exec grep -qF "${sp/https:\/\/}" {} \; -delete
|
||||||
if [ "$name" = apache2 ]; then
|
[ "${debug:?}" = "debug" ] && add_list "$ppa" "$lpc_ppa/$ppa/ubuntu" "$lpc_ppa/$ppa/ubuntu" "$VERSION_CODENAME" "main/debug"
|
||||||
mirror="$ppa_sp/apache2/"
|
add_list "$ppa"
|
||||||
[ "${debug:-}" != debug ] || components="main/debug main"
|
elif [ "$ppa" = "ondrej/php" ]; then
|
||||||
|
add_ppa_sp_mirror "$ppa"
|
||||||
|
else
|
||||||
|
add_log "${cross:?}" "$ppa" "PPA $ppa is not available"
|
||||||
fi
|
fi
|
||||||
local require_mirror_by_hash=true
|
|
||||||
local -a options=("$VERSION_CODENAME" "$components" "//${lp_ppa#*://}/$ppa/ubuntu" "//${lpc_ppa#*://}/$ppa/ubuntu"
|
|
||||||
"${primary%/}" "${mirror%/}")
|
|
||||||
[ "$name" != php ] || options+=(mirror+file:/etc/apt/setup-php-sury-mirrors.txt)
|
|
||||||
local packaged_key="$key_dir/debsuryorg-archive-keyring.gpg"
|
|
||||||
if is_gpg_keyring "$managed_key"; then
|
|
||||||
key="$managed_key"
|
|
||||||
elif is_gpg_keyring "$packaged_key"; then
|
|
||||||
key="$packaged_key"
|
|
||||||
fi
|
|
||||||
LC_ALL=C add_list_with_fallback --keyring "$managed_key" "${primary}apt.gpg" "$key_mirror" "$ppa" "$primary" "$mirror" "$key" "${options[@]}"
|
|
||||||
fi
|
fi
|
||||||
|
elif [[ "$ID" = "debian" || "$ID_LIKE" =~ debian ]] && [[ "$ppa" =~ "ondrej/" ]]; then
|
||||||
|
add_sury_list
|
||||||
else
|
else
|
||||||
add_list "$ppa"
|
add_list "$ppa"
|
||||||
fi
|
fi
|
||||||
@@ -535,70 +377,25 @@ add_ppa() {
|
|||||||
return $exit_code
|
return $exit_code
|
||||||
}
|
}
|
||||||
|
|
||||||
# Replace a single Signed-By keyring, preserving the rest of a deb or deb822 source.
|
|
||||||
list_with_key() {
|
|
||||||
awk -v key="$2" '
|
|
||||||
/^Signed-By:[[:blank:]]+\/[^[:space:]]+$/ { $0 = "Signed-By: " key; changed = 1 }
|
|
||||||
/^deb(-src)?[[:blank:]]/ && match($0, /[[:blank:][]signed-by=\/[^],[:space:]]+[][:blank:]]/) {
|
|
||||||
$0 = substr($0, 1, RSTART) "signed-by=" key substr($0, RSTART + RLENGTH - 1)
|
|
||||||
changed = 1
|
|
||||||
}
|
|
||||||
{ print }
|
|
||||||
END { exit !changed }
|
|
||||||
' "$1"
|
|
||||||
}
|
|
||||||
|
|
||||||
# Retry just the selected Sury source after APT reports a missing signer.
|
|
||||||
retry_sury_update() (
|
|
||||||
local ppa=$1 list=$2 signer=$3 name=${1##*/} selected stage
|
|
||||||
[[ "$ppa" =~ $mirrored_ppas ]] || return 1
|
|
||||||
local primary="$sury/$name/" mirror="$ppa_sp/sury/" key="$key_dir/sury-$name-keyring.gpg"
|
|
||||||
[ "$name" != apache2 ] || mirror="$ppa_sp/apache2/"
|
|
||||||
selected=$(apt-get -o Dir::Etc::sourcelist="$list" -o Dir::Etc::sourceparts=- indextargets \
|
|
||||||
--no-release-info --format '$(REPO_URI)' | sort -u) || return 1
|
|
||||||
[[ "${selected%/}" = "${primary%/}" || "${selected%/}" = "${mirror%/}" ]] || return 1
|
|
||||||
|
|
||||||
local source=${list##*/} request index old_key
|
|
||||||
local stamp="${RUNNER_TEMP:-/tmp}/os_lists_$source"
|
|
||||||
local -a curl_opts=("${curl_opts[@]}" --connect-timeout 5 --max-time 15)
|
|
||||||
stage=$(mktemp -d /tmp/setup-php-key.XXXXXXXX) || return 1
|
|
||||||
trap 'if (( $? != 0 )); then rm -f -- "$stamp"; fi; rm -rf "$stage"' EXIT
|
|
||||||
# APT's signature verifier runs as an unprivileged user.
|
|
||||||
chmod 755 "$stage" || return 1
|
|
||||||
list_with_key "$list" "$stage/key.gpg" > "$stage/$source" || return 1
|
|
||||||
add_key "sury/$name" "$primary" "$VERSION_CODENAME" "${primary}apt.gpg" "$stage/key.gpg" "$ppa_sp/keys/sury/$name.gpg" "$signer" || return 1
|
|
||||||
update_lists_helper "$stage/$source" -o APT::Update::Error-Mode=any || return 1
|
|
||||||
|
|
||||||
list_with_key "$list" "$key" > "$stage/$source" || return 1
|
|
||||||
add_key "sury/$name" "$primary" "$VERSION_CODENAME" "$stage/key.gpg" "$key" || return 1
|
|
||||||
if [[ -s "$stamp" ]] && { IFS= read -r request && IFS= read -r index && IFS= read -r old_key && [[ -n "$old_key" ]] && cmp -s - "$list"; } < "$stamp"; then
|
|
||||||
{ printf '%s\n' "$request" "$index" "$key" && cat "$stage/$source"; } > "$stage/stamp" || return 1
|
|
||||||
fi
|
|
||||||
sudo install -m 644 "$stage/$source" "$list" || return 1
|
|
||||||
[[ ! -f "$stage/stamp" ]] || mv -fT "$stage/stamp" "$stamp"
|
|
||||||
)
|
|
||||||
|
|
||||||
# Function to update a PPA.
|
# Function to update a PPA.
|
||||||
update_ppa() {
|
update_ppa() {
|
||||||
set_base_version
|
set_base_version
|
||||||
ppa=${1:-$default_ppa}
|
ppa=${1:-ondrej/php}
|
||||||
ppa_url=${2:-"$lpc_ppa/$ppa/ubuntu"}
|
ppa_url=${2:-"$lpc_ppa/$ppa/ubuntu"}
|
||||||
package_dist=${4:-"$VERSION_CODENAME"}
|
package_dist=${4:-"$VERSION_CODENAME"}
|
||||||
branches=${5:-main}
|
branches=${5:-main}
|
||||||
local list_format
|
local list_format
|
||||||
list_format="$(get_sources_format)"
|
list_format="$(get_sources_format)"
|
||||||
local repo=${ppa_sources[$ID/$ppa]:-$ppa}
|
IFS='|' read -r primary_pattern secondary_pattern <<< "$(get_repo_patterns "$list_format" "$ppa_url" "$package_dist" "$branches")"
|
||||||
local list_path
|
local list_path
|
||||||
list_path="$list_dir/${repo%%/*}-$ID-${repo#*/}-$package_dist.$(get_sources_extension "$list_format")"
|
list_path="$(grep -Elr "$primary_pattern" "$list_dir" 2>/dev/null | head -n 1)"
|
||||||
if [[ -n "${2:-}" || ! -s "$list_path" ]]; then
|
if [ -z "$list_path" ] && [ -n "$secondary_pattern" ]; then
|
||||||
IFS='|' read -r primary_pattern secondary_pattern <<< "$(get_repo_patterns "$list_format" "$ppa_url" "$package_dist" "$branches")"
|
list_path="$(grep -Elr "$secondary_pattern" "$list_dir" 2>/dev/null | head -n 1)"
|
||||||
list_path="$(grep_sources -El -e "$primary_pattern" 2>/dev/null | head -n 1)"
|
|
||||||
[ -n "$list_path" ] || return 1
|
|
||||||
fi
|
fi
|
||||||
local rc=0
|
local status_token
|
||||||
update_lists "$ppa" "$list_path" --on-missing-key retry_sury_update || rc=$?
|
status_token="${ppa_url}|${package_dist}|${branches}"
|
||||||
|
update_lists "$ppa" "${list_path:-$primary_pattern}" "$status_token"
|
||||||
. /etc/os-release
|
. /etc/os-release
|
||||||
return "$rc"
|
|
||||||
}
|
}
|
||||||
|
|
||||||
# Variables
|
# Variables
|
||||||
@@ -619,10 +416,6 @@ dist_info_dir='/usr/share/distro-info'
|
|||||||
sury='https://packages.sury.org'
|
sury='https://packages.sury.org'
|
||||||
ppa_sp='https://ppa.setup-php.com'
|
ppa_sp='https://ppa.setup-php.com'
|
||||||
sp='https://setup-php.com'
|
sp='https://setup-php.com'
|
||||||
default_ppa='ondrej/php'
|
|
||||||
missing_key='(NO_PUBKEY|Missing key) ([[:xdigit:]]{16,64})'
|
|
||||||
mirrored_ppas='^ondrej/(apache2|php)$'
|
|
||||||
declare -A ppa_sources=([ubuntu/ondrej/php]=setup-php/sury [ubuntu/ondrej/apache2]=setup-php/sury-apache2 [debian/ondrej/apache2]=setup-php/sury-apache2)
|
|
||||||
sks=(
|
sks=(
|
||||||
'https://keyserver.ubuntu.com'
|
'https://keyserver.ubuntu.com'
|
||||||
'https://pgp.mit.edu'
|
'https://pgp.mit.edu'
|
||||||
|
|||||||
@@ -1,30 +0,0 @@
|
|||||||
Function Add-Upsun() {
|
|
||||||
param(
|
|
||||||
[Parameter(Mandatory = $true, Position = 0, HelpMessage = 'Upsun CLI version to be installed')]
|
|
||||||
[string] $upsun_tag
|
|
||||||
)
|
|
||||||
$upsun_tag = $upsun_tag.replace('v', '')
|
|
||||||
if($upsun_tag -ne 'latest' -and $upsun_tag -notmatch '^\d+(\.\d+)*$') {
|
|
||||||
Add-Log $cross "upsun-cli" "Invalid upsun-cli version: $upsun_tag"
|
|
||||||
} elseif(-not([Environment]::Is64BitOperatingSystem)) {
|
|
||||||
Add-Log $cross "upsun-cli" "upsun-cli is only available for 64-bit Windows"
|
|
||||||
} else {
|
|
||||||
$upsun_releases = "https://github.com/upsun/cli/releases"
|
|
||||||
if ($upsun_tag -eq 'latest') {
|
|
||||||
$upsun_tag = (Get-File -Url $upsun_releases/latest).BaseResponse.RequestMessage.RequestUri.Segments[-1].replace('v', '')
|
|
||||||
}
|
|
||||||
$url = "$upsun_releases/download/v$upsun_tag/upsun_${upsun_tag}_windows_amd64.zip"
|
|
||||||
Get-File -Url $url -OutFile $bin_dir\upsun.zip > $null 2>&1
|
|
||||||
Expand-Archive -Path $bin_dir\upsun.zip -DestinationPath $bin_dir\upsun -Force > $null 2>&1
|
|
||||||
if (Test-Path $bin_dir\upsun\upsun.exe) {
|
|
||||||
Move-Item -Path $bin_dir\upsun\upsun.exe -Destination $bin_dir\upsun.exe -Force
|
|
||||||
Copy-Item -Path $bin_dir\upsun.exe -Destination $bin_dir\upsun-cli.exe > $null 2>&1
|
|
||||||
Add-ToProfile $current_profile 'upsun' "New-Alias upsun $bin_dir\upsun.exe"
|
|
||||||
Add-ToProfile $current_profile 'upsun_cli' "New-Alias upsun-cli $bin_dir\upsun-cli.exe"
|
|
||||||
$tool_version = Get-ToolVersion upsun "--version"
|
|
||||||
Add-Log $tick "upsun-cli" "Added upsun-cli $tool_version"
|
|
||||||
} else {
|
|
||||||
Add-Log $cross "upsun-cli" "Could not setup upsun-cli"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,49 +0,0 @@
|
|||||||
get_upsun_tag() {
|
|
||||||
local upsun_tag=$1
|
|
||||||
if [ "$upsun_tag" = "latest" ]; then
|
|
||||||
get -s -n "" https://github.com/upsun/cli/releases/latest 2<&1 | grep -m 1 -Eo "tag/v[0-9]+(\.[0-9]+)*" | head -n 1 | cut -d '/' -f 2
|
|
||||||
else
|
|
||||||
echo "v$upsun_tag"
|
|
||||||
fi
|
|
||||||
}
|
|
||||||
|
|
||||||
add_upsun_helper() {
|
|
||||||
local upsun_tag=$1
|
|
||||||
local install_dir=/usr/local/bin
|
|
||||||
local os
|
|
||||||
local arch
|
|
||||||
os="$(uname -s | tr '[:upper:]' '[:lower:]')"
|
|
||||||
arch="$(uname -m)"
|
|
||||||
case "$arch" in
|
|
||||||
aarch64*|armv8*|arm64) arch="arm64" ;;
|
|
||||||
x86_64|amd64) arch="amd64" ;;
|
|
||||||
esac
|
|
||||||
if [ "$os" = "darwin" ]; then
|
|
||||||
arch="all"
|
|
||||||
install_dir=${brew_prefix:?}/bin
|
|
||||||
fi
|
|
||||||
get -q -n /tmp/upsun.tar.gz "https://github.com/upsun/cli/releases/download/$upsun_tag/upsun_${upsun_tag#v}_${os}_${arch}.tar.gz"
|
|
||||||
mkdir -p /tmp/upsun
|
|
||||||
tar -xzf /tmp/upsun.tar.gz -C /tmp/upsun
|
|
||||||
sudo mv /tmp/upsun/upsun "$install_dir"/upsun
|
|
||||||
sudo chmod a+x "$install_dir"/upsun
|
|
||||||
rm -rf /tmp/upsun /tmp/upsun.tar.gz
|
|
||||||
}
|
|
||||||
|
|
||||||
add_upsun() {
|
|
||||||
local upsun_tag="${1/v/}"
|
|
||||||
if ! [[ "$upsun_tag" =~ ^[0-9]+(\.[0-9]+)*$ || "$upsun_tag" == 'latest' ]]; then
|
|
||||||
add_log "${cross:?}" "upsun-cli" "Version '$upsun_tag' is not valid for upsun-cli"
|
|
||||||
else
|
|
||||||
upsun_tag="$(get_upsun_tag "$upsun_tag")"
|
|
||||||
add_upsun_helper "$upsun_tag" >/dev/null 2>&1
|
|
||||||
upsun_path="$(command -v upsun)"
|
|
||||||
if [[ -n "$upsun_path" ]]; then
|
|
||||||
sudo ln -s "$upsun_path" "${tool_path_dir:?}"/upsun-cli
|
|
||||||
tool_version=$(get_tool_version "upsun" "--version")
|
|
||||||
add_log "${tick:?}" "upsun-cli" "Added upsun-cli $tool_version"
|
|
||||||
else
|
|
||||||
add_log "${cross:?}" "upsun-cli" "Could not setup upsun-cli"
|
|
||||||
fi
|
|
||||||
fi
|
|
||||||
}
|
|
||||||
+8
-31
@@ -5,9 +5,8 @@ export curl_opts=(-sL)
|
|||||||
export old_versions="5.[3-5]"
|
export old_versions="5.[3-5]"
|
||||||
export jit_versions="8.[0-9]"
|
export jit_versions="8.[0-9]"
|
||||||
export php_builder_versions="8.[3-9]"
|
export php_builder_versions="8.[3-9]"
|
||||||
export nightly_versions="8.[7-9]"
|
export nightly_versions="8.[6-9]"
|
||||||
export xdebug3_versions="7.[2-4]|8.[0-9]"
|
export xdebug3_versions="7.[2-4]|8.[0-9]"
|
||||||
export no_asan_builds="5.[3-6]|7.[0-4]"
|
|
||||||
export latest="releases/latest/download"
|
export latest="releases/latest/download"
|
||||||
export github="https://github.com/shivammathur"
|
export github="https://github.com/shivammathur"
|
||||||
export jsdeliver="https://cdn.jsdelivr.net/gh/shivammathur"
|
export jsdeliver="https://cdn.jsdelivr.net/gh/shivammathur"
|
||||||
@@ -66,10 +65,10 @@ check_builds_cache_runner() {
|
|||||||
local pid=$PPID executable
|
local pid=$PPID executable
|
||||||
while [[ "$pid" =~ ^[0-9]+$ && "$pid" -gt 1 ]]; do
|
while [[ "$pid" =~ ^[0-9]+$ && "$pid" -gt 1 ]]; do
|
||||||
executable="$(readlink -f "/proc/$pid/exe")" || return 1
|
executable="$(readlink -f "/proc/$pid/exe")" || return 1
|
||||||
if [[ "$executable" = */bin/Runner.Worker || "$executable" = */bin/Runner.Worker.exe ]]; then
|
if [[ "$executable" = */bin/Runner.Worker ]]; then
|
||||||
jq -e --arg name "${RUNNER_NAME:-}" \
|
jq -e --arg name "${RUNNER_NAME:-}" \
|
||||||
'(.AgentName // .agentName) | . == $name and test("^(blacksmith|depot|nsc-runner)-")' \
|
'.AgentName == $name and (.AgentName | test("^(blacksmith|depot)-"))' \
|
||||||
"${executable%/bin/*}/.runner" >/dev/null 2>&1
|
"${executable%/bin/Runner.Worker}/.runner" >/dev/null 2>&1
|
||||||
return $?
|
return $?
|
||||||
fi
|
fi
|
||||||
pid="$(awk '$1 == "PPid:" {print $2}' "/proc/$pid/status")" || return 1
|
pid="$(awk '$1 == "PPid:" {print $2}' "/proc/$pid/status")" || return 1
|
||||||
@@ -77,27 +76,16 @@ check_builds_cache_runner() {
|
|||||||
return 1
|
return 1
|
||||||
}
|
}
|
||||||
|
|
||||||
# Function to configure environment for ASAN builds.
|
|
||||||
configure_asan() {
|
|
||||||
use_builds_cache=false
|
|
||||||
update=true
|
|
||||||
add_env ASAN_OPTIONS "${ASAN_OPTIONS:-detect_leaks=0}"
|
|
||||||
add_env UBSAN_OPTIONS "${UBSAN_OPTIONS:-halt_on_error=1}"
|
|
||||||
add_env ZEND_DONT_UNLOAD_MODULES "${ZEND_DONT_UNLOAD_MODULES:-1}"
|
|
||||||
add_env USE_ZEND_ALLOC "${USE_ZEND_ALLOC:-0}"
|
|
||||||
}
|
|
||||||
|
|
||||||
# Function to read env inputs.
|
# Function to read env inputs.
|
||||||
read_env() {
|
read_env() {
|
||||||
if [[ "${SETUP_PHP_TRACE:-0}" =~ ^[12]$ ]]; then
|
if [[ "${SETUP_PHP_TRACE:-0}" =~ ^[12]$ ]]; then
|
||||||
set -x
|
set -x
|
||||||
fi
|
fi
|
||||||
update="${update:-${UPDATE:-false}}"
|
update="${update:-${UPDATE:-false}}"
|
||||||
use_builds_cache="${use_builds_cache:-${use_package_cache:-}}"
|
|
||||||
[ "${debug:-${DEBUG:-false}}" = "true" ] && debug=debug && update=true || debug=release
|
[ "${debug:-${DEBUG:-false}}" = "true" ] && debug=debug && update=true || debug=release
|
||||||
[[ "${phpts:-${PHPTS:-nts}}" = "ts" || "${phpts:-${PHPTS:-nts}}" = "zts" ]] && ts=zts && update=true || ts=nts
|
[[ "${phpts:-${PHPTS:-nts}}" = "ts" || "${phpts:-${PHPTS:-nts}}" = "zts" ]] && ts=zts && update=true || ts=nts
|
||||||
[[ "${asan:-${ASAN:-false}}" = "true" ]] && asan=asan && configure_asan || asan=
|
|
||||||
fail_fast="${fail_fast:-${FAIL_FAST:-false}}"
|
fail_fast="${fail_fast:-${FAIL_FAST:-false}}"
|
||||||
|
use_builds_cache="${use_builds_cache:-${use_package_cache:-}}"
|
||||||
[[ ( -z "$ImageOS" && -z "$ImageVersion" ) ||
|
[[ ( -z "$ImageOS" && -z "$ImageVersion" ) ||
|
||||||
( -n "$RUNNER_ENVIRONMENT" && "$RUNNER_ENVIRONMENT" = "self-hosted" ) ||
|
( -n "$RUNNER_ENVIRONMENT" && "$RUNNER_ENVIRONMENT" = "self-hosted" ) ||
|
||||||
-n "$ACT" || -n "$CONTAINER" ]] && _runner=self-hosted || _runner=github
|
-n "$ACT" || -n "$CONTAINER" ]] && _runner=self-hosted || _runner=github
|
||||||
@@ -105,9 +93,8 @@ read_env() {
|
|||||||
if [[ $_runner = "self-hosted" && "${use_builds_cache:-false}" = "true" ]]; then
|
if [[ $_runner = "self-hosted" && "${use_builds_cache:-false}" = "true" ]]; then
|
||||||
runner=github
|
runner=github
|
||||||
if [[ "${ID:-}" = "ubuntu" && -z "$ACT" && -z "$CONTAINER" &&
|
if [[ "${ID:-}" = "ubuntu" && -z "$ACT" && -z "$CONTAINER" &&
|
||||||
( -n "${BLACKSMITH_VM_ID:-}" || "${RUNNER_NAME:-}" =~ ^(blacksmith|depot|nsc-runner)- ) ]] && check_builds_cache_runner; then
|
( -n "${BLACKSMITH_VM_ID:-}" || "${RUNNER_NAME:-}" =~ ^(blacksmith|depot)- ) ]] && check_builds_cache_runner; then
|
||||||
_runner=github
|
_runner=github
|
||||||
# shellcheck disable=SC2034
|
|
||||||
builds_cache_warning=true
|
builds_cache_warning=true
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
@@ -133,7 +120,6 @@ read_env() {
|
|||||||
export runner
|
export runner
|
||||||
export update
|
export update
|
||||||
export ts
|
export ts
|
||||||
export asan
|
|
||||||
export tool_path_dir
|
export tool_path_dir
|
||||||
export tool_cache_path_dir
|
export tool_cache_path_dir
|
||||||
}
|
}
|
||||||
@@ -199,7 +185,6 @@ verify_checksum() {
|
|||||||
# mode: -s pipe to stdout, -v save file and return status code
|
# mode: -s pipe to stdout, -v save file and return status code
|
||||||
# execute: -e save file as executable
|
# execute: -e save file as executable
|
||||||
get() {
|
get() {
|
||||||
local download_status=1 status_code=000
|
|
||||||
mode=$1
|
mode=$1
|
||||||
execute=$2
|
execute=$2
|
||||||
file_path=$3
|
file_path=$3
|
||||||
@@ -219,20 +204,12 @@ get() {
|
|||||||
trap 'release_lock "$lock_path"' EXIT SIGINT SIGTERM
|
trap 'release_lock "$lock_path"' EXIT SIGINT SIGTERM
|
||||||
fi
|
fi
|
||||||
for link in "${links[@]}"; do
|
for link in "${links[@]}"; do
|
||||||
if status_code=$(sudo curl -w "%{http_code}" -o "$file_path" "${curl_opts[@]}" "$link"); then
|
status_code=$(sudo curl -w "%{http_code}" -o "$file_path" "${curl_opts[@]}" "$link")
|
||||||
if [ "$status_code" = "200" ]; then
|
[ "$status_code" = "200" ] && break
|
||||||
download_status=0
|
|
||||||
break
|
|
||||||
fi
|
|
||||||
else
|
|
||||||
status_code=000
|
|
||||||
fi
|
|
||||||
done
|
done
|
||||||
[ "$download_status" -ne 0 ] && sudo rm -f "$file_path"
|
|
||||||
[[ "$execute" = "-e" && -e "$file_path" ]] && sudo chmod a+x "$file_path"
|
[[ "$execute" = "-e" && -e "$file_path" ]] && sudo chmod a+x "$file_path"
|
||||||
[ "$mode" = "-v" ] && echo "$status_code"
|
[ "$mode" = "-v" ] && echo "$status_code"
|
||||||
[ "$runner" = "self-hosted" ] && release_lock "$lock_path"
|
[ "$runner" = "self-hosted" ] && release_lock "$lock_path"
|
||||||
return "$download_status"
|
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -3,7 +3,7 @@ param (
|
|||||||
[ValidateNotNull()]
|
[ValidateNotNull()]
|
||||||
[ValidateLength(1, [int]::MaxValue)]
|
[ValidateLength(1, [int]::MaxValue)]
|
||||||
[string]
|
[string]
|
||||||
$version = '8.6',
|
$version = '8.4',
|
||||||
[Parameter(Position = 1, Mandatory = $true)]
|
[Parameter(Position = 1, Mandatory = $true)]
|
||||||
[ValidateNotNull()]
|
[ValidateNotNull()]
|
||||||
[ValidateLength(1, [int]::MaxValue)]
|
[ValidateLength(1, [int]::MaxValue)]
|
||||||
@@ -20,8 +20,6 @@ Function Step-Log($message) {
|
|||||||
Function Add-Log($mark, $subject, $message) {
|
Function Add-Log($mark, $subject, $message) {
|
||||||
if ($mark -eq $tick) {
|
if ($mark -eq $tick) {
|
||||||
printf "\033[32;1m%s \033[0m\033[34;1m%s \033[0m\033[90;1m%s \033[0m\n" $mark $subject $message
|
printf "\033[32;1m%s \033[0m\033[34;1m%s \033[0m\033[90;1m%s \033[0m\n" $mark $subject $message
|
||||||
} elseif ($mark -eq "!") {
|
|
||||||
printf "\033[33;1m%s \033[0m\033[34;1m%s \033[0m\033[90;1m%s \033[0m\n" $mark $subject $message
|
|
||||||
} else {
|
} else {
|
||||||
printf "\033[31;1m%s \033[0m\033[34;1m%s \033[0m\033[90;1m%s \033[0m\n" $mark $subject $message
|
printf "\033[31;1m%s \033[0m\033[34;1m%s \033[0m\033[90;1m%s \033[0m\n" $mark $subject $message
|
||||||
if($env:fail_fast -eq 'true') {
|
if($env:fail_fast -eq 'true') {
|
||||||
@@ -343,7 +341,7 @@ $php_manifest = $null
|
|||||||
$current_profile = "$env:TEMP\setup-php.ps1"
|
$current_profile = "$env:TEMP\setup-php.ps1"
|
||||||
$ProgressPreference = 'SilentlyContinue'
|
$ProgressPreference = 'SilentlyContinue'
|
||||||
$jit_versions = '8.[0-9]'
|
$jit_versions = '8.[0-9]'
|
||||||
$nightly_versions = '8.[7-9]'
|
$nightly_versions = '8.[6-9]'
|
||||||
$xdebug3_versions = "7.[2-4]|8.[0-9]"
|
$xdebug3_versions = "7.[2-4]|8.[0-9]"
|
||||||
$enable_extensions = ('openssl', 'curl', 'mbstring')
|
$enable_extensions = ('openssl', 'curl', 'mbstring')
|
||||||
|
|
||||||
@@ -439,7 +437,7 @@ if($version -eq 'pre') {
|
|||||||
}
|
}
|
||||||
if ($null -eq $installed -or -not("$($installed.Version).".StartsWith(($version -replace '^(\d+(\.\d+)*).*', '$1.'))) -or $ts -ne $installed.ThreadSafe) {
|
if ($null -eq $installed -or -not("$($installed.Version).".StartsWith(($version -replace '^(\d+(\.\d+)*).*', '$1.'))) -or $ts -ne $installed.ThreadSafe) {
|
||||||
if ($version -lt '7.0' -and ($null -eq (Get-Module -ListAvailable -Name VcRedist))) {
|
if ($version -lt '7.0' -and ($null -eq (Get-Module -ListAvailable -Name VcRedist))) {
|
||||||
Install-PSPackage VcRedist VcRedist-4.1.527\VcRedist\VcRedist "$github/aaronparker/VcRedist/archive/v4.1.527.zip" Get-VcList >$null 2>&1
|
Install-PSPackage VcRedist VcRedist-main\VcRedist\VcRedist "$github/aaronparker/VcRedist/archive/main.zip" Get-VcList >$null 2>&1
|
||||||
}
|
}
|
||||||
try {
|
try {
|
||||||
if ($version -match $nightly_versions) {
|
if ($version -match $nightly_versions) {
|
||||||
|
|||||||
+39
-53
@@ -1,12 +1,9 @@
|
|||||||
import {fileURLToPath} from 'url';
|
|
||||||
import path from 'path';
|
import path from 'path';
|
||||||
import fs from 'fs';
|
import fs from 'fs';
|
||||||
import * as cv from 'compare-versions';
|
import * as cv from 'compare-versions';
|
||||||
import * as fetch from './fetch.js';
|
import * as fetch from './fetch';
|
||||||
import * as packagist from './packagist.js';
|
import * as packagist from './packagist';
|
||||||
import * as utils from './utils.js';
|
import * as utils from './utils';
|
||||||
|
|
||||||
const dirname = path.dirname(fileURLToPath(import.meta.url));
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Valid function names for custom tool handlers
|
* Valid function names for custom tool handlers
|
||||||
@@ -51,7 +48,6 @@ export interface ToolData {
|
|||||||
url: string;
|
url: string;
|
||||||
uri?: string;
|
uri?: string;
|
||||||
error?: string;
|
error?: string;
|
||||||
fallback?: ToolFallback;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -76,19 +72,8 @@ interface ToolConfig {
|
|||||||
version_parameter?: string;
|
version_parameter?: string;
|
||||||
version_prefix?: string;
|
version_prefix?: string;
|
||||||
packagist?: string;
|
packagist?: string;
|
||||||
fallback?: ToolFallback;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
type ToolFallback = Pick<
|
|
||||||
ToolConfig,
|
|
||||||
| 'repository'
|
|
||||||
| 'domain'
|
|
||||||
| 'extension'
|
|
||||||
| 'fetch_latest'
|
|
||||||
| 'version_parameter'
|
|
||||||
| 'version_prefix'
|
|
||||||
> & {type: 'phar'};
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Regex to match a checksum suffix in a tool release - tool:version@sha256:<hash>
|
* Regex to match a checksum suffix in a tool release - tool:version@sha256:<hash>
|
||||||
*/
|
*/
|
||||||
@@ -156,13 +141,21 @@ interface GitHubRef {
|
|||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Deployer manifest entry
|
||||||
|
*/
|
||||||
|
interface DeployerManifestEntry {
|
||||||
|
version: string;
|
||||||
|
url: string;
|
||||||
|
}
|
||||||
|
|
||||||
export function skipGitHubAuthForComposerVersion(version: string): boolean {
|
export function skipGitHubAuthForComposerVersion(version: string): boolean {
|
||||||
if (!/^\d+\.\d+\.\d+(?:-[\w-]+)?$/.test(version)) {
|
if (!/^\d+\.\d+\.\d+(?:-[\w-]+)?$/.test(version)) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
return fs
|
return fs
|
||||||
.readFileSync(
|
.readFileSync(
|
||||||
path.join(dirname, '../src/configs/composer-gh-auth-no-op'),
|
path.join(__dirname, '../src/configs/composer-gh-auth-no-op'),
|
||||||
'utf8'
|
'utf8'
|
||||||
)
|
)
|
||||||
.trim()
|
.trim()
|
||||||
@@ -421,23 +414,7 @@ export async function addPackage(data: ToolData): Promise<string> {
|
|||||||
const args = [parts[1], data.release, parts[0] + '/', data.scope]
|
const args = [parts[1], data.release, parts[0] + '/', data.scope]
|
||||||
.map(a => utils.safeArg(a, data.os))
|
.map(a => utils.safeArg(a, data.os))
|
||||||
.join(' ');
|
.join(' ');
|
||||||
if (!data.fallback) return command + args;
|
return command + args;
|
||||||
const fallback = await getData(
|
|
||||||
data.release.replace(/\.\*$/, ''),
|
|
||||||
data.php_version,
|
|
||||||
data.os,
|
|
||||||
data.fallback
|
|
||||||
);
|
|
||||||
// A failed version lookup must not prevent a successful Composer install.
|
|
||||||
if (fallback.error) return command + args;
|
|
||||||
return (
|
|
||||||
command +
|
|
||||||
args +
|
|
||||||
' ' +
|
|
||||||
utils.safeArg(fallback.url, data.os) +
|
|
||||||
' ' +
|
|
||||||
(fallback.version_parameter || '""')
|
|
||||||
);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -537,17 +514,29 @@ export async function addComposer(data: ToolData): Promise<string> {
|
|||||||
* @param data
|
* @param data
|
||||||
*/
|
*/
|
||||||
export async function addDeployer(data: ToolData): Promise<string> {
|
export async function addDeployer(data: ToolData): Promise<string> {
|
||||||
const github_url = await getUrl({
|
if (data.version === 'latest') {
|
||||||
...data,
|
data.url = data.domain + '/deployer.phar';
|
||||||
domain: data.github,
|
} else {
|
||||||
prefix: 'releases',
|
const manifest = await fetch.fetch('https://deployer.org/manifest.json');
|
||||||
verb: 'download'
|
const version_data: Record<string, DeployerManifestEntry> = JSON.parse(
|
||||||
});
|
manifest.data
|
||||||
const source_url =
|
);
|
||||||
data.version === 'latest'
|
const version_key: string | undefined = Object.keys(version_data).find(
|
||||||
? `${data.domain}/deployer.phar`
|
(key: string) => {
|
||||||
: `${data.domain}/releases/v${data.version}/deployer.phar`;
|
return version_data[key].version === data.version;
|
||||||
data.url = `${github_url},${source_url}`;
|
}
|
||||||
|
);
|
||||||
|
if (version_key) {
|
||||||
|
data.url = version_data[version_key].url;
|
||||||
|
} else {
|
||||||
|
return await utils.addLog(
|
||||||
|
'$cross',
|
||||||
|
'deployer',
|
||||||
|
'Version missing in deployer manifest',
|
||||||
|
data.os
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
return await addArchive(data);
|
return await addArchive(data);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -681,10 +670,9 @@ export async function addWPCLI(data: ToolData): Promise<string> {
|
|||||||
export async function getData(
|
export async function getData(
|
||||||
release: string,
|
release: string,
|
||||||
php_version: string,
|
php_version: string,
|
||||||
os: string,
|
os: string
|
||||||
overrides: ToolConfig = {}
|
|
||||||
): Promise<ToolData> {
|
): Promise<ToolData> {
|
||||||
const json_file_path = path.join(dirname, '../src/configs/tools.json');
|
const json_file_path = path.join(__dirname, '../src/configs/tools.json');
|
||||||
const json_file: string = fs.readFileSync(json_file_path, 'utf8');
|
const json_file: string = fs.readFileSync(json_file_path, 'utf8');
|
||||||
const json_objects: Record<string, ToolConfig> = JSON.parse(json_file);
|
const json_objects: Record<string, ToolConfig> = JSON.parse(json_file);
|
||||||
release = release.replace(/\s+/g, '');
|
release = release.replace(/\s+/g, '');
|
||||||
@@ -714,7 +702,6 @@ export async function getData(
|
|||||||
config = {tool};
|
config = {tool};
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
config = {...config, ...overrides};
|
|
||||||
const github = 'https://github.com';
|
const github = 'https://github.com';
|
||||||
const domain = config.domain ?? github;
|
const domain = config.domain ?? github;
|
||||||
const data: ToolData = {
|
const data: ToolData = {
|
||||||
@@ -740,8 +727,7 @@ export async function getData(
|
|||||||
packagist: config.packagist ?? config.repository ?? '',
|
packagist: config.packagist ?? config.repository ?? '',
|
||||||
type: config.type,
|
type: config.type,
|
||||||
function: config.function,
|
function: config.function,
|
||||||
alias: config.alias,
|
alias: config.alias
|
||||||
fallback: config.fallback
|
|
||||||
};
|
};
|
||||||
data.checksum = checksum_data.checksum;
|
data.checksum = checksum_data.checksum;
|
||||||
data.error = checksum_data.error;
|
data.error = checksum_data.error;
|
||||||
|
|||||||
+9
-9
@@ -1,10 +1,7 @@
|
|||||||
import {fileURLToPath} from 'url';
|
|
||||||
import fs from 'fs';
|
import fs from 'fs';
|
||||||
import * as path from 'path';
|
import * as path from 'path';
|
||||||
import * as core from './core.js';
|
import * as core from './core';
|
||||||
import * as fetch from './fetch.js';
|
import * as fetch from './fetch';
|
||||||
|
|
||||||
const dirname = path.dirname(fileURLToPath(import.meta.url));
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Function to read environment variable and return a string value.
|
* Function to read environment variable and return a string value.
|
||||||
@@ -91,9 +88,12 @@ export async function parseVersion(version: string): Promise<string> {
|
|||||||
if (!/^\d+(\.\d+){0,2}$/.test(version)) {
|
if (!/^\d+(\.\d+){0,2}$/.test(version)) {
|
||||||
throw new Error(`Invalid PHP version: ${version.slice(0, 20)}`);
|
throw new Error(`Invalid PHP version: ${version.slice(0, 20)}`);
|
||||||
}
|
}
|
||||||
return version.includes('.')
|
switch (true) {
|
||||||
? version.split('.').slice(0, 2).join('.')
|
case version.length > 1:
|
||||||
: version + '.0';
|
return version.slice(0, 3);
|
||||||
|
default:
|
||||||
|
return version + '.0';
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -480,7 +480,7 @@ export async function customPackage(
|
|||||||
const pkg_name: string = pkg.replace(/\d+|(pdo|pecl)[_-]|[_-]db2/, '');
|
const pkg_name: string = pkg.replace(/\d+|(pdo|pecl)[_-]|[_-]db2/, '');
|
||||||
const script_extension: string = await scriptExtension(os);
|
const script_extension: string = await scriptExtension(os);
|
||||||
const script: string = path.join(
|
const script: string = path.join(
|
||||||
dirname,
|
__dirname,
|
||||||
'../src/scripts/' + type + '/' + pkg_name + script_extension
|
'../src/scripts/' + type + '/' + pkg_name + script_extension
|
||||||
);
|
);
|
||||||
const command: string = await getCommand(os, pkg_name);
|
const command: string = await getCommand(os, pkg_name);
|
||||||
|
|||||||
+2
-2
@@ -5,8 +5,8 @@
|
|||||||
"lib": [
|
"lib": [
|
||||||
"ES2025"
|
"ES2025"
|
||||||
],
|
],
|
||||||
"module": "NodeNext",
|
"module": "Node20",
|
||||||
"moduleResolution": "NodeNext",
|
"moduleResolution": "Node16",
|
||||||
"noImplicitAny": true,
|
"noImplicitAny": true,
|
||||||
"outDir": "./lib",
|
"outDir": "./lib",
|
||||||
"removeComments": true,
|
"removeComments": true,
|
||||||
|
|||||||
Reference in New Issue
Block a user