mirror of
https://github.com/shivammathur/setup-php.git
synced 2025-07-04 22:23:16 +07:00
Compare commits
99 Commits
Author | SHA1 | Date | |
---|---|---|---|
1a18b2267f | |||
e9704839e9 | |||
5178fac634 | |||
388883d4bf | |||
cae6d06e69 | |||
89f4f7e8be | |||
d2efbcd126 | |||
98e3af0bff | |||
e8836c6d46 | |||
9068f2e46f | |||
5bbbd3fdf6 | |||
7622357ff1 | |||
6652a09da6 | |||
48fb8e1194 | |||
bbc6e9069b | |||
37dcd1cf8c | |||
12b1efad4b | |||
0575a32108 | |||
71b0e09dbc | |||
edff21f0a6 | |||
22035eb75b | |||
b556cf7292 | |||
f99a9d4624 | |||
a49dfe8457 | |||
7ff9ac44b4 | |||
7aff4d7a22 | |||
633321754d | |||
40a4cb064f | |||
45410ae8f0 | |||
56ad5977ba | |||
6353d20df2 | |||
e04e1d97f0 | |||
52685a348b | |||
44d81f9830 | |||
401bdecb71 | |||
aa82ffc68f | |||
7e03c76ef2 | |||
16011a795d | |||
66f24470dc | |||
e57ea715eb | |||
e8ba27f3d2 | |||
945c34c175 | |||
c8c64c6cf9 | |||
0d3f92f127 | |||
4979d5b484 | |||
0d9a1ba5ae | |||
3ede7656cb | |||
f3cdc074ce | |||
109db648f1 | |||
3ccc00eece | |||
0f688a10cb | |||
3312ea6101 | |||
ce49f82dd8 | |||
cf5cd90b4c | |||
cdb037c2a4 | |||
261f13a7c5 | |||
9eaa66d89b | |||
da9dfe4a71 | |||
a863ab6d3d | |||
050cb8061b | |||
3fda17f3fa | |||
1a2cb4f872 | |||
4969814b69 | |||
07f2ea7d02 | |||
a1c17b4b18 | |||
3eda583472 | |||
74d43be8a3 | |||
aa1fe473f9 | |||
a92acf13e4 | |||
0533892eb4 | |||
43fb4ad30e | |||
b88a8c89d1 | |||
36d7f6c7c5 | |||
a1a52db9f3 | |||
88e54b10ca | |||
203099e007 | |||
4e9ea33f8d | |||
68ba5ba947 | |||
99af32331c | |||
810a92a9b0 | |||
9c760dd6e2 | |||
dea233d702 | |||
787285e08a | |||
ee065c5938 | |||
dbc8ba0844 | |||
fe9e23a16a | |||
16de39288a | |||
67ff09364d | |||
1dfe0dc4a4 | |||
6f83b63bf5 | |||
f0db57dcab | |||
6cba851606 | |||
209324abab | |||
846135c190 | |||
32d20248ae | |||
ba8485d89f | |||
97721a77b9 | |||
7dfee150df | |||
251330ef7f |
@ -1,7 +1,7 @@
|
|||||||
{
|
{
|
||||||
"env": { "node": true, "jest": true },
|
"env": { "node": true, "jest": true },
|
||||||
"parser": "@typescript-eslint/parser",
|
"parser": "@typescript-eslint/parser",
|
||||||
"parserOptions": { "ecmaVersion": 2019, "sourceType": "module" },
|
"parserOptions": { "ecmaVersion": 2021, "sourceType": "module" },
|
||||||
"extends": [
|
"extends": [
|
||||||
"eslint:recommended",
|
"eslint:recommended",
|
||||||
"plugin:@typescript-eslint/eslint-recommended",
|
"plugin:@typescript-eslint/eslint-recommended",
|
||||||
|
7
.github/dependabot.yml
vendored
Normal file
7
.github/dependabot.yml
vendored
Normal file
@ -0,0 +1,7 @@
|
|||||||
|
version: 2
|
||||||
|
updates:
|
||||||
|
- package-ecosystem: "github-actions"
|
||||||
|
directory: "/"
|
||||||
|
target-branch: "develop"
|
||||||
|
schedule:
|
||||||
|
interval: "weekly"
|
13
.github/workflows/codeql.yml
vendored
13
.github/workflows/codeql.yml
vendored
@ -3,8 +3,15 @@ on:
|
|||||||
workflow_dispatch:
|
workflow_dispatch:
|
||||||
schedule:
|
schedule:
|
||||||
- cron: '0 15 * * 6'
|
- cron: '0 15 * * 6'
|
||||||
|
permissions:
|
||||||
|
contents: read
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
codeql:
|
codeql:
|
||||||
|
permissions:
|
||||||
|
actions: read # for github/codeql-action/init to get workflow details
|
||||||
|
contents: read # for actions/checkout to fetch code
|
||||||
|
security-events: write # for github/codeql-action/autobuild to send a status report
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout
|
- name: Checkout
|
||||||
@ -13,13 +20,13 @@ jobs:
|
|||||||
fetch-depth: 2
|
fetch-depth: 2
|
||||||
|
|
||||||
- name: Initialize CodeQL
|
- name: Initialize CodeQL
|
||||||
uses: github/codeql-action/init@v1
|
uses: github/codeql-action/init@v2
|
||||||
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@v1
|
uses: github/codeql-action/autobuild@v2
|
||||||
|
|
||||||
- name: Perform CodeQL Analysis
|
- name: Perform CodeQL Analysis
|
||||||
uses: github/codeql-action/analyze@v1
|
uses: github/codeql-action/analyze@v2
|
||||||
|
11
.github/workflows/docs.yml
vendored
11
.github/workflows/docs.yml
vendored
@ -3,14 +3,19 @@ on:
|
|||||||
workflow_dispatch:
|
workflow_dispatch:
|
||||||
schedule:
|
schedule:
|
||||||
- cron: '0 15 * * 6'
|
- cron: '0 15 * * 6'
|
||||||
|
permissions:
|
||||||
|
contents: read
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
create:
|
create:
|
||||||
|
permissions:
|
||||||
|
contents: none
|
||||||
name: Create
|
name: Create
|
||||||
runs-on: ${{ matrix.operating-system }}
|
runs-on: ${{ matrix.operating-system }}
|
||||||
strategy:
|
strategy:
|
||||||
fail-fast: false
|
fail-fast: false
|
||||||
matrix:
|
matrix:
|
||||||
operating-system: [ubuntu-20.04, ubuntu-18.04, windows-2022, macos-11]
|
operating-system: [ubuntu-22.04, ubuntu-20.04, ubuntu-18.04, windows-2022, macos-11]
|
||||||
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']
|
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']
|
||||||
steps:
|
steps:
|
||||||
- name: Setup PHP
|
- name: Setup PHP
|
||||||
@ -45,6 +50,8 @@ jobs:
|
|||||||
name: lists
|
name: lists
|
||||||
path: php${{ matrix.php-versions }}-${{ matrix.operating-system }}.md
|
path: php${{ matrix.php-versions }}-${{ matrix.operating-system }}.md
|
||||||
update:
|
update:
|
||||||
|
permissions:
|
||||||
|
contents: write # for Git to git push
|
||||||
name: Update
|
name: Update
|
||||||
needs: create
|
needs: create
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
@ -63,7 +70,7 @@ jobs:
|
|||||||
git config --local user.name "${{ github.repository_owner }}"
|
git config --local user.name "${{ github.repository_owner }}"
|
||||||
- name: Combine
|
- name: Combine
|
||||||
run: |
|
run: |
|
||||||
for os in ubuntu-20.04 ubuntu-18.04 windows-2022 windows-2019 macos-11 macos-10.15; do
|
for os in ubuntu-22.04 ubuntu-20.04 ubuntu-18.04 windows-2022 windows-2019 macos-11 macos-10.15; do
|
||||||
echo "These are extensions which are loaded by default on the following PHP versions. More extensions which are available as packages and available on pecl are supported by setup-php. Refer to [php extension support](https://github.com/shivammathur/setup-php#heavy_plus_sign-php-extension-support) for more details." > Php-extensions-loaded-on-"$os".md
|
echo "These are extensions which are loaded by default on the following PHP versions. More extensions which are available as packages and available on pecl are supported by setup-php. Refer to [php extension support](https://github.com/shivammathur/setup-php#heavy_plus_sign-php-extension-support) for more details." > Php-extensions-loaded-on-"$os".md
|
||||||
for version in 5.3 5.4 5.5 5.6 7.0 7.1 7.2 7.3 7.4 8.0 8.1 8.2; do
|
for version in 5.3 5.4 5.5 5.6 7.0 7.1 7.2 7.3 7.4 8.0 8.1 8.2; do
|
||||||
if [ "$os" = "macos-10.15" ]; then
|
if [ "$os" = "macos-10.15" ]; then
|
||||||
|
7
.github/workflows/node.yml
vendored
7
.github/workflows/node.yml
vendored
@ -16,6 +16,9 @@ on:
|
|||||||
paths-ignore:
|
paths-ignore:
|
||||||
- '**.md'
|
- '**.md'
|
||||||
- 'examples/**'
|
- 'examples/**'
|
||||||
|
permissions:
|
||||||
|
contents: read
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
run:
|
run:
|
||||||
name: Run
|
name: Run
|
||||||
@ -31,7 +34,7 @@ jobs:
|
|||||||
fetch-depth: 2
|
fetch-depth: 2
|
||||||
|
|
||||||
- name: Setup Node.js 16.x
|
- name: Setup Node.js 16.x
|
||||||
uses: actions/setup-node@v1
|
uses: actions/setup-node@v3
|
||||||
with:
|
with:
|
||||||
node-version: 16.x
|
node-version: 16.x
|
||||||
|
|
||||||
@ -51,7 +54,7 @@ jobs:
|
|||||||
run: npm audit
|
run: npm audit
|
||||||
|
|
||||||
- name: Send Coverage
|
- name: Send Coverage
|
||||||
uses: codecov/codecov-action@v2
|
uses: codecov/codecov-action@v3
|
||||||
with:
|
with:
|
||||||
token: ${{ secrets.CODECOV_TOKEN }}
|
token: ${{ secrets.CODECOV_TOKEN }}
|
||||||
files: coverage/lcov.info
|
files: coverage/lcov.info
|
||||||
|
8
.github/workflows/php.yml
vendored
8
.github/workflows/php.yml
vendored
@ -17,6 +17,9 @@ on:
|
|||||||
paths-ignore:
|
paths-ignore:
|
||||||
- '**.md'
|
- '**.md'
|
||||||
- 'examples/**'
|
- 'examples/**'
|
||||||
|
permissions:
|
||||||
|
contents: read
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
run:
|
run:
|
||||||
name: Run
|
name: Run
|
||||||
@ -24,10 +27,10 @@ jobs:
|
|||||||
strategy:
|
strategy:
|
||||||
fail-fast: false
|
fail-fast: false
|
||||||
matrix:
|
matrix:
|
||||||
operating-system: [ubuntu-20.04, ubuntu-18.04, windows-2019, macos-latest]
|
operating-system: [ubuntu-22.04, ubuntu-20.04, ubuntu-18.04, windows-2019, macos-latest]
|
||||||
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']
|
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']
|
||||||
env:
|
env:
|
||||||
extensions: xml, opcache, xdebug, pcov
|
extensions: xml, opcache, xdebug, pcov, gd
|
||||||
key: cache-v5
|
key: cache-v5
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout
|
- name: Checkout
|
||||||
@ -67,6 +70,7 @@ jobs:
|
|||||||
- name: Testing Extensions
|
- name: Testing Extensions
|
||||||
run: |
|
run: |
|
||||||
php -m
|
php -m
|
||||||
|
php -r "if(! extension_loaded('gd')) {throw new Exception('gd not found');}"
|
||||||
php -r "if(! extension_loaded('xml')) {throw new Exception('xml not found');}"
|
php -r "if(! extension_loaded('xml')) {throw new Exception('xml not found');}"
|
||||||
php -r "if(! extension_loaded('Xdebug')) {throw new Exception('Xdebug not found');}"
|
php -r "if(! extension_loaded('Xdebug')) {throw new Exception('Xdebug not found');}"
|
||||||
php -r "if(phpversion()>=7.1 && ! extension_loaded('pcov')) {throw new Exception('PCOV not found');}"
|
php -r "if(phpversion()>=7.1 && ! extension_loaded('pcov')) {throw new Exception('PCOV not found');}"
|
||||||
|
4
.github/workflows/publish.yml
vendored
4
.github/workflows/publish.yml
vendored
@ -28,7 +28,7 @@ jobs:
|
|||||||
ref: ${{ github.event.inputs.tag }}
|
ref: ${{ github.event.inputs.tag }}
|
||||||
|
|
||||||
- name: Setup Node.js
|
- name: Setup Node.js
|
||||||
uses: actions/setup-node@v2
|
uses: actions/setup-node@v3
|
||||||
with:
|
with:
|
||||||
node-version: '16.x'
|
node-version: '16.x'
|
||||||
registry-url: https://registry.npmjs.org
|
registry-url: https://registry.npmjs.org
|
||||||
@ -46,7 +46,7 @@ jobs:
|
|||||||
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
|
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
|
||||||
|
|
||||||
- name: Change to GitHub Packages registry
|
- name: Change to GitHub Packages registry
|
||||||
uses: actions/setup-node@v2
|
uses: actions/setup-node@v3
|
||||||
with:
|
with:
|
||||||
registry-url: https://npm.pkg.github.com
|
registry-url: https://npm.pkg.github.com
|
||||||
scope: '@shivammathur'
|
scope: '@shivammathur'
|
||||||
|
2
LICENSE
2
LICENSE
@ -1,7 +1,7 @@
|
|||||||
|
|
||||||
The MIT License (MIT)
|
The MIT License (MIT)
|
||||||
|
|
||||||
Copyright (c) 2019-2021 shivammathur and contributors
|
Copyright (c) shivammathur and contributors
|
||||||
|
|
||||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||||
of this software and associated documentation files (the "Software"), to deal
|
of this software and associated documentation files (the "Software"), to deal
|
||||||
|
99
README.md
99
README.md
@ -42,6 +42,7 @@ Setup PHP with required extensions, php.ini configuration, code-coverage support
|
|||||||
- [Basic Setup](#basic-setup)
|
- [Basic Setup](#basic-setup)
|
||||||
- [Matrix Setup](#matrix-setup)
|
- [Matrix Setup](#matrix-setup)
|
||||||
- [Nightly Build Setup](#nightly-build-setup)
|
- [Nightly Build Setup](#nightly-build-setup)
|
||||||
|
- [Debug Build Setup](#debug-build-setup)
|
||||||
- [Thread Safe Setup](#thread-safe-setup)
|
- [Thread Safe Setup](#thread-safe-setup)
|
||||||
- [Force Update Setup](#force-update-setup)
|
- [Force Update Setup](#force-update-setup)
|
||||||
- [Verbose Setup](#verbose-setup)
|
- [Verbose Setup](#verbose-setup)
|
||||||
@ -51,7 +52,9 @@ Setup PHP with required extensions, php.ini configuration, code-coverage support
|
|||||||
- [JIT Configuration](#jit-configuration)
|
- [JIT Configuration](#jit-configuration)
|
||||||
- [Cache Extensions](#cache-extensions)
|
- [Cache Extensions](#cache-extensions)
|
||||||
- [Cache Composer Dependencies](#cache-composer-dependencies)
|
- [Cache Composer Dependencies](#cache-composer-dependencies)
|
||||||
- [Composer GitHub OAuth](#composer-github-oauth)
|
- [GitHub Composer Authentication](#github-composer-authentication)
|
||||||
|
- [Private Packagist Authentication](#private-packagist-authentication)
|
||||||
|
- [Manual Composer Authentication](#manual-composer-authentication)
|
||||||
- [Inline PHP Scripts](#inline-php-scripts)
|
- [Inline PHP Scripts](#inline-php-scripts)
|
||||||
- [Problem Matchers](#problem-matchers)
|
- [Problem Matchers](#problem-matchers)
|
||||||
- [Examples](#examples)
|
- [Examples](#examples)
|
||||||
@ -70,6 +73,7 @@ Both `GitHub-hosted` and `self-hosted` runners are supported by `setup-php` on t
|
|||||||
|
|
||||||
| Virtual environment | YAML workflow label | Pre-installed PHP |
|
| Virtual environment | YAML workflow label | Pre-installed PHP |
|
||||||
|----------------------|------------------------------------|------------------------|
|
|----------------------|------------------------------------|------------------------|
|
||||||
|
| Ubuntu 22.04 | `ubuntu-22.04` | `PHP 8.1` |
|
||||||
| Ubuntu 20.04 | `ubuntu-latest` or `ubuntu-20.04` | `PHP 7.4` to `PHP 8.1` |
|
| Ubuntu 20.04 | `ubuntu-latest` or `ubuntu-20.04` | `PHP 7.4` to `PHP 8.1` |
|
||||||
| Ubuntu 18.04 | `ubuntu-18.04` | `PHP 7.2` to `PHP 8.1` |
|
| Ubuntu 18.04 | `ubuntu-18.04` | `PHP 7.2` to `PHP 8.1` |
|
||||||
| Windows Server 2022 | `windows-latest` or `windows-2022` | `PHP 8.1` |
|
| Windows Server 2022 | `windows-latest` or `windows-2022` | `PHP 8.1` |
|
||||||
@ -82,12 +86,11 @@ Both `GitHub-hosted` and `self-hosted` runners are supported by `setup-php` on t
|
|||||||
|
|
||||||
| Host OS/Virtual environment | YAML workflow label |
|
| Host OS/Virtual environment | YAML workflow label |
|
||||||
|----------------------------------|----------------------------|
|
|----------------------------------|----------------------------|
|
||||||
| Ubuntu 21.04 | `self-hosted` or `Linux` |
|
| Ubuntu 22.04 | `self-hosted` or `Linux` |
|
||||||
| Ubuntu 20.04 | `self-hosted` or `Linux` |
|
| Ubuntu 20.04 | `self-hosted` or `Linux` |
|
||||||
| Ubuntu 18.04 | `self-hosted` or `Linux` |
|
| Ubuntu 18.04 | `self-hosted` or `Linux` |
|
||||||
| Debian 11 | `self-hosted` or `Linux` |
|
| Debian 11 | `self-hosted` or `Linux` |
|
||||||
| Debian 10 | `self-hosted` or `Linux` |
|
| Debian 10 | `self-hosted` or `Linux` |
|
||||||
| Debian 9 | `self-hosted` or `Linux` |
|
|
||||||
| Windows 7 and newer | `self-hosted` or `Windows` |
|
| Windows 7 and newer | `self-hosted` or `Windows` |
|
||||||
| Windows Server 2012 R2 and newer | `self-hosted` or `Windows` |
|
| Windows Server 2012 R2 and newer | `self-hosted` or `Windows` |
|
||||||
| macOS Monterey 12.x x86_64/arm64 | `self-hosted` or `macOS` |
|
| macOS Monterey 12.x x86_64/arm64 | `self-hosted` or `macOS` |
|
||||||
@ -204,8 +207,8 @@ PHP extensions can be set up using the `extensions` input. It accepts a `string`
|
|||||||
|
|
||||||
- These extensions have custom support:
|
- These extensions have custom support:
|
||||||
- `cubrid`, `pdo_cubrid` and `gearman` on `Ubuntu`.
|
- `cubrid`, `pdo_cubrid` and `gearman` on `Ubuntu`.
|
||||||
- `geos` on `Ubuntu` and `macOS`.
|
- `geos` and `event` on `Ubuntu` and `macOS`.
|
||||||
- `blackfire`, `couchbase`, `ioncube`, `oci8`, `pdo_firebird`, `pdo_oci`, `pecl_http`, `phalcon3` and `phalcon4` on all supported OS.
|
- `blackfire`, `couchbase`, `ioncube`, `oci8`, `pdo_firebird`, `pdo_oci`, `pecl_http`, `phalcon3`, `phalcon4` and `phalcon5` on all supported OS.
|
||||||
|
|
||||||
- By default, extensions which cannot be added or disabled gracefully leave an error message in the logs, the execution is not interrupted. To change this behaviour you can set `fail-fast` flag to `true`.
|
- By default, extensions which cannot be added or disabled gracefully leave an error message in the logs, the execution is not interrupted. To change this behaviour you can set `fail-fast` flag to `true`.
|
||||||
|
|
||||||
@ -223,7 +226,7 @@ PHP extensions can be set up using the `extensions` input. It accepts a `string`
|
|||||||
|
|
||||||
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.
|
||||||
|
|
||||||
[`behat`], [`blackfire`], [`blackfire-player`], [`churn`], [`codeception`], [`composer`], [`composer-normalize`], [`composer-prefetcher`], [`composer-require-checker`], [`composer-unused`], [`cs2pr`], [`deployer`], [`flex`], [`grpc_php_plugin`], [`infection`], [`parallel-lint`], [`pecl`], [`phan`], [`phing`], [`phinx`], [`phive`], [`php-config`], [`php-cs-fixer`], [`phpcbf`], [`phpcpd`], [`phpcs`], [`phpdoc`] or [`phpDocumentor`], [`phpize`], [`phplint`], [`phpmd`], [`phpspec`], [`phpstan`], [`phpunit`], [`phpunit-bridge`], [`phpunit-polyfills`], [`prestissimo`], [`protoc`], [`psalm`], [`symfony`] or [`symfony-cli`], [`vapor`] or [`vapor-cli`], [`wp`] or [`wp-cli`]
|
[`behat`], [`blackfire`], [`blackfire-player`], [`churn`], [`codeception`], [`composer`], [`composer-normalize`], [`composer-prefetcher`], [`composer-require-checker`], [`composer-unused`], [`cs2pr`], [`deployer`], [`flex`], [`grpc_php_plugin`], [`infection`], [`parallel-lint`], [`pecl`], [`phan`], [`phing`], [`phinx`], [`phive`], [`php-config`], [`php-cs-fixer`], [`phpcbf`], [`phpcpd`], [`phpcs`], [`phpdoc`] or [`phpDocumentor`], [`phpize`], [`phplint`], [`phpmd`], [`phpspec`], [`phpstan`], [`phpunit`], [`phpunit-bridge`], [`phpunit-polyfills`], [`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
|
||||||
@ -252,7 +255,8 @@ These tools can be set up globally using the `tools` input. It accepts a string
|
|||||||
|
|
||||||
When you specify just the major version or the version in `major.minor` format, the latest patch version matching the input will be setup.
|
When you specify just the major version or the version in `major.minor` format, the latest patch version matching the input will be setup.
|
||||||
|
|
||||||
Except for major versions of `composer`, For other tools when you specify only the `major` version or the version in `major.minor` format for any tool you can get rate limited by GitHub's API. To avoid this, it is recommended to provide a [`GitHub` OAuth token](https://github.com/shivammathur/setup-php#composer-github-oauth "Composer GitHub OAuth"). You can do that by setting `COMPOSER_TOKEN` environment variable.
|
Except for major versions of `composer`, For other tools when you specify only the `major` version or the version in `major.minor` format for any tool you can get rate limited by GitHub's API. To avoid this, it is recommended to provide a [`GitHub` OAuth token](https://github.com/shivammathur/setup-php#composer-github-oauth "Composer GitHub OAuth").
|
||||||
|
You can do that by setting `GITHUB_TOKEN` environment variable. The `COMPOSER_TOKEN` environment variable has been deprecated in favor of `GITHUB_TOKEN` and will be removed in the next major version.
|
||||||
|
|
||||||
```yaml
|
```yaml
|
||||||
- name: Setup PHP with tools
|
- name: Setup PHP with tools
|
||||||
@ -261,10 +265,10 @@ These tools can be set up globally using the `tools` input. It accepts a string
|
|||||||
php-version: '8.1'
|
php-version: '8.1'
|
||||||
tools: php-cs-fixer:3.5, phpunit:9.5
|
tools: php-cs-fixer:3.5, phpunit:9.5
|
||||||
env:
|
env:
|
||||||
COMPOSER_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||||
```
|
```
|
||||||
|
|
||||||
- The latest stable version of `composer` is set up by default. You can set up the required `composer` version by specifying the major version `v1` or `v2`, or the version in `major.minor` or `semver` format, Additionally for composer `snapshot` and `preview` can also be specified to set up the respective releases.
|
- The latest stable version of `composer` is set up by default. You can set up the required `composer` version by specifying the major version `v1` or `v2`, or the version in `major.minor` or `semver` format. Additionally for composer `snapshot` and `preview` can also be specified to set up the respective releases.
|
||||||
|
|
||||||
```yaml
|
```yaml
|
||||||
- name: Setup PHP with composer v2
|
- name: Setup PHP with composer v2
|
||||||
@ -306,6 +310,7 @@ These tools can be set up globally using the `tools` input. It accepts a string
|
|||||||
- Input `tools` is useful to set up tools which are only used in CI workflows, thus keeping your `composer.json` tidy.
|
- Input `tools` is useful to set up tools which are only used in CI workflows, thus keeping your `composer.json` tidy.
|
||||||
- If you do not want to use all your dev-dependencies in workflow, you can run composer with `--no-dev` and install required tools using `tools` input to speed up your workflow.
|
- If you do not want to use all your dev-dependencies in workflow, you can run composer with `--no-dev` and install required tools using `tools` input to speed up your workflow.
|
||||||
- By default, `COMPOSER_NO_INTERACTION` is set to `1` and `COMPOSER_PROCESS_TIMEOUT` is set to `0`. In effect, this means that Composer commands in your scripts do not need to specify `--no-interaction`.
|
- By default, `COMPOSER_NO_INTERACTION` is set to `1` and `COMPOSER_PROCESS_TIMEOUT` is set to `0`. In effect, this means that Composer commands in your scripts do not need to specify `--no-interaction`.
|
||||||
|
- Also, `COMPOSER_NO_AUDIT` is set to `1`. So if you want to audit your dependencies for security vulnerabilities, it is recommended to add a `composer audit` step before you install them.
|
||||||
|
|
||||||
## :signal_strength: Coverage Support
|
## :signal_strength: Coverage Support
|
||||||
|
|
||||||
@ -425,7 +430,7 @@ Disable coverage for these reasons:
|
|||||||
|
|
||||||
- Specify the tools you want to set up.
|
- Specify the tools you want to set up.
|
||||||
- Accepts a `string` in csv-format. For example: `phpunit, phpcs`
|
- Accepts a `string` in csv-format. For example: `phpunit, phpcs`
|
||||||
- See [tools Support](#wrench-tools-support) for tools supported.
|
- See [tools support](#wrench-tools-support) for tools supported.
|
||||||
|
|
||||||
### Outputs
|
### Outputs
|
||||||
|
|
||||||
@ -536,6 +541,23 @@ steps:
|
|||||||
tools: php-cs-fixer, phpunit
|
tools: php-cs-fixer, phpunit
|
||||||
```
|
```
|
||||||
|
|
||||||
|
### Debug Build Setup
|
||||||
|
|
||||||
|
> Set up a PHP build with debugging symbols.
|
||||||
|
|
||||||
|
- Production release builds of PHP without debugging symbols are set up by default.
|
||||||
|
- You can use the `debug` environment variable to set up a build with debugging symbols for PHP 5.6 and above.
|
||||||
|
|
||||||
|
```yaml
|
||||||
|
steps:
|
||||||
|
- name: Setup PHP with debugging symbols
|
||||||
|
uses: shivammathur/setup-php@v2
|
||||||
|
with:
|
||||||
|
php-version: '8.1'
|
||||||
|
env:
|
||||||
|
debug: true # specify true or false
|
||||||
|
```
|
||||||
|
|
||||||
### Thread Safe Setup
|
### Thread Safe Setup
|
||||||
|
|
||||||
> Set up `TS` or `NTS` PHP on `Windows`.
|
> Set up `TS` or `NTS` PHP on `Windows`.
|
||||||
@ -563,6 +585,7 @@ jobs:
|
|||||||
> Update to the latest patch of PHP versions.
|
> Update to the latest patch of PHP versions.
|
||||||
|
|
||||||
- Pre-installed PHP versions are not updated to their latest patch release by default.
|
- Pre-installed PHP versions are not updated to their latest patch release by default.
|
||||||
|
- If `ppa:ondrej/php` is missing on the Ubuntu GitHub environment, the PHP version is updated to the latest patch release.
|
||||||
- You can specify the `update` environment variable to `true` for updating to the latest release.
|
- You can specify the `update` environment variable to `true` for updating to the latest release.
|
||||||
|
|
||||||
```yaml
|
```yaml
|
||||||
@ -662,12 +685,15 @@ jobs:
|
|||||||
|
|
||||||
Run the workflow locally with `act` using [`shivammathur/node`](https://github.com/shivammathur/node-docker "Docker image to run setup-php") docker images.
|
Run the workflow locally with `act` using [`shivammathur/node`](https://github.com/shivammathur/node-docker "Docker image to run setup-php") docker images.
|
||||||
|
|
||||||
Choose the image tag which matches the `runs-on` property in your workflow. For example, if you are using `ubuntu-20.04` in your workflow, run `act -P ubuntu-20.04=shivammathur/node:20.04`.
|
Choose the image tag which matches the `runs-on` property in your workflow. For example, if you are using `ubuntu-20.04` in your workflow, run `act -P ubuntu-20.04=shivammathur/node:2004`.
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
# For runs-on: ubuntu-latest
|
# For runs-on: ubuntu-latest
|
||||||
act -P ubuntu-latest=shivammathur/node:latest
|
act -P ubuntu-latest=shivammathur/node:latest
|
||||||
|
|
||||||
|
# For runs-on: ubuntu-22.04
|
||||||
|
act -P ubuntu-22.04=shivammathur/node:2204
|
||||||
|
|
||||||
# For runs-on: ubuntu-20.04
|
# For runs-on: ubuntu-20.04
|
||||||
act -P ubuntu-20.04=shivammathur/node:2004
|
act -P ubuntu-20.04=shivammathur/node:2004
|
||||||
|
|
||||||
@ -677,7 +703,7 @@ act -P ubuntu-18.04=shivammathur/node:1804
|
|||||||
|
|
||||||
### JIT Configuration
|
### JIT Configuration
|
||||||
|
|
||||||
> Enable Just-in-time(JIT) on PHP 8.0 and above.
|
> Enable Just-in-time (JIT) on PHP 8.0 and above.
|
||||||
|
|
||||||
- To enable JIT, enable `opcache` in cli mode by setting `opcache.enable_cli=1`.
|
- To enable JIT, enable `opcache` in cli mode by setting `opcache.enable_cli=1`.
|
||||||
- JIT conflicts with `Xdebug`, `PCOV`, and other extensions which override `zend_execute_ex` function, so set `coverage: none` and disable any such extension if added.
|
- JIT conflicts with `Xdebug`, `PCOV`, and other extensions which override `zend_execute_ex` function, so set `coverage: none` and disable any such extension if added.
|
||||||
@ -707,7 +733,7 @@ If your project uses composer, you can persist the composer's internal cache dir
|
|||||||
```yaml
|
```yaml
|
||||||
- name: Get composer cache directory
|
- name: Get composer cache directory
|
||||||
id: composer-cache
|
id: composer-cache
|
||||||
run: echo "::set-output name=dir::$(composer config cache-files-dir)"
|
run: echo "dir=$(composer config cache-files-dir)" >> $GITHUB_OUTPUT
|
||||||
|
|
||||||
- name: Cache dependencies
|
- name: Cache dependencies
|
||||||
uses: actions/cache@v2
|
uses: actions/cache@v2
|
||||||
@ -733,9 +759,11 @@ key: ${{ runner.os }}-composer-${{ matrix.prefer }}-${{ hashFiles('**/composer.l
|
|||||||
restore-keys: ${{ runner.os }}-composer-${{ matrix.prefer }}-
|
restore-keys: ${{ runner.os }}-composer-${{ matrix.prefer }}-
|
||||||
```
|
```
|
||||||
|
|
||||||
### Composer GitHub OAuth
|
### GitHub Composer Authentication
|
||||||
|
|
||||||
If you have a number of workflows which set up multiple tools or have many composer dependencies, you might hit the GitHub's rate limit for composer. Also, if you specify only the major version or the version in `major.minor` format, you can hit the rate limit. To avoid this you can specify an `OAuth` token by setting `COMPOSER_TOKEN` environment variable. You can use [`GITHUB_TOKEN`](https://help.github.com/en/actions/configuring-and-managing-workflows/authenticating-with-the-github_token "GITHUB_TOKEN documentation") secret for this purpose.
|
If you have a number of workflows which set up multiple tools or have many composer dependencies, you might hit the GitHub's rate limit for composer. Also, if you specify only the major version or the version in `major.minor` format, you can hit the rate limit. To avoid this you can specify an `OAuth` token by setting `GITHUB_TOKEN` environment variable. You can use [`GITHUB_TOKEN`](https://help.github.com/en/actions/configuring-and-managing-workflows/authenticating-with-the-github_token "GITHUB_TOKEN documentation") secret for this purpose.
|
||||||
|
|
||||||
|
The `COMPOSER_TOKEN` environment variable has been deprecated in favor of `GITHUB_TOKEN` and will be removed in the next major version.
|
||||||
|
|
||||||
```yaml
|
```yaml
|
||||||
- name: Setup PHP
|
- name: Setup PHP
|
||||||
@ -743,7 +771,42 @@ If you have a number of workflows which set up multiple tools or have many compo
|
|||||||
with:
|
with:
|
||||||
php-version: '8.1'
|
php-version: '8.1'
|
||||||
env:
|
env:
|
||||||
COMPOSER_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||||
|
```
|
||||||
|
|
||||||
|
### Private Packagist Authentication
|
||||||
|
|
||||||
|
If you use Private Packagist for your private composer dependencies, you can set the `PACKAGIST_TOKEN` environment variable to authenticate.
|
||||||
|
|
||||||
|
```yaml
|
||||||
|
- name: Setup PHP
|
||||||
|
uses: shivammathur/setup-php@v2
|
||||||
|
with:
|
||||||
|
php-version: '8.1'
|
||||||
|
env:
|
||||||
|
PACKAGIST_TOKEN: ${{ secrets.PACKAGIST_TOKEN }}
|
||||||
|
```
|
||||||
|
|
||||||
|
### Manual Composer Authentication
|
||||||
|
|
||||||
|
In addition to GitHub or Private Packagist, if you want to authenticate private repositories hosted elsewhere, you can set the `COMPOSER_AUTH_JSON` environment variable with the authentication methods and the credentials in json format.
|
||||||
|
Please refer to the authentication section in [`composer documentation`](https://getcomposer.org/doc/articles/authentication-for-private-packages.md "composer documentation") for more details.
|
||||||
|
|
||||||
|
```yaml
|
||||||
|
- name: Setup PHP
|
||||||
|
uses: shivammathur/setup-php@v2
|
||||||
|
with:
|
||||||
|
php-version: '8.1'
|
||||||
|
env:
|
||||||
|
COMPOSER_AUTH_JSON: |
|
||||||
|
{
|
||||||
|
"http-basic": {
|
||||||
|
"example.org": {
|
||||||
|
"username": "${{ secrets.EXAMPLE_ORG_USERNAME }}",
|
||||||
|
"password": "${{ secrets.EXAMPLE_ORG_PASSWORD }}"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
### Inline PHP Scripts
|
### Inline PHP Scripts
|
||||||
@ -838,7 +901,7 @@ For examples refer to [cs2pr documentation](https://github.com/staabm/annotate-p
|
|||||||
|
|
||||||
### Examples
|
### Examples
|
||||||
|
|
||||||
Examples of using `setup-php` with various PHP Frameworks and Packages.
|
Examples of using `setup-php` with various PHP frameworks and packages.
|
||||||
|
|
||||||
| Framework/Package | Runs on | Workflow |
|
| Framework/Package | Runs on | Workflow |
|
||||||
|----------------------------------------|---------------------------------|---------------------------------------------------------------------------------------------------------------|
|
|----------------------------------------|---------------------------------|---------------------------------------------------------------------------------------------------------------|
|
||||||
@ -992,9 +1055,11 @@ These companies generously provide setup-php their products and services to aid
|
|||||||
[`phpunit`]: https://phpunit.de/
|
[`phpunit`]: https://phpunit.de/
|
||||||
[`phpunit-bridge`]: https://symfony.com/doc/current/components/phpunit_bridge.html
|
[`phpunit-bridge`]: https://symfony.com/doc/current/components/phpunit_bridge.html
|
||||||
[`phpunit-polyfills`]: https://github.com/Yoast/PHPUnit-Polyfills
|
[`phpunit-polyfills`]: https://github.com/Yoast/PHPUnit-Polyfills
|
||||||
|
[`pint`]: https://github.com/laravel/pint
|
||||||
[`prestissimo`]: https://github.com/hirak/prestissimo
|
[`prestissimo`]: https://github.com/hirak/prestissimo
|
||||||
[`protoc`]: https://developers.google.com/protocol-buffers/
|
[`protoc`]: https://developers.google.com/protocol-buffers/
|
||||||
[`psalm`]: https://psalm.dev/
|
[`psalm`]: https://psalm.dev/
|
||||||
|
[`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
|
||||||
[`vapor`]: https://docs.vapor.build/
|
[`vapor`]: https://docs.vapor.build/
|
||||||
|
@ -4,6 +4,8 @@ describe('Config tests', () => {
|
|||||||
it.each`
|
it.each`
|
||||||
driver | php | os | output
|
driver | php | os | output
|
||||||
${'PCOV'} | ${'7.4'} | ${'win32'} | ${'Add-Extension pcov,Disable-Extension xdebug false'}
|
${'PCOV'} | ${'7.4'} | ${'win32'} | ${'Add-Extension pcov,Disable-Extension xdebug false'}
|
||||||
|
${'pcov'} | ${'7.4'} | ${'win32'} | ${'$pcov_version = php -r "echo phpversion(\'pcov\');"'}
|
||||||
|
${'pcov'} | ${'7.4'} | ${'win32'} | ${'PCOV $pcov_version enabled as coverage driver'}
|
||||||
${'pcov'} | ${'7.0'} | ${'win32'} | ${'PHP 7.1 or newer is required'}
|
${'pcov'} | ${'7.0'} | ${'win32'} | ${'PHP 7.1 or newer is required'}
|
||||||
${'pcov'} | ${'5.6'} | ${'win32'} | ${'PHP 7.1 or newer is required'}
|
${'pcov'} | ${'5.6'} | ${'win32'} | ${'PHP 7.1 or newer is required'}
|
||||||
${'pcov'} | ${'7.4'} | ${'win32'} | ${'Add-Extension pcov,Disable-Extension xdebug false'}
|
${'pcov'} | ${'7.4'} | ${'win32'} | ${'Add-Extension pcov,Disable-Extension xdebug false'}
|
||||||
@ -15,6 +17,8 @@ describe('Config tests', () => {
|
|||||||
${'xdebug'} | ${'8.0'} | ${'linux'} | ${'add_extension xdebug'}
|
${'xdebug'} | ${'8.0'} | ${'linux'} | ${'add_extension xdebug'}
|
||||||
${'xdebug3'} | ${'8.0'} | ${'linux'} | ${'add_extension xdebug'}
|
${'xdebug3'} | ${'8.0'} | ${'linux'} | ${'add_extension xdebug'}
|
||||||
${'xdebug2'} | ${'7.4'} | ${'linux'} | ${'add_pecl_extension xdebug 2.9.8 zend_extension'}
|
${'xdebug2'} | ${'7.4'} | ${'linux'} | ${'add_pecl_extension xdebug 2.9.8 zend_extension'}
|
||||||
|
${'xdebug'} | ${'7.4'} | ${'linux'} | ${'xdebug_version="$(php -r "echo phpversion(\'xdebug\');")"'}
|
||||||
|
${'xdebug'} | ${'7.4'} | ${'linux'} | ${'Xdebug $xdebug_version enabled as coverage driver'}
|
||||||
${'xdebug'} | ${'7.4'} | ${'darwin'} | ${'add_brew_extension xdebug'}
|
${'xdebug'} | ${'7.4'} | ${'darwin'} | ${'add_brew_extension xdebug'}
|
||||||
${'xdebug3'} | ${'7.1'} | ${'darwin'} | ${'xdebug3 is not supported on PHP 7.1'}
|
${'xdebug3'} | ${'7.1'} | ${'darwin'} | ${'xdebug3 is not supported on PHP 7.1'}
|
||||||
${'xdebug2'} | ${'7.4'} | ${'darwin'} | ${'add_brew_extension xdebug2'}
|
${'xdebug2'} | ${'7.4'} | ${'darwin'} | ${'add_brew_extension xdebug2'}
|
||||||
|
@ -117,7 +117,7 @@ describe('Extension tests', () => {
|
|||||||
)
|
)
|
||||||
? `add_${extension}`
|
? `add_${extension}`
|
||||||
: `add_brew_extension ${formula} ${prefix}`;
|
: `add_brew_extension ${formula} ${prefix}`;
|
||||||
return [formula, '7.3', output];
|
return [formula, formula === 'phalcon3' ? '7.3' : '7.4', output];
|
||||||
});
|
});
|
||||||
|
|
||||||
it.each(data)(
|
it.each(data)(
|
||||||
|
@ -45,7 +45,11 @@ jest.mock('../src/fetch', () => ({
|
|||||||
.fn()
|
.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"'
|
||||||
};
|
};
|
||||||
@ -283,6 +287,7 @@ describe('Tools tests', () => {
|
|||||||
version | url
|
version | url
|
||||||
${'latest'} | ${'https://deployer.org/deployer.phar'}
|
${'latest'} | ${'https://deployer.org/deployer.phar'}
|
||||||
${'1.2.3'} | ${'https://deployer.org/releases/v1.2.3/deployer.phar'}
|
${'1.2.3'} | ${'https://deployer.org/releases/v1.2.3/deployer.phar'}
|
||||||
|
${'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',
|
||||||
@ -293,31 +298,41 @@ describe('Tools tests', () => {
|
|||||||
});
|
});
|
||||||
|
|
||||||
it.each`
|
it.each`
|
||||||
version | no_tool_cache | cache_url | source_url
|
version | php_version | no_tool_cache | cache_url | source_url
|
||||||
${'latest'} | ${'true'} | ${'https://github.com/shivammathur/composer-cache/releases/latest/download/composer-7.4-stable.phar'} | ${'https://getcomposer.org/composer-stable.phar'}
|
${'latest'} | ${'7.4'} | ${'true'} | ${'https://github.com/shivammathur/composer-cache/releases/latest/download/composer-7.4-stable.phar'} | ${'https://getcomposer.org/composer-stable.phar'}
|
||||||
${'stable'} | ${'true'} | ${'https://github.com/shivammathur/composer-cache/releases/latest/download/composer-7.4-stable.phar'} | ${'https://getcomposer.org/composer-stable.phar'}
|
${'stable'} | ${'7.4'} | ${'true'} | ${'https://github.com/shivammathur/composer-cache/releases/latest/download/composer-7.4-stable.phar'} | ${'https://getcomposer.org/composer-stable.phar'}
|
||||||
${'snapshot'} | ${'true'} | ${'https://github.com/shivammathur/composer-cache/releases/latest/download/composer-7.4-snapshot.phar'} | ${'https://getcomposer.org/composer.phar'}
|
${'snapshot'} | ${'7.4'} | ${'true'} | ${'https://github.com/shivammathur/composer-cache/releases/latest/download/composer-7.4-snapshot.phar'} | ${'https://getcomposer.org/composer.phar'}
|
||||||
${'preview'} | ${'true'} | ${'https://github.com/shivammathur/composer-cache/releases/latest/download/composer-7.4-preview.phar'} | ${'https://getcomposer.org/composer-preview.phar'}
|
${'preview'} | ${'7.4'} | ${'true'} | ${'https://github.com/shivammathur/composer-cache/releases/latest/download/composer-7.4-preview.phar'} | ${'https://getcomposer.org/composer-preview.phar'}
|
||||||
${'1'} | ${'false'} | ${'https://github.com/shivammathur/composer-cache/releases/latest/download/composer-7.4-1.phar'} | ${'https://getcomposer.org/composer-1.phar'}
|
${'1'} | ${'7.4'} | ${'false'} | ${'https://github.com/shivammathur/composer-cache/releases/latest/download/composer-7.4-1.phar'} | ${'https://getcomposer.org/composer-1.phar'}
|
||||||
${'2'} | ${'false'} | ${'https://github.com/shivammathur/composer-cache/releases/latest/download/composer-7.4-2.phar'} | ${'https://getcomposer.org/composer-2.phar'}
|
${'2'} | ${'7.4'} | ${'false'} | ${'https://github.com/shivammathur/composer-cache/releases/latest/download/composer-7.4-2.phar'} | ${'https://getcomposer.org/composer-2.phar'}
|
||||||
${'1.2.3'} | ${'false'} | ${'https://github.com/composer/composer/releases/download/1.2.3/composer.phar'} | ${'https://getcomposer.org/composer-1.2.3.phar'}
|
${'latest'} | ${'7.4'} | ${'true'} | ${'https://dl.cloudsmith.io/public/shivammathur/composer-cache/raw/files/composer-7.4-stable.phar'} | ${'https://getcomposer.org/composer-stable.phar'}
|
||||||
${'1.2.3-RC1'} | ${'false'} | ${'https://github.com/composer/composer/releases/download/1.2.3-RC1/composer.phar'} | ${'https://getcomposer.org/composer-1.2.3-RC1.phar'}
|
${'stable'} | ${'7.4'} | ${'true'} | ${'https://dl.cloudsmith.io/public/shivammathur/composer-cache/raw/files/composer-7.4-stable.phar'} | ${'https://getcomposer.org/composer-stable.phar'}
|
||||||
|
${'snapshot'} | ${'7.4'} | ${'true'} | ${'https://dl.cloudsmith.io/public/shivammathur/composer-cache/raw/files/composer-7.4-snapshot.phar'} | ${'https://getcomposer.org/composer.phar'}
|
||||||
|
${'preview'} | ${'7.4'} | ${'true'} | ${'https://dl.cloudsmith.io/public/shivammathur/composer-cache/raw/files/composer-7.4-preview.phar'} | ${'https://getcomposer.org/composer-preview.phar'}
|
||||||
|
${'1'} | ${'7.4'} | ${'false'} | ${'https://dl.cloudsmith.io/public/shivammathur/composer-cache/raw/files/composer-7.4-1.phar'} | ${'https://getcomposer.org/composer-1.phar'}
|
||||||
|
${'2'} | ${'7.4'} | ${'false'} | ${'https://dl.cloudsmith.io/public/shivammathur/composer-cache/raw/files/composer-7.4-2.phar'} | ${'https://getcomposer.org/composer-2.phar'}
|
||||||
|
${'latest'} | ${'7.1'} | ${'true'} | ${'https://github.com/shivammathur/composer-cache/releases/latest/download/composer-7.1-stable.phar'} | ${'https://getcomposer.org/download/latest-2.2.x/composer.phar'}
|
||||||
|
${'stable'} | ${'7.1'} | ${'true'} | ${'https://github.com/shivammathur/composer-cache/releases/latest/download/composer-7.1-stable.phar'} | ${'https://getcomposer.org/download/latest-2.2.x/composer.phar'}
|
||||||
|
${'snapshot'} | ${'7.1'} | ${'true'} | ${'https://github.com/shivammathur/composer-cache/releases/latest/download/composer-7.1-snapshot.phar'} | ${'https://getcomposer.org/download/latest-2.2.x/composer.phar'}
|
||||||
|
${'preview'} | ${'7.1'} | ${'true'} | ${'https://github.com/shivammathur/composer-cache/releases/latest/download/composer-7.1-preview.phar'} | ${'https://getcomposer.org/download/latest-2.2.x/composer.phar'}
|
||||||
|
${'1'} | ${'7.1'} | ${'false'} | ${'https://github.com/shivammathur/composer-cache/releases/latest/download/composer-7.1-1.phar'} | ${'https://getcomposer.org/composer-1.phar'}
|
||||||
|
${'2'} | ${'7.1'} | ${'false'} | ${'https://github.com/shivammathur/composer-cache/releases/latest/download/composer-7.1-2.phar'} | ${'https://getcomposer.org/download/latest-2.2.x/composer.phar'}
|
||||||
|
${'1.2.3'} | ${'7.4'} | ${'false'} | ${'https://github.com/composer/composer/releases/download/1.2.3/composer.phar'} | ${'https://getcomposer.org/composer-1.2.3.phar'}
|
||||||
|
${'1.2.3-RC1'} | ${'7.4'} | ${'false'} | ${'https://github.com/composer/composer/releases/download/1.2.3-RC1/composer.phar'} | ${'https://getcomposer.org/composer-1.2.3-RC1.phar'}
|
||||||
`(
|
`(
|
||||||
'checking addComposer: $version, $no_tool_cache',
|
'checking addComposer: $version, $php_version, $no_tool_cache',
|
||||||
async ({version, no_tool_cache, cache_url, source_url}) => {
|
async ({version, php_version, no_tool_cache, cache_url, source_url}) => {
|
||||||
const data = getData({
|
const data = getData({
|
||||||
tool: 'composer',
|
tool: 'composer',
|
||||||
|
php_version: php_version,
|
||||||
domain: 'https://getcomposer.org',
|
domain: 'https://getcomposer.org',
|
||||||
repository: 'composer/composer',
|
repository: 'composer/composer',
|
||||||
version: version
|
version: version
|
||||||
});
|
});
|
||||||
process.env['no_tools_cache'] = no_tool_cache;
|
process.env['no_tools_cache'] = no_tool_cache;
|
||||||
|
expect(await tools.addComposer(data)).toContain(source_url);
|
||||||
if (no_tool_cache !== 'true') {
|
if (no_tool_cache !== 'true') {
|
||||||
expect(await tools.addComposer(data)).toContain(
|
expect(await tools.addComposer(data)).toContain(cache_url);
|
||||||
`${cache_url},${source_url}`
|
|
||||||
);
|
|
||||||
} else {
|
|
||||||
expect(await tools.addComposer(data)).toContain(source_url);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
@ -357,9 +372,9 @@ describe('Tools tests', () => {
|
|||||||
|
|
||||||
it.each([
|
it.each([
|
||||||
[
|
[
|
||||||
'blackfire, blackfire-player, churn, cs2pr, flex, grpc_php_plugin, parallel-lint, php-cs-fixer, phpDocumentor, phplint, phpstan, phpunit, pecl, phing, phinx, phinx:1.2.3, phive, phpunit-bridge, phpunit-polyfills, php-config, phpize, protoc, symfony, vapor, wp',
|
'blackfire, blackfire-player, churn, cs2pr, flex, grpc_php_plugin, parallel-lint, php-cs-fixer, phpDocumentor, phplint, phpstan, phpunit, pecl, phing, phinx, phinx:1.2.3, phive, phpunit-bridge, phpunit-polyfills, pint, php-config, phpize, protoc, symfony, vapor, wp',
|
||||||
[
|
[
|
||||||
'add_tool https://github.com/shivammathur/composer-cache/releases/latest/download/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://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',
|
||||||
'add_tool https://get.blackfire.io/blackfire-player.phar blackfire-player "-V"',
|
'add_tool https://get.blackfire.io/blackfire-player.phar blackfire-player "-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"',
|
||||||
@ -379,6 +394,7 @@ describe('Tools tests', () => {
|
|||||||
'add_tool https://github.com/phar-io/phive/releases/download/3.2.1/phive-3.2.1.phar phive "status"',
|
'add_tool https://github.com/phar-io/phive/releases/download/3.2.1/phive-3.2.1.phar phive "status"',
|
||||||
'add_composertool phpunit-bridge phpunit-bridge symfony/ global',
|
'add_composertool phpunit-bridge phpunit-bridge symfony/ global',
|
||||||
'add_composertool phpunit-polyfills phpunit-polyfills yoast/ global',
|
'add_composertool phpunit-polyfills phpunit-polyfills yoast/ global',
|
||||||
|
'add_tool https://github.com/laravel/pint/releases/latest/download/pint.phar pint "-V"',
|
||||||
'add_devtools php-config',
|
'add_devtools php-config',
|
||||||
'add_devtools phpize',
|
'add_devtools phpize',
|
||||||
'add_protoc latest',
|
'add_protoc latest',
|
||||||
@ -396,9 +412,9 @@ describe('Tools tests', () => {
|
|||||||
|
|
||||||
it.each([
|
it.each([
|
||||||
[
|
[
|
||||||
'behat, blackfire, blackfire-player, churn, composer-normalize, composer-require-checker, composer-unused, cs2pr:1.2.3, flex, grpc_php_plugin:1.2.3, infection, 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, symfony-cli, vapor-cli, wp-cli',
|
'behat, blackfire, blackfire-player, churn, composer-normalize, composer-require-checker, composer-unused, cs2pr:1.2.3, flex, grpc_php_plugin:1.2.3, infection, 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',
|
||||||
[
|
[
|
||||||
'add_tool https://github.com/shivammathur/composer-cache/releases/latest/download/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://dl.cloudsmith.io/public/shivammathur/composer-cache/raw/files/composer-7.4-stable.phar,https://getcomposer.org/composer-stable.phar composer',
|
||||||
'add_composertool behat behat behat/ scoped',
|
'add_composertool behat behat behat/ scoped',
|
||||||
'add_blackfire',
|
'add_blackfire',
|
||||||
'add_tool https://get.blackfire.io/blackfire-player.phar blackfire-player "-V"',
|
'add_tool https://get.blackfire.io/blackfire-player.phar blackfire-player "-V"',
|
||||||
@ -427,6 +443,7 @@ describe('Tools tests', () => {
|
|||||||
'add_composertool phpunit-polyfills phpunit-polyfills:1.0.1 yoast/ global',
|
'add_composertool phpunit-polyfills phpunit-polyfills:1.0.1 yoast/ global',
|
||||||
'add_protoc 1.2.3',
|
'add_protoc 1.2.3',
|
||||||
'add_tool https://github.com/vimeo/psalm/releases/latest/download/psalm.phar psalm "-v"',
|
'add_tool https://github.com/vimeo/psalm/releases/latest/download/psalm.phar psalm "-v"',
|
||||||
|
'add_composertool rector rector rector/ scoped',
|
||||||
'add_symfony latest',
|
'add_symfony latest',
|
||||||
'add_composertool vapor-cli vapor-cli laravel/ scoped',
|
'add_composertool 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"'
|
||||||
@ -443,7 +460,7 @@ describe('Tools tests', () => {
|
|||||||
[
|
[
|
||||||
'blackfire, blackfire-player:1.2.3, cs2pr, churn, deployer, does_not_exist, flex, phinx, phive:0.13.2, php-config, phpize, phpmd, simple-phpunit, symfony, wp',
|
'blackfire, blackfire-player:1.2.3, cs2pr, churn, deployer, does_not_exist, flex, phinx, phive:0.13.2, php-config, phpize, phpmd, simple-phpunit, symfony, wp',
|
||||||
[
|
[
|
||||||
'Add-Tool https://github.com/shivammathur/composer-cache/releases/latest/download/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://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',
|
||||||
'Add-Tool https://get.blackfire.io/blackfire-player-v1.2.3.phar blackfire-player "-V"',
|
'Add-Tool https://get.blackfire.io/blackfire-player-v1.2.3.phar blackfire-player "-V"',
|
||||||
'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"',
|
||||||
@ -472,7 +489,7 @@ describe('Tools tests', () => {
|
|||||||
[
|
[
|
||||||
'composer:v1, codeception/codeception, prestissimo, hirak/prestissimo, composer-prefetcher, narrowspark/automatic-composer-prefetcher, phinx: 1.2, robmorgan/phinx: ^1.2, user/tool:1.2.3, user/tool:~1.2',
|
'composer:v1, codeception/codeception, prestissimo, hirak/prestissimo, composer-prefetcher, narrowspark/automatic-composer-prefetcher, phinx: 1.2, robmorgan/phinx: ^1.2, user/tool:1.2.3, user/tool:~1.2',
|
||||||
[
|
[
|
||||||
'Add-Tool https://github.com/shivammathur/composer-cache/releases/latest/download/composer-7.4-1.phar,https://getcomposer.org/composer-1.phar composer',
|
'Add-Tool https://github.com/shivammathur/composer-cache/releases/latest/download/composer-7.4-1.phar,https://dl.cloudsmith.io/public/shivammathur/composer-cache/raw/files/composer-7.4-1.phar,https://getcomposer.org/composer-1.phar composer',
|
||||||
'Add-Composertool codeception codeception codeception/ global',
|
'Add-Composertool codeception codeception codeception/ global',
|
||||||
'Add-Composertool prestissimo prestissimo hirak/ global',
|
'Add-Composertool prestissimo prestissimo hirak/ global',
|
||||||
'Add-Composertool automatic-composer-prefetcher automatic-composer-prefetcher narrowspark/ global',
|
'Add-Composertool automatic-composer-prefetcher automatic-composer-prefetcher narrowspark/ global',
|
||||||
@ -495,10 +512,10 @@ describe('Tools tests', () => {
|
|||||||
it.each`
|
it.each`
|
||||||
tools_csv | script
|
tools_csv | script
|
||||||
${'none'} | ${''}
|
${'none'} | ${''}
|
||||||
${'none, phpunit'} | ${'\nstep_log "Setup Tools"\nadd_tool https://github.com/shivammathur/composer-cache/releases/latest/download/composer-7.4-stable.phar,https://getcomposer.org/composer-stable.phar composer latest\n\nadd_tool https://phar.phpunit.de/phpunit.phar phpunit "--version"'}
|
${'none, phpunit'} | ${'\nstep_log "Setup Tools"\nadd_tool https://github.com/shivammathur/composer-cache/releases/latest/download/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 latest\n\nadd_tool https://phar.phpunit.de/phpunit.phar phpunit "--version"'}
|
||||||
${'composer:preview'} | ${'add_tool https://github.com/shivammathur/composer-cache/releases/latest/download/composer-7.4-preview.phar,https://getcomposer.org/composer-preview.phar composer preview'}
|
${'composer:preview'} | ${'add_tool https://github.com/shivammathur/composer-cache/releases/latest/download/composer-7.4-preview.phar,https://dl.cloudsmith.io/public/shivammathur/composer-cache/raw/files/composer-7.4-preview.phar,https://getcomposer.org/composer-preview.phar composer preview'}
|
||||||
${'composer, composer:v1'} | ${'add_tool https://github.com/shivammathur/composer-cache/releases/latest/download/composer-7.4-1.phar,https://getcomposer.org/composer-1.phar composer'}
|
${'composer, composer:v1'} | ${'add_tool https://github.com/shivammathur/composer-cache/releases/latest/download/composer-7.4-1.phar,https://dl.cloudsmith.io/public/shivammathur/composer-cache/raw/files/composer-7.4-1.phar,https://getcomposer.org/composer-1.phar composer'}
|
||||||
${'composer:v1, composer:preview, composer:snapshot'} | ${'add_tool https://github.com/shivammathur/composer-cache/releases/latest/download/composer-7.4-snapshot.phar,https://getcomposer.org/composer.phar composer snapshot'}
|
${'composer:v1, composer:preview, composer:snapshot'} | ${'add_tool https://github.com/shivammathur/composer-cache/releases/latest/download/composer-7.4-snapshot.phar,https://dl.cloudsmith.io/public/shivammathur/composer-cache/raw/files/composer-7.4-snapshot.phar,https://getcomposer.org/composer.phar composer snapshot'}
|
||||||
`('checking composer setup: $tools_csv', async ({tools_csv, script}) => {
|
`('checking composer setup: $tools_csv', async ({tools_csv, script}) => {
|
||||||
expect(await tools.addTools(tools_csv, '7.4', 'linux')).toContain(script);
|
expect(await tools.addTools(tools_csv, '7.4', 'linux')).toContain(script);
|
||||||
});
|
});
|
||||||
@ -512,4 +529,14 @@ describe('Tools tests', () => {
|
|||||||
process.env['COMPOSER_TOKEN'] = token;
|
process.env['COMPOSER_TOKEN'] = token;
|
||||||
expect(await tools.addTools(tools_csv, '7.4', 'linux')).toContain(script);
|
expect(await tools.addTools(tools_csv, '7.4', 'linux')).toContain(script);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
it.each`
|
||||||
|
tools_csv | token | script
|
||||||
|
${'cs2pr:1.2'} | ${'invalid_token'} | ${'add_log "$cross" "cs2pr" "Invalid token"'}
|
||||||
|
${'phpunit:1.2'} | ${'invalid_token'} | ${'add_log "$cross" "phpunit" "Invalid token"'}
|
||||||
|
${'phpunit:0.1'} | ${'no_data'} | ${'add_log "$cross" "phpunit" "No version found with prefix 0.1."'}
|
||||||
|
`('checking error: $tools_csv', async ({tools_csv, token, script}) => {
|
||||||
|
process.env['GITHUB_TOKEN'] = token;
|
||||||
|
expect(await tools.addTools(tools_csv, '7.4', 'linux')).toContain(script);
|
||||||
|
});
|
||||||
});
|
});
|
||||||
|
@ -256,4 +256,13 @@ describe('Utils tests', () => {
|
|||||||
'\nadd_extension_from_source ext https://sub.domain.XN--tld org repo release extension'
|
'\nadd_extension_from_source ext https://sub.domain.XN--tld org repo release extension'
|
||||||
);
|
);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
it('checking setVariable', async () => {
|
||||||
|
let script: string = await utils.setVariable('var', 'command', 'linux');
|
||||||
|
expect(script).toEqual('\nvar="$(command)"\n');
|
||||||
|
script = await utils.setVariable('var', 'command', 'darwin');
|
||||||
|
expect(script).toEqual('\nvar="$(command)"\n');
|
||||||
|
script = await utils.setVariable('var', 'command', 'win32');
|
||||||
|
expect(script).toEqual('\n$var = command\n');
|
||||||
|
});
|
||||||
});
|
});
|
||||||
|
@ -29,5 +29,5 @@ outputs:
|
|||||||
php-version:
|
php-version:
|
||||||
description: 'PHP version in semver format'
|
description: 'PHP version in semver format'
|
||||||
runs:
|
runs:
|
||||||
using: 'node12'
|
using: 'node16'
|
||||||
main: 'dist/index.js'
|
main: 'dist/index.js'
|
||||||
|
1925
dist/index.js
vendored
1925
dist/index.js
vendored
File diff suppressed because it is too large
Load Diff
@ -21,7 +21,7 @@ jobs:
|
|||||||
|
|
||||||
- name: Get composer cache directory
|
- name: Get composer cache directory
|
||||||
id: composer-cache
|
id: composer-cache
|
||||||
run: echo "::set-output name=dir::$(composer config cache-files-dir)"
|
run: echo "dir=$(composer config cache-files-dir)" >> $GITHUB_OUTPUT
|
||||||
|
|
||||||
- uses: actions/cache@v3
|
- uses: actions/cache@v3
|
||||||
with:
|
with:
|
||||||
|
@ -47,7 +47,7 @@ jobs:
|
|||||||
|
|
||||||
- name: Get composer cache directory
|
- name: Get composer cache directory
|
||||||
id: composer-cache
|
id: composer-cache
|
||||||
run: echo "::set-output name=dir::$(composer config cache-files-dir)"
|
run: echo "dir=$(composer config cache-files-dir)" >> $GITHUB_OUTPUT
|
||||||
|
|
||||||
- name: Cache composer dependencies
|
- name: Cache composer dependencies
|
||||||
uses: actions/cache@v3
|
uses: actions/cache@v3
|
||||||
@ -86,7 +86,7 @@ jobs:
|
|||||||
|
|
||||||
- name: Get composer cache directory
|
- name: Get composer cache directory
|
||||||
id: composer-cache
|
id: composer-cache
|
||||||
run: echo "::set-output name=dir::$(composer config cache-files-dir)"
|
run: echo "dir=$(composer config cache-files-dir)" >> $GITHUB_OUTPUT
|
||||||
|
|
||||||
- name: Cache composer dependencies
|
- name: Cache composer dependencies
|
||||||
uses: actions/cache@v3
|
uses: actions/cache@v3
|
||||||
@ -120,7 +120,7 @@ jobs:
|
|||||||
|
|
||||||
- name: Get composer cache directory
|
- name: Get composer cache directory
|
||||||
id: composer-cache
|
id: composer-cache
|
||||||
run: echo "::set-output name=dir::$(composer config cache-files-dir)"
|
run: echo "dir=$(composer config cache-files-dir)" >> $GITHUB_OUTPUT
|
||||||
|
|
||||||
- name: Cache composer dependencies
|
- name: Cache composer dependencies
|
||||||
uses: actions/cache@v3
|
uses: actions/cache@v3
|
||||||
|
@ -47,7 +47,7 @@ jobs:
|
|||||||
|
|
||||||
- name: Get composer cache directory
|
- name: Get composer cache directory
|
||||||
id: composer-cache
|
id: composer-cache
|
||||||
run: echo "::set-output name=dir::$(composer config cache-files-dir)"
|
run: echo "dir=$(composer config cache-files-dir)" >> $GITHUB_OUTPUT
|
||||||
|
|
||||||
- name: Cache composer dependencies
|
- name: Cache composer dependencies
|
||||||
uses: actions/cache@v3
|
uses: actions/cache@v3
|
||||||
@ -86,7 +86,7 @@ jobs:
|
|||||||
|
|
||||||
- name: Get composer cache directory
|
- name: Get composer cache directory
|
||||||
id: composer-cache
|
id: composer-cache
|
||||||
run: echo "::set-output name=dir::$(composer config cache-files-dir)"
|
run: echo "dir=$(composer config cache-files-dir)" >> $GITHUB_OUTPUT
|
||||||
|
|
||||||
- name: Cache composer dependencies
|
- name: Cache composer dependencies
|
||||||
uses: actions/cache@v3
|
uses: actions/cache@v3
|
||||||
@ -120,7 +120,7 @@ jobs:
|
|||||||
|
|
||||||
- name: Get composer cache directory
|
- name: Get composer cache directory
|
||||||
id: composer-cache
|
id: composer-cache
|
||||||
run: echo "::set-output name=dir::$(composer config cache-files-dir)"
|
run: echo "dir=$(composer config cache-files-dir)" >> $GITHUB_OUTPUT
|
||||||
|
|
||||||
- name: Cache composer dependencies
|
- name: Cache composer dependencies
|
||||||
uses: actions/cache@v3
|
uses: actions/cache@v3
|
||||||
|
@ -23,7 +23,7 @@ jobs:
|
|||||||
|
|
||||||
- name: Get composer cache directory
|
- name: Get composer cache directory
|
||||||
id: composer-cache
|
id: composer-cache
|
||||||
run: echo "::set-output name=dir::$(composer config cache-files-dir)"
|
run: echo "dir=$(composer config cache-files-dir)" >> $GITHUB_OUTPUT
|
||||||
|
|
||||||
- name: Cache composer dependencies
|
- name: Cache composer dependencies
|
||||||
uses: actions/cache@v3
|
uses: actions/cache@v3
|
||||||
@ -57,7 +57,7 @@ jobs:
|
|||||||
extensions: mbstring, intl
|
extensions: mbstring, intl
|
||||||
- name: Get composer cache directory
|
- name: Get composer cache directory
|
||||||
id: composer-cache
|
id: composer-cache
|
||||||
run: echo "::set-output name=dir::$(composer config cache-files-dir)"
|
run: echo "dir=$(composer config cache-files-dir)" >> $GITHUB_OUTPUT
|
||||||
|
|
||||||
- name: Cache composer dependencies
|
- name: Cache composer dependencies
|
||||||
uses: actions/cache@v3
|
uses: actions/cache@v3
|
||||||
@ -91,7 +91,7 @@ jobs:
|
|||||||
|
|
||||||
- name: Get composer cache directory
|
- name: Get composer cache directory
|
||||||
id: composer-cache
|
id: composer-cache
|
||||||
run: echo "::set-output name=dir::$(composer config cache-files-dir)"
|
run: echo "dir=$(composer config cache-files-dir)" >> $GITHUB_OUTPUT
|
||||||
|
|
||||||
- name: Cache composer dependencies
|
- name: Cache composer dependencies
|
||||||
uses: actions/cache@v3
|
uses: actions/cache@v3
|
||||||
|
@ -22,7 +22,7 @@ jobs:
|
|||||||
|
|
||||||
- name: Get composer cache directory
|
- name: Get composer cache directory
|
||||||
id: composer-cache
|
id: composer-cache
|
||||||
run: echo "::set-output name=dir::$(composer config cache-files-dir)"
|
run: echo "dir=$(composer config cache-files-dir)" >> $GITHUB_OUTPUT
|
||||||
|
|
||||||
- name: Cache composer dependencies
|
- name: Cache composer dependencies
|
||||||
uses: actions/cache@v3
|
uses: actions/cache@v3
|
||||||
|
@ -21,7 +21,7 @@ jobs:
|
|||||||
|
|
||||||
- name: Get composer cache directory
|
- name: Get composer cache directory
|
||||||
id: composer-cache
|
id: composer-cache
|
||||||
run: echo "::set-output name=dir::$(composer config cache-files-dir)"
|
run: echo "dir=$(composer config cache-files-dir)" >> $GITHUB_OUTPUT
|
||||||
|
|
||||||
- name: Cache composer dependencies
|
- name: Cache composer dependencies
|
||||||
uses: actions/cache@v3
|
uses: actions/cache@v3
|
||||||
|
@ -54,7 +54,7 @@ jobs:
|
|||||||
|
|
||||||
- name: Get composer cache directory
|
- name: Get composer cache directory
|
||||||
id: composer-cache
|
id: composer-cache
|
||||||
run: echo "::set-output name=dir::$(composer config cache-files-dir)"
|
run: echo "dir=$(composer config cache-files-dir)" >> $GITHUB_OUTPUT
|
||||||
|
|
||||||
- name: Cache composer dependencies
|
- name: Cache composer dependencies
|
||||||
uses: actions/cache@v3
|
uses: actions/cache@v3
|
||||||
|
@ -56,7 +56,7 @@ jobs:
|
|||||||
|
|
||||||
- name: Get composer cache directory
|
- name: Get composer cache directory
|
||||||
id: composer-cache
|
id: composer-cache
|
||||||
run: echo "::set-output name=dir::$(composer config cache-files-dir)"
|
run: echo "dir=$(composer config cache-files-dir)" >> $GITHUB_OUTPUT
|
||||||
|
|
||||||
- name: Cache composer dependencies
|
- name: Cache composer dependencies
|
||||||
uses: actions/cache@v3
|
uses: actions/cache@v3
|
||||||
|
@ -24,7 +24,7 @@ jobs:
|
|||||||
|
|
||||||
- name: Get composer cache directory
|
- name: Get composer cache directory
|
||||||
id: composer-cache
|
id: composer-cache
|
||||||
run: echo "::set-output name=dir::$(composer config cache-files-dir)"
|
run: echo "dir=$(composer config cache-files-dir)" >> $GITHUB_OUTPUT
|
||||||
|
|
||||||
- name: Cache composer dependencies
|
- name: Cache composer dependencies
|
||||||
uses: actions/cache@v3
|
uses: actions/cache@v3
|
||||||
|
@ -54,7 +54,7 @@ jobs:
|
|||||||
|
|
||||||
- name: Get composer cache directory
|
- name: Get composer cache directory
|
||||||
id: composer-cache
|
id: composer-cache
|
||||||
run: echo "::set-output name=dir::$(composer config cache-files-dir)"
|
run: echo "dir=$(composer config cache-files-dir)" >> $GITHUB_OUTPUT
|
||||||
|
|
||||||
- name: Cache composer dependencies
|
- name: Cache composer dependencies
|
||||||
uses: actions/cache@v3
|
uses: actions/cache@v3
|
||||||
|
@ -56,7 +56,7 @@ jobs:
|
|||||||
|
|
||||||
- name: Get composer cache directory
|
- name: Get composer cache directory
|
||||||
id: composer-cache
|
id: composer-cache
|
||||||
run: echo "::set-output name=dir::$(composer config cache-files-dir)"
|
run: echo "dir=$(composer config cache-files-dir)" >> $GITHUB_OUTPUT
|
||||||
|
|
||||||
- name: Cache composer dependencies
|
- name: Cache composer dependencies
|
||||||
uses: actions/cache@v3
|
uses: actions/cache@v3
|
||||||
|
@ -24,7 +24,7 @@ jobs:
|
|||||||
|
|
||||||
- name: Get composer cache directory
|
- name: Get composer cache directory
|
||||||
id: composer-cache
|
id: composer-cache
|
||||||
run: echo "::set-output name=dir::$(composer config cache-files-dir)"
|
run: echo "dir=$(composer config cache-files-dir)" >> $GITHUB_OUTPUT
|
||||||
|
|
||||||
- name: Cache composer dependencies
|
- name: Cache composer dependencies
|
||||||
uses: actions/cache@v3
|
uses: actions/cache@v3
|
||||||
|
@ -54,7 +54,7 @@ jobs:
|
|||||||
|
|
||||||
- name: Get composer cache directory
|
- name: Get composer cache directory
|
||||||
id: composer-cache
|
id: composer-cache
|
||||||
run: echo "::set-output name=dir::$(composer config cache-files-dir)"
|
run: echo "dir=$(composer config cache-files-dir)" >> $GITHUB_OUTPUT
|
||||||
|
|
||||||
- name: Cache composer dependencies
|
- name: Cache composer dependencies
|
||||||
uses: actions/cache@v3
|
uses: actions/cache@v3
|
||||||
|
@ -55,7 +55,7 @@ jobs:
|
|||||||
|
|
||||||
- name: Get composer cache directory
|
- name: Get composer cache directory
|
||||||
id: composer-cache
|
id: composer-cache
|
||||||
run: echo "::set-output name=dir::$(composer config cache-files-dir)"
|
run: echo "dir=$(composer config cache-files-dir)" >> $GITHUB_OUTPUT
|
||||||
- name: Cache composer dependencies
|
- name: Cache composer dependencies
|
||||||
uses: actions/cache@v3
|
uses: actions/cache@v3
|
||||||
with:
|
with:
|
||||||
|
@ -31,7 +31,7 @@ jobs:
|
|||||||
|
|
||||||
- name: Get yarn cache
|
- name: Get yarn cache
|
||||||
id: yarn-cache
|
id: yarn-cache
|
||||||
run: echo "::set-output name=dir::$(yarn cache dir)"
|
run: echo "dir=$(yarn cache dir)" >> $GITHUB_OUTPUT
|
||||||
|
|
||||||
- uses: actions/cache@v3
|
- uses: actions/cache@v3
|
||||||
with:
|
with:
|
||||||
@ -41,7 +41,7 @@ jobs:
|
|||||||
|
|
||||||
- name: Get composer cache directory
|
- name: Get composer cache directory
|
||||||
id: composer-cache
|
id: composer-cache
|
||||||
run: echo "::set-output name=dir::$(composer config cache-files-dir)"
|
run: echo "dir=$(composer config cache-files-dir)" >> $GITHUB_OUTPUT
|
||||||
|
|
||||||
- name: Cache composer dependencies
|
- name: Cache composer dependencies
|
||||||
uses: actions/cache@v3
|
uses: actions/cache@v3
|
||||||
|
@ -22,7 +22,7 @@ jobs:
|
|||||||
|
|
||||||
- name: Get composer cache directory
|
- name: Get composer cache directory
|
||||||
id: composer-cache
|
id: composer-cache
|
||||||
run: echo "::set-output name=dir::$(composer config cache-files-dir)"
|
run: echo "dir=$(composer config cache-files-dir)" >> $GITHUB_OUTPUT
|
||||||
|
|
||||||
- name: Cache composer dependencies
|
- name: Cache composer dependencies
|
||||||
uses: actions/cache@v3
|
uses: actions/cache@v3
|
||||||
|
@ -41,7 +41,7 @@ jobs:
|
|||||||
|
|
||||||
- name: Get composer cache directory
|
- name: Get composer cache directory
|
||||||
id: composer-cache
|
id: composer-cache
|
||||||
run: echo "::set-output name=dir::$(composer config cache-files-dir)"
|
run: echo "dir=$(composer config cache-files-dir)" >> $GITHUB_OUTPUT
|
||||||
|
|
||||||
- name: Cache composer dependencies
|
- name: Cache composer dependencies
|
||||||
uses: actions/cache@v3
|
uses: actions/cache@v3
|
||||||
|
@ -41,7 +41,7 @@ jobs:
|
|||||||
|
|
||||||
- name: Get composer cache directory
|
- name: Get composer cache directory
|
||||||
id: composer-cache
|
id: composer-cache
|
||||||
run: echo "::set-output name=dir::$(composer config cache-files-dir)"
|
run: echo "dir=$(composer config cache-files-dir)" >> $GITHUB_OUTPUT
|
||||||
|
|
||||||
- name: Cache composer dependencies
|
- name: Cache composer dependencies
|
||||||
uses: actions/cache@v3
|
uses: actions/cache@v3
|
||||||
|
@ -25,7 +25,7 @@ jobs:
|
|||||||
|
|
||||||
- name: Get composer cache directory
|
- name: Get composer cache directory
|
||||||
id: composer-cache
|
id: composer-cache
|
||||||
run: echo "::set-output name=dir::$(composer config cache-files-dir)"
|
run: echo "dir=$(composer config cache-files-dir)" >> $GITHUB_OUTPUT
|
||||||
|
|
||||||
- name: Cache composer dependencies
|
- name: Cache composer dependencies
|
||||||
uses: actions/cache@v3
|
uses: actions/cache@v3
|
||||||
|
@ -51,7 +51,7 @@ jobs:
|
|||||||
|
|
||||||
- name: Get composer cache directory
|
- name: Get composer cache directory
|
||||||
id: composer-cache
|
id: composer-cache
|
||||||
run: echo "::set-output name=dir::$(composer config cache-files-dir)"
|
run: echo "dir=$(composer config cache-files-dir)" >> $GITHUB_OUTPUT
|
||||||
|
|
||||||
- name: Cache composer dependencies
|
- name: Cache composer dependencies
|
||||||
uses: actions/cache@v3
|
uses: actions/cache@v3
|
||||||
|
@ -51,7 +51,7 @@ jobs:
|
|||||||
|
|
||||||
- name: Get composer cache directory
|
- name: Get composer cache directory
|
||||||
id: composer-cache
|
id: composer-cache
|
||||||
run: echo "::set-output name=dir::$(composer config cache-files-dir)"
|
run: echo "dir=$(composer config cache-files-dir)" >> $GITHUB_OUTPUT
|
||||||
|
|
||||||
- name: Cache composer dependencies
|
- name: Cache composer dependencies
|
||||||
uses: actions/cache@v3
|
uses: actions/cache@v3
|
||||||
|
5074
package-lock.json
generated
5074
package-lock.json
generated
File diff suppressed because it is too large
Load Diff
39
package.json
39
package.json
@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "setup-php",
|
"name": "setup-php",
|
||||||
"version": "2.18.1",
|
"version": "2.22.0",
|
||||||
"private": false,
|
"private": false,
|
||||||
"description": "Setup PHP for use with GitHub Actions",
|
"description": "Setup PHP for use with GitHub Actions",
|
||||||
"main": "lib/install.js",
|
"main": "lib/install.js",
|
||||||
@ -17,7 +17,7 @@
|
|||||||
"scripts": {
|
"scripts": {
|
||||||
"build": "tsc",
|
"build": "tsc",
|
||||||
"lint": "eslint **/src/*.ts **/__tests__/*.ts --cache --fix",
|
"lint": "eslint **/src/*.ts **/__tests__/*.ts --cache --fix",
|
||||||
"format": "prettier --write **/src/*.ts **/__tests__/*.ts && git add -f src/",
|
"format": "prettier --write **/src/*.ts **/__tests__/*.ts && git add -f __tests__/ ",
|
||||||
"format-check": "prettier --check **/src/*.ts **/__tests__/*.ts",
|
"format-check": "prettier --check **/src/*.ts **/__tests__/*.ts",
|
||||||
"release": "ncc build -o dist && git add -f dist/",
|
"release": "ncc build -o dist && git add -f dist/",
|
||||||
"test": "jest"
|
"test": "jest"
|
||||||
@ -34,29 +34,28 @@
|
|||||||
"author": "shivammathur",
|
"author": "shivammathur",
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@actions/core": "^1.6.0",
|
"@actions/core": "^1.10.0",
|
||||||
"@actions/exec": "^1.1.1",
|
"@actions/exec": "^1.1.1",
|
||||||
"@actions/io": "^1.1.2",
|
"@actions/io": "^1.1.2"
|
||||||
"fs": "0.0.1-security"
|
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@types/jest": "^27.4.1",
|
"@types/jest": "^29.2.0",
|
||||||
"@types/node": "^17.0.23",
|
"@types/node": "^18.11.7",
|
||||||
"@typescript-eslint/eslint-plugin": "^5.18.0",
|
"@typescript-eslint/eslint-plugin": "^5.41.0",
|
||||||
"@typescript-eslint/parser": "^5.18.0",
|
"@typescript-eslint/parser": "^5.41.0",
|
||||||
"@vercel/ncc": "^0.33.3",
|
"@vercel/ncc": "^0.34.0",
|
||||||
"eslint": "^8.13.0",
|
"eslint": "^8.26.0",
|
||||||
"eslint-config-prettier": "^8.5.0",
|
"eslint-config-prettier": "^8.5.0",
|
||||||
"eslint-plugin-import": "^2.26.0",
|
"eslint-plugin-import": "^2.26.0",
|
||||||
"eslint-plugin-jest": "^26.1.4",
|
"eslint-plugin-jest": "^27.1.3",
|
||||||
"eslint-plugin-prettier": "^4.0.0",
|
"eslint-plugin-prettier": "^4.2.1",
|
||||||
"jest": "^27.5.1",
|
"jest": "^29.2.2",
|
||||||
"jest-circus": "^27.5.1",
|
"jest-circus": "^29.2.2",
|
||||||
"nock": "^13.2.4",
|
"nock": "^13.2.9",
|
||||||
"prettier": "^2.6.2",
|
"prettier": "^2.7.1",
|
||||||
"simple-git-hooks": "^2.7.0",
|
"simple-git-hooks": "^2.8.1",
|
||||||
"ts-jest": "^27.1.4",
|
"ts-jest": "^29.0.3",
|
||||||
"typescript": "^4.6.3"
|
"typescript": "^4.8.4"
|
||||||
},
|
},
|
||||||
"bugs": {
|
"bugs": {
|
||||||
"url": "https://github.com/shivammathur/setup-php/issues"
|
"url": "https://github.com/shivammathur/setup-php/issues"
|
||||||
|
@ -1,5 +1,8 @@
|
|||||||
amqp=amqp
|
amqp=amqp
|
||||||
apcu=apcu
|
apcu=apcu
|
||||||
|
ast=ast
|
||||||
|
couchbase=couchbase
|
||||||
|
event=event
|
||||||
expect=expect
|
expect=expect
|
||||||
gnupg=gnupg
|
gnupg=gnupg
|
||||||
grpc=grpc
|
grpc=grpc
|
||||||
@ -16,6 +19,7 @@ pcov=pcov
|
|||||||
pecl_http=http
|
pecl_http=http
|
||||||
phalcon3=phalcon
|
phalcon3=phalcon
|
||||||
phalcon4=phalcon
|
phalcon4=phalcon
|
||||||
|
phalcon5=phalcon
|
||||||
propro=propro
|
propro=propro
|
||||||
protobuf=protobuf
|
protobuf=protobuf
|
||||||
psr=psr
|
psr=psr
|
||||||
|
@ -1,2 +1,3 @@
|
|||||||
COMPOSER_PROCESS_TIMEOUT=0
|
COMPOSER_PROCESS_TIMEOUT=0
|
||||||
COMPOSER_NO_INTERACTION=1
|
COMPOSER_NO_INTERACTION=1
|
||||||
|
COMPOSER_NO_AUDIT=1
|
||||||
|
11
src/configs/php_debug_packages
Normal file
11
src/configs/php_debug_packages
Normal file
@ -0,0 +1,11 @@
|
|||||||
|
cgi
|
||||||
|
cli
|
||||||
|
curl
|
||||||
|
fpm
|
||||||
|
intl
|
||||||
|
mbstring
|
||||||
|
mysql
|
||||||
|
opcache
|
||||||
|
pgsql
|
||||||
|
xml
|
||||||
|
zip
|
@ -105,6 +105,14 @@
|
|||||||
"version_prefix": "",
|
"version_prefix": "",
|
||||||
"version_parameter": "-V"
|
"version_parameter": "-V"
|
||||||
},
|
},
|
||||||
|
"pint": {
|
||||||
|
"type": "phar",
|
||||||
|
"repository": "laravel/pint",
|
||||||
|
"extension": ".phar",
|
||||||
|
"domain": "https://github.com",
|
||||||
|
"version_prefix": "v",
|
||||||
|
"version_parameter": "-V"
|
||||||
|
},
|
||||||
"psalm": {
|
"psalm": {
|
||||||
"type": "phar",
|
"type": "phar",
|
||||||
"repository": "vimeo/psalm",
|
"repository": "vimeo/psalm",
|
||||||
@ -176,6 +184,11 @@
|
|||||||
"repository": "laravel/vapor-cli",
|
"repository": "laravel/vapor-cli",
|
||||||
"scope": "scoped"
|
"scope": "scoped"
|
||||||
},
|
},
|
||||||
|
"rector": {
|
||||||
|
"type": "composer",
|
||||||
|
"repository": "rector/rector",
|
||||||
|
"scope": "scoped"
|
||||||
|
},
|
||||||
"blackfire": {
|
"blackfire": {
|
||||||
"type": "custom-package",
|
"type": "custom-package",
|
||||||
"alias": "blackfire-agent"
|
"alias": "blackfire-agent"
|
||||||
|
@ -38,7 +38,12 @@ export async function addCoverageXdebug(
|
|||||||
extension = extension == 'xdebug3' ? 'xdebug' : extension;
|
extension = extension == 'xdebug3' ? 'xdebug' : extension;
|
||||||
script +=
|
script +=
|
||||||
(await extensions.addExtension(extension, version, os, true)) + pipe;
|
(await extensions.addExtension(extension, version, os, true)) + pipe;
|
||||||
message = 'Xdebug enabled as coverage driver';
|
script += await utils.setVariable(
|
||||||
|
'xdebug_version',
|
||||||
|
'php -r "echo phpversion(\'xdebug\');"',
|
||||||
|
os
|
||||||
|
);
|
||||||
|
message = 'Xdebug $xdebug_version enabled as coverage driver';
|
||||||
status = '$tick';
|
status = '$tick';
|
||||||
}
|
}
|
||||||
script += await utils.addLog(status, extension, message, os);
|
script += await utils.addLog(status, extension, message, os);
|
||||||
@ -66,12 +71,16 @@ export async function addCoveragePCOV(
|
|||||||
script +=
|
script +=
|
||||||
(await extensions.addExtension('pcov', version, os, true)) + pipe;
|
(await extensions.addExtension('pcov', version, os, true)) + pipe;
|
||||||
script += (await config.addINIValues('pcov.enabled=1', os, true)) + '\n';
|
script += (await config.addINIValues('pcov.enabled=1', os, true)) + '\n';
|
||||||
|
script += await utils.setVariable(
|
||||||
|
'pcov_version',
|
||||||
|
'php -r "echo phpversion(\'pcov\');"',
|
||||||
|
os
|
||||||
|
);
|
||||||
// success
|
// success
|
||||||
script += await utils.addLog(
|
script += await utils.addLog(
|
||||||
'$tick',
|
'$tick',
|
||||||
'coverage: pcov',
|
'coverage: pcov',
|
||||||
'PCOV enabled as coverage driver',
|
'PCOV $pcov_version enabled as coverage driver',
|
||||||
os
|
os
|
||||||
);
|
);
|
||||||
// version is not supported
|
// version is not supported
|
||||||
|
@ -33,17 +33,19 @@ export async function addExtensionDarwin(
|
|||||||
return;
|
return;
|
||||||
// match 5.3blackfire...8.1blackfire
|
// match 5.3blackfire...8.1blackfire
|
||||||
// match 5.3blackfire-(semver)...8.1blackfire-(semver)
|
// match 5.3blackfire-(semver)...8.1blackfire-(semver)
|
||||||
// match couchbase, geos, pdo_oci, oci8, http, pecl_http
|
// match couchbase, event, geos, pdo_oci, oci8, http, pecl_http
|
||||||
// match 5.3ioncube...7.4ioncube
|
// match 5.3ioncube...7.4ioncube
|
||||||
// match 7.0phalcon3...7.3phalcon3 and 7.2phalcon4...7.4phalcon4
|
// match 7.0phalcon3...7.3phalcon3, 7.2phalcon4...7.4phalcon4, and 7.4phalcon5...8.2phalcon5
|
||||||
case /^(5\.[3-6]|7\.[0-4]|8\.[0-1])blackfire(-\d+\.\d+\.\d+)?$/.test(
|
case /^(5\.[3-6]|7\.[0-4]|8\.[0-1])blackfire(-\d+\.\d+\.\d+)?$/.test(
|
||||||
version_extension
|
version_extension
|
||||||
):
|
):
|
||||||
case /^couchbase$|^geos$|^pdo_oci$|^oci8$|^(pecl_)?http|^pdo_firebird$/.test(
|
case /^couchbase|^event|^geos$|^pdo_oci$|^oci8$|^(pecl_)?http|^pdo_firebird$/.test(
|
||||||
extension
|
extension
|
||||||
):
|
):
|
||||||
case /^(5\.[3-6]|7\.[0-4])ioncube$/.test(version_extension):
|
case /^(5\.[3-6]|7\.[0-4])ioncube$/.test(version_extension):
|
||||||
case /(5\.6|7\.[0-3])phalcon3|7\.[2-4]phalcon4/.test(version_extension):
|
case /(5\.6|7\.[0-3])phalcon3|7\.[2-4]phalcon4|(7\.4|8\.[0-2])phalcon5/.test(
|
||||||
|
version_extension
|
||||||
|
):
|
||||||
case /(?<!5\.[3-6])(pdo_)?sqlsrv$/.test(version_extension):
|
case /(?<!5\.[3-6])(pdo_)?sqlsrv$/.test(version_extension):
|
||||||
add_script += await utils.customPackage(
|
add_script += await utils.customPackage(
|
||||||
ext_name,
|
ext_name,
|
||||||
@ -83,7 +85,7 @@ export async function addExtensionDarwin(
|
|||||||
):
|
):
|
||||||
case /(5\.6|7\.[0-4])propro/.test(version_extension):
|
case /(5\.6|7\.[0-4])propro/.test(version_extension):
|
||||||
case /(?<!5\.[3-6]|7\.0)pcov/.test(version_extension):
|
case /(?<!5\.[3-6]|7\.0)pcov/.test(version_extension):
|
||||||
case /(?<!5\.[3-6])(vips|xlswriter)/.test(version_extension):
|
case /(?<!5\.[3-6])(ast|vips|xlswriter)/.test(version_extension):
|
||||||
add_script += await utils.joins(
|
add_script += await utils.joins(
|
||||||
'\nadd_brew_extension',
|
'\nadd_brew_extension',
|
||||||
ext_name,
|
ext_name,
|
||||||
@ -132,14 +134,16 @@ export async function addExtensionWindows(
|
|||||||
// match 5.3blackfire-(semver)...8.1blackfire-(semver)
|
// match 5.3blackfire-(semver)...8.1blackfire-(semver)
|
||||||
// match pdo_oci and oci8
|
// match pdo_oci and oci8
|
||||||
// match 5.3ioncube...7.4ioncube
|
// match 5.3ioncube...7.4ioncube
|
||||||
// match 7.0phalcon3...7.3phalcon3 and 7.2phalcon4...7.4phalcon4
|
// match 7.0phalcon3...7.3phalcon3, 7.2phalcon4...7.4phalcon4, and 7.4phalcon5...8.2phalcon5
|
||||||
// match 7.1pecl_http...8.1pecl_http and 7.1http...8.1http
|
// match 7.1pecl_http...8.1pecl_http and 7.1http...8.1http
|
||||||
case /^(5\.[3-6]|7\.[0-4]|8\.1)blackfire(-\d+\.\d+\.\d+)?$/.test(
|
case /^(5\.[3-6]|7\.[0-4]|8\.1)blackfire(-\d+\.\d+\.\d+)?$/.test(
|
||||||
version_extension
|
version_extension
|
||||||
):
|
):
|
||||||
case /^pdo_oci$|^oci8$|^pdo_firebird$/.test(extension):
|
case /^pdo_oci$|^oci8$|^pdo_firebird$/.test(extension):
|
||||||
case /^(5\.[3-6]|7\.[0-4])ioncube$/.test(version_extension):
|
case /^(5\.[3-6]|7\.[0-4])ioncube$/.test(version_extension):
|
||||||
case /^7\.[0-3]phalcon3$|^7\.[2-4]phalcon4$/.test(version_extension):
|
case /^7\.[0-3]phalcon3$|^7\.[2-4]phalcon4$|^(7\.4|8\.[0-2])phalcon5$/.test(
|
||||||
|
version_extension
|
||||||
|
):
|
||||||
case /^(7\.[1-4]|8\.1)(pecl_)?http/.test(version_extension):
|
case /^(7\.[1-4]|8\.1)(pecl_)?http/.test(version_extension):
|
||||||
add_script += await utils.customPackage(
|
add_script += await utils.customPackage(
|
||||||
ext_name,
|
ext_name,
|
||||||
@ -255,19 +259,21 @@ export async function addExtensionLinux(
|
|||||||
// match 5.3pdo_cubrid...7.2php_cubrid, 5.3cubrid...7.4cubrid
|
// match 5.3pdo_cubrid...7.2php_cubrid, 5.3cubrid...7.4cubrid
|
||||||
// match couchbase, geos, pdo_oci, oci8, http, pecl_http
|
// match couchbase, geos, pdo_oci, oci8, http, pecl_http
|
||||||
// match 5.3ioncube...7.4ioncube
|
// match 5.3ioncube...7.4ioncube
|
||||||
// match 7.0phalcon3...7.3phalcon3 and 7.2phalcon4...7.4phalcon4
|
// match 7.0phalcon3...7.3phalcon3, 7.2phalcon4...7.4phalcon4, 7.4phalcon5...8.2phalcon5
|
||||||
case /^(5\.[3-6]|7\.[0-4]|8\.[0-1])blackfire(-\d+\.\d+\.\d+)?$/.test(
|
case /^(5\.[3-6]|7\.[0-4]|8\.[0-1])blackfire(-\d+\.\d+\.\d+)?$/.test(
|
||||||
version_extension
|
version_extension
|
||||||
):
|
):
|
||||||
case /^((5\.[3-6])|(7\.[0-2]))pdo_cubrid$|^((5\.[3-6])|(7\.[0-4]))cubrid$/.test(
|
case /^((5\.[3-6])|(7\.[0-2]))pdo_cubrid$|^((5\.[3-6])|(7\.[0-4]))cubrid$/.test(
|
||||||
version_extension
|
version_extension
|
||||||
):
|
):
|
||||||
case /^couchbase$|^gearman$|^geos$|^pdo_oci$|^oci8$|^(pecl_)?http|^pdo_firebird$/.test(
|
case /^couchbase|^event|^gearman$|^geos$|^pdo_oci$|^oci8$|^(pecl_)?http|^pdo_firebird$/.test(
|
||||||
extension
|
extension
|
||||||
):
|
):
|
||||||
case /(?<!5\.[3-5])intl-[\d]+\.[\d]+$/.test(version_extension):
|
case /(?<!5\.[3-5])intl-[\d]+\.[\d]+$/.test(version_extension):
|
||||||
case /^(5\.[3-6]|7\.[0-4])ioncube$/.test(version_extension):
|
case /^(5\.[3-6]|7\.[0-4])ioncube$/.test(version_extension):
|
||||||
case /^7\.[0-3]phalcon3$|^7\.[2-4]phalcon4$/.test(version_extension):
|
case /^7\.[0-3]phalcon3$|^7\.[2-4]phalcon4$|^(7\.4|8\.[0-2])phalcon5$/.test(
|
||||||
|
version_extension
|
||||||
|
):
|
||||||
case /(?<!5\.[3-6])(pdo_)?sqlsrv$/.test(version_extension):
|
case /(?<!5\.[3-6])(pdo_)?sqlsrv$/.test(version_extension):
|
||||||
add_script += await utils.customPackage(
|
add_script += await utils.customPackage(
|
||||||
ext_name,
|
ext_name,
|
||||||
|
@ -3,10 +3,11 @@ import * as https from 'https';
|
|||||||
import * as url from 'url';
|
import * as url from 'url';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Function to fetch an URL
|
* Function to fetch a URL
|
||||||
*
|
*
|
||||||
* @param input_url
|
* @param input_url
|
||||||
* @param auth_token
|
* @param auth_token
|
||||||
|
* @param redirect_count
|
||||||
*/
|
*/
|
||||||
export async function fetch(
|
export async function fetch(
|
||||||
input_url: string,
|
input_url: string,
|
||||||
|
@ -1,16 +1,7 @@
|
|||||||
# Function to setup environment for self-hosted runners.
|
|
||||||
self_hosted_helper() {
|
|
||||||
if ! command -v brew >/dev/null; then
|
|
||||||
step_log "Setup Brew"
|
|
||||||
get -q -e "/tmp/install.sh" "https://raw.githubusercontent.com/Homebrew/install/master/install.sh" && /tmp/install.sh >/dev/null 2>&1
|
|
||||||
add_log "${tick:?}" "Brew" "Installed Homebrew"
|
|
||||||
fi
|
|
||||||
}
|
|
||||||
|
|
||||||
# Disable dependency extensions
|
# Disable dependency extensions
|
||||||
disable_dependency_extensions() {
|
disable_dependency_extensions() {
|
||||||
local extension=$1
|
local extension=$1
|
||||||
formula_file="$tap_dir/$ext_tap/Formula/$extension@${version:?}.rb"
|
formula_file="${tap_dir:?}/$ext_tap/Formula/$extension@${version:?}.rb"
|
||||||
if [ -e "$formula_file" ]; then
|
if [ -e "$formula_file" ]; then
|
||||||
IFS=" " read -r -a dependency_extensions <<< "$(grep -Eo "shivammathur.*@" "$formula_file" | xargs -I {} -n 1 basename '{}' | cut -d '@' -f 1 | tr '\n' ' ')"
|
IFS=" " read -r -a dependency_extensions <<< "$(grep -Eo "shivammathur.*@" "$formula_file" | xargs -I {} -n 1 basename '{}' | cut -d '@' -f 1 | tr '\n' ' ')"
|
||||||
for dependency_extension in "${dependency_extensions[@]}"; do
|
for dependency_extension in "${dependency_extensions[@]}"; do
|
||||||
@ -33,33 +24,6 @@ disable_extension_helper() {
|
|||||||
echo '' | sudo tee /tmp/extdisabled/"$version"/"$extension" >/dev/null 2>&1
|
echo '' | sudo tee /tmp/extdisabled/"$version"/"$extension" >/dev/null 2>&1
|
||||||
}
|
}
|
||||||
|
|
||||||
# Function to fetch a brew tap.
|
|
||||||
fetch_brew_tap() {
|
|
||||||
tap=$1
|
|
||||||
tap_user=$(dirname "$tap")
|
|
||||||
tap_name=$(basename "$tap")
|
|
||||||
mkdir -p "$tap_dir/$tap_user"
|
|
||||||
get -s -n "" "https://github.com/$tap/archive/master.tar.gz" | sudo tar -xzf - -C "$tap_dir/$tap_user"
|
|
||||||
if [ -d "$tap_dir/$tap_user/$tap_name-master" ]; then
|
|
||||||
sudo mv "$tap_dir/$tap_user/$tap_name-master" "$tap_dir/$tap_user/$tap_name"
|
|
||||||
fi
|
|
||||||
}
|
|
||||||
|
|
||||||
# Function to add a brew tap.
|
|
||||||
add_brew_tap() {
|
|
||||||
tap=$1
|
|
||||||
if ! [ -d "$tap_dir/$tap" ]; then
|
|
||||||
if [ "${runner:?}" = "self-hosted" ]; then
|
|
||||||
brew tap "$tap" >/dev/null 2>&1
|
|
||||||
else
|
|
||||||
fetch_brew_tap "$tap" >/dev/null 2>&1
|
|
||||||
if ! [ -d "$tap_dir/$tap" ]; then
|
|
||||||
brew tap "$tap" >/dev/null 2>&1
|
|
||||||
fi
|
|
||||||
fi
|
|
||||||
fi
|
|
||||||
}
|
|
||||||
|
|
||||||
# Function to get extension name from brew formula.
|
# Function to get extension name from brew formula.
|
||||||
get_extension_from_formula() {
|
get_extension_from_formula() {
|
||||||
local formula=$1
|
local formula=$1
|
||||||
@ -76,9 +40,10 @@ copy_brew_extensions() {
|
|||||||
deps="$(grep -Eo 'depends_on "shivammathur[^"]+' "$formula_file" | cut -d '/' -f 3 | tr '\n' ' ')"
|
deps="$(grep -Eo 'depends_on "shivammathur[^"]+' "$formula_file" | cut -d '/' -f 3 | tr '\n' ' ')"
|
||||||
IFS=' ' read -r -a deps <<< "$formula@$version $deps"
|
IFS=' ' read -r -a deps <<< "$formula@$version $deps"
|
||||||
for dependency in "${deps[@]}"; do
|
for dependency in "${deps[@]}"; do
|
||||||
extension_file="$brew_prefix/opt/$dependency/$(get_extension_from_formula "${dependency%@*}").so"
|
extension_file="${brew_prefix:?}/opt/$dependency/$(get_extension_from_formula "${dependency%@*}").so"
|
||||||
[ -e "$extension_file" ] && sudo cp "$extension_file" "$ext_dir"
|
[ -e "$extension_file" ] && sudo cp "$extension_file" "$ext_dir"
|
||||||
done
|
done
|
||||||
|
sudo find -- "$brew_prefix"/Cellar/"$formula"@"$version" -name "*.dylib" -exec cp {} "$ext_dir" \;
|
||||||
}
|
}
|
||||||
|
|
||||||
# Function to install a php extension from shivammathur/extensions tap.
|
# Function to install a php extension from shivammathur/extensions tap.
|
||||||
@ -92,10 +57,10 @@ add_brew_extension() {
|
|||||||
else
|
else
|
||||||
add_brew_tap "$php_tap"
|
add_brew_tap "$php_tap"
|
||||||
add_brew_tap "$ext_tap"
|
add_brew_tap "$ext_tap"
|
||||||
sudo mv "$tap_dir"/"$ext_tap"/.github/deps/"$formula"/* "$core_repo/Formula/" 2>/dev/null || true
|
sudo mv "$tap_dir"/"$ext_tap"/.github/deps/"$formula"/* "${core_repo:?}/Formula/" 2>/dev/null || true
|
||||||
update_dependencies >/dev/null 2>&1
|
update_dependencies >/dev/null 2>&1
|
||||||
disable_dependency_extensions "$extension" >/dev/null 2>&1
|
disable_dependency_extensions "$extension" >/dev/null 2>&1
|
||||||
brew install -f "$formula@$version" >/dev/null 2>&1
|
brew install -f "$ext_tap/$formula@$version" >/dev/null 2>&1
|
||||||
copy_brew_extensions "$formula"
|
copy_brew_extensions "$formula"
|
||||||
add_extension_log "$extension" "Installed and enabled"
|
add_extension_log "$extension" "Installed and enabled"
|
||||||
fi
|
fi
|
||||||
@ -141,7 +106,7 @@ link_libraries() {
|
|||||||
|
|
||||||
# Patch brew to overwrite packages.
|
# Patch brew to overwrite packages.
|
||||||
patch_brew() {
|
patch_brew() {
|
||||||
formula_installer="$brew_repo"/Library/Homebrew/formula_installer.rb
|
formula_installer="${brew_repo:?}"/Library/Homebrew/formula_installer.rb
|
||||||
code=" keg.link\(verbose: verbose\?"
|
code=" keg.link\(verbose: verbose\?"
|
||||||
sudo sed -Ei '' "s/$code.*/$code, overwrite: true\)/" "$formula_installer"
|
sudo sed -Ei '' "s/$code.*/$code, overwrite: true\)/" "$formula_installer"
|
||||||
# shellcheck disable=SC2064
|
# shellcheck disable=SC2064
|
||||||
@ -199,6 +164,7 @@ add_php() {
|
|||||||
existing_version=$2
|
existing_version=$2
|
||||||
add_brew_tap "$php_tap"
|
add_brew_tap "$php_tap"
|
||||||
update_dependencies
|
update_dependencies
|
||||||
|
[ "${debug:?}" = "debug" ] && php_formula="$php_formula-debug"
|
||||||
if [ "$existing_version" != "false" ]; then
|
if [ "$existing_version" != "false" ]; then
|
||||||
([ "$action" = "upgrade" ] && brew upgrade -f "$php_formula") || brew unlink "$php_formula"
|
([ "$action" = "upgrade" ] && brew upgrade -f "$php_formula") || brew unlink "$php_formula"
|
||||||
else
|
else
|
||||||
@ -279,12 +245,6 @@ version=${1:-'8.1'}
|
|||||||
ini=${2:-'production'}
|
ini=${2:-'production'}
|
||||||
src=${0%/*}/..
|
src=${0%/*}/..
|
||||||
php_formula=shivammathur/php/php@"$version"
|
php_formula=shivammathur/php/php@"$version"
|
||||||
brew_path="$(command -v brew)"
|
|
||||||
brew_path_dir="$(dirname "$brew_path")"
|
|
||||||
brew_prefix="$brew_path_dir"/..
|
|
||||||
brew_repo="$brew_path_dir/$(dirname "$(readlink "$brew_path")")"/..
|
|
||||||
tap_dir="$brew_repo"/Library/Taps
|
|
||||||
core_repo="$tap_dir"/homebrew/homebrew-core
|
|
||||||
scripts="$src"/scripts
|
scripts="$src"/scripts
|
||||||
ext_tap=shivammathur/homebrew-extensions
|
ext_tap=shivammathur/homebrew-extensions
|
||||||
php_tap=shivammathur/homebrew-php
|
php_tap=shivammathur/homebrew-php
|
||||||
@ -297,9 +257,11 @@ export HOMEBREW_NO_INSTALLED_DEPENDENTS_CHECK=1
|
|||||||
|
|
||||||
# shellcheck source=.
|
# shellcheck source=.
|
||||||
. "${scripts:?}"/unix.sh
|
. "${scripts:?}"/unix.sh
|
||||||
|
. "${scripts:?}"/tools/brew.sh
|
||||||
. "${scripts:?}"/tools/add_tools.sh
|
. "${scripts:?}"/tools/add_tools.sh
|
||||||
. "${scripts:?}"/extensions/source.sh
|
. "${scripts:?}"/extensions/source.sh
|
||||||
. "${scripts:?}"/extensions/add_extensions.sh
|
. "${scripts:?}"/extensions/add_extensions.sh
|
||||||
|
configure_brew
|
||||||
read_env
|
read_env
|
||||||
self_hosted_setup
|
self_hosted_setup
|
||||||
setup_php
|
setup_php
|
||||||
|
@ -30,7 +30,8 @@ enable_cache_extension_dependencies() {
|
|||||||
cache_dir=$(find /tmp/extcache -maxdepth 1 -type d -regex ".*$1[0-9]*")
|
cache_dir=$(find /tmp/extcache -maxdepth 1 -type d -regex ".*$1[0-9]*")
|
||||||
if [[ -n "$cache_dir" ]]; then
|
if [[ -n "$cache_dir" ]]; then
|
||||||
IFS=" " read -r -a deps <<<"$(find "$cache_dir" -maxdepth 1 -type f -name "*" -exec basename {} \; | tr '\n' ' ')"
|
IFS=" " read -r -a deps <<<"$(find "$cache_dir" -maxdepth 1 -type f -name "*" -exec basename {} \; | tr '\n' ' ')"
|
||||||
if [[ -n "${deps[*]}" ]] && php "${deps[@]/#/-d ${2}=}" -d "${2}=$1" -m 2>/dev/null | grep -i -q "$1"; then
|
IFS="#" read -r -a deps_enable <<<"$(printf -- "-d ${2}=%s.so#" "${deps[@]}")"
|
||||||
|
if [[ -n "${deps[*]}" ]] && php "${deps_enable[@]}" -d "${2}=$1.so" -m 2>/dev/null | grep -i -q "$1"; then
|
||||||
for ext in "${deps[@]}"; do
|
for ext in "${deps[@]}"; do
|
||||||
sudo rm -rf /tmp/extcache/"$ext"
|
sudo rm -rf /tmp/extcache/"$ext"
|
||||||
enable_extension "$ext" "$2"
|
enable_extension "$ext" "$2"
|
||||||
@ -119,6 +120,7 @@ disable_all_shared() {
|
|||||||
|
|
||||||
# Function to configure PECL.
|
# Function to configure PECL.
|
||||||
configure_pecl() {
|
configure_pecl() {
|
||||||
|
[ -z "${pecl_file:-${ini_file[@]}}" ] && return
|
||||||
if ! [ -e /tmp/pecl_config ]; then
|
if ! [ -e /tmp/pecl_config ]; then
|
||||||
for script in pear pecl; do
|
for script in pear pecl; do
|
||||||
sudo "$script" config-set php_ini "${pecl_file:-${ini_file[@]}}"
|
sudo "$script" config-set php_ini "${pecl_file:-${ini_file[@]}}"
|
||||||
@ -143,13 +145,18 @@ 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
|
||||||
stability="$(echo "$2" | grep -m 1 -Eio "(stable|alpha|beta|rc|snapshot|preview)")"
|
states=("stable" "rc" "preview" "beta" "alpha" "snapshot")
|
||||||
|
stability="$(echo "$2" | grep -m 1 -Eio "($(IFS='|' ; echo "${states[*]}"))")"
|
||||||
|
IFS=' ' read -r -a states <<< "$(echo "${states[@]}" | grep -Eo "$stability.*")"
|
||||||
|
major_version=${3:-'[0-9]+'}
|
||||||
pecl_rest='https://pecl.php.net/rest/r/'
|
pecl_rest='https://pecl.php.net/rest/r/'
|
||||||
response=$(get -s -n "" "$pecl_rest$extension"/allreleases.xml)
|
response=$(get -s -n "" "$pecl_rest$extension"/allreleases.xml)
|
||||||
pecl_version=$(echo "$response" | grep -m 1 -Eio "([0-9]+\.[0-9]+\.[0-9]+${stability}[0-9]+)")
|
for state in "${states[@]}"; do
|
||||||
if [ ! "$pecl_version" ]; then
|
pecl_version=$(echo "$response" | grep -m 1 -Eio "($major_version\.[0-9]+\.[0-9]+${state}[0-9]+<)" | cut -d '<' -f 1)
|
||||||
pecl_version=$(echo "$response" | grep -m 1 -Eo "([0-9]+\.[0-9]+\.[0-9]+)")
|
[ -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)
|
||||||
fi
|
[ -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"
|
echo "$pecl_version"
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -162,7 +169,11 @@ pecl_install() {
|
|||||||
suffix_opts="$(parse_args "$extension" CONFIGURE_OPTS) $(parse_args "$extension" CONFIGURE_SUFFIX_OPTS)"
|
suffix_opts="$(parse_args "$extension" CONFIGURE_OPTS) $(parse_args "$extension" CONFIGURE_SUFFIX_OPTS)"
|
||||||
IFS=' ' read -r -a libraries <<<"$(parse_args "$extension" LIBS) $(parse_args "$extension" "$(uname -s)"_LIBS)"
|
IFS=' ' read -r -a libraries <<<"$(parse_args "$extension" LIBS) $(parse_args "$extension" "$(uname -s)"_LIBS)"
|
||||||
(( ${#libraries[@]} )) && add_libs "${libraries[@]}" >/dev/null 2>&1
|
(( ${#libraries[@]} )) && add_libs "${libraries[@]}" >/dev/null 2>&1
|
||||||
yes '' 2>/dev/null | sudo "$prefix_opts" pecl install -f -D "$(parse_pecl_configure_options "$suffix_opts")" "$extension" >/dev/null 2>&1
|
if [ "$version" = "5.3" ]; then
|
||||||
|
yes '' 2>/dev/null | sudo "$prefix_opts" pecl install -f "$extension" >/dev/null 2>&1
|
||||||
|
else
|
||||||
|
yes '' 2>/dev/null | sudo "$prefix_opts" pecl install -f -D "$(parse_pecl_configure_options "$suffix_opts")" "$extension" >/dev/null 2>&1
|
||||||
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
# Function to install a specific version of PECL extension.
|
# Function to install a specific version of PECL extension.
|
||||||
@ -179,8 +190,11 @@ add_pecl_extension() {
|
|||||||
add_log "${tick:?}" "$extension" "Enabled"
|
add_log "${tick:?}" "$extension" "Enabled"
|
||||||
else
|
else
|
||||||
disable_extension_helper "$extension" >/dev/null 2>&1
|
disable_extension_helper "$extension" >/dev/null 2>&1
|
||||||
pecl_install "$extension-$pecl_version"
|
[ -n "$pecl_version" ] && pecl_version="-$pecl_version"
|
||||||
add_extension_log "$extension-$pecl_version" "Installed and enabled"
|
pecl_install "$extension$pecl_version" || add_extension "$extension" "$(get_extension_prefix "$extension")" >/dev/null 2>&1
|
||||||
|
extension_version="$(php -r "echo phpversion('$extension');")"
|
||||||
|
[ -n "$extension_version" ] && extension_version="-$extension_version"
|
||||||
|
add_extension_log "$extension$extension_version" "Installed and enabled"
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -192,3 +206,8 @@ add_unstable_extension() {
|
|||||||
pecl_version=$(get_pecl_version "$extension" "$stability")
|
pecl_version=$(get_pecl_version "$extension" "$stability")
|
||||||
add_pecl_extension "$extension" "$pecl_version" "$prefix"
|
add_pecl_extension "$extension" "$pecl_version" "$prefix"
|
||||||
}
|
}
|
||||||
|
|
||||||
|
# Function to get extension prefix
|
||||||
|
get_extension_prefix() {
|
||||||
|
echo "$1" | grep -Eq "xdebug([2-3])?$|opcache|ioncube|eaccelerator" && echo zend_extension || echo extension
|
||||||
|
}
|
||||||
|
@ -1,43 +1,76 @@
|
|||||||
# Function to install libraries required by couchbase
|
# Function to install libraries required by couchbase
|
||||||
add_couchbase_libs() {
|
add_couchbase_clibs() {
|
||||||
if [ "$(uname -s)" = "Linux" ]; then
|
ext=$1
|
||||||
trunk="https://github.com/couchbase/libcouchbase/releases"
|
trunk="https://github.com/couchbase/libcouchbase/releases"
|
||||||
if [[ ${version:?} =~ 5.[3-6]|7.[0-1] ]]; then
|
if [[ "$ext" =~ couchbase-2.+ ]]; then
|
||||||
release="2.10.9"
|
release="2.10.9"
|
||||||
else
|
|
||||||
release="$(curl -sL $trunk/latest | grep -Eo "libcouchbase-[0-9]+\.[0-9]+\.[0-9]+" | head -n 1 | cut -d'-' -f 2)"
|
|
||||||
fi
|
|
||||||
deb_url="$trunk/download/$release/libcouchbase-${release}_ubuntu${VERSION_ID/./}_${VERSION_CODENAME}_amd64.tar"
|
|
||||||
get -q -n /tmp/libcouchbase.tar "$deb_url"
|
|
||||||
sudo tar -xf /tmp/libcouchbase.tar -C /tmp
|
|
||||||
install_packages libev4 libevent-dev
|
|
||||||
sudo dpkg -i /tmp/libcouchbase-*/*.deb
|
|
||||||
else
|
else
|
||||||
if [[ ${version:?} =~ 5.[3-6]|7.[0-1] ]]; then
|
release=$(get -s -n "" "$trunk"/latest | grep -Eo -m 1 "[0-9]+\.[0-9]+\.[0-9]+" | head -n 1)
|
||||||
brew install libcouchbase@2
|
fi
|
||||||
brew link --overwrite --force libcouchbase@2
|
[ "$VERSION_ID" = "22.04" ] && vid=20.04 || vid="$VERSION_ID"
|
||||||
else
|
[ "$VERSION_CODENAME" = "jammy" ] && vcn=focal || vcn="$VERSION_CODENAME"
|
||||||
brew install libcouchbase
|
deb_url="$trunk/download/$release/libcouchbase-${release}_ubuntu${vid/./}_${vcn}_amd64.tar"
|
||||||
|
get -q -n /tmp/libcouchbase.tar "$deb_url"
|
||||||
|
sudo tar -xf /tmp/libcouchbase.tar -C /tmp
|
||||||
|
install_packages libev4 libevent-dev
|
||||||
|
sudo dpkg -i /tmp/libcouchbase-*/*.deb
|
||||||
|
}
|
||||||
|
|
||||||
|
add_couchbase_cxxlibs() {
|
||||||
|
if [ "$VERSION_ID" = "18.04" ]; then
|
||||||
|
if ! command -v gcc-8 >/dev/null || ! command -v g++-8 >/dev/null; then
|
||||||
|
install_packages gcc-8 g++-8 -y
|
||||||
fi
|
fi
|
||||||
|
printf "gcc g++" | xargs -d ' ' -I {} sudo update-alternatives --install /usr/bin/{} {} /usr/bin/{}-8 8
|
||||||
|
fi
|
||||||
|
if [ "${runner:?}" = "self-hosted" ]; then
|
||||||
|
add_list cmake https://apt.kitware.com/ubuntu/ https://apt.kitware.com/keys/kitware-archive-latest.asc "$VERSION_CODENAME" main
|
||||||
|
fi
|
||||||
|
install_packages cmake ccache
|
||||||
|
}
|
||||||
|
|
||||||
|
get_couchbase_version() {
|
||||||
|
if [[ "${version:?}" =~ ${old_versions:?} ]]; then
|
||||||
|
echo couchbase-2.2.3
|
||||||
|
elif [[ "${version:?}" =~ 5.6|7.[0-1] ]]; then
|
||||||
|
echo couchbase-2.6.2
|
||||||
|
elif [ "${version:?}" = '7.2' ]; then
|
||||||
|
echo couchbase-3.0.4
|
||||||
|
elif [ "${version:?}" = '7.3' ]; then
|
||||||
|
echo couchbase-3.2.2
|
||||||
|
else
|
||||||
|
echo couchbase
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
# Function to add couchbase.
|
# Function to add couchbase.
|
||||||
add_couchbase() {
|
add_couchbase() {
|
||||||
add_couchbase_libs >/dev/null 2>&1
|
ext=$1
|
||||||
enable_extension "couchbase" "extension"
|
if [ "$(uname -s)" = "Linux" ]; then
|
||||||
if check_extension "couchbase"; then
|
if [ "$ext" = "couchbase" ]; then
|
||||||
add_log "${tick:?}" "couchbase" "Enabled"
|
ext=$(get_couchbase_version)
|
||||||
else
|
|
||||||
if [[ "${version:?}" =~ ${old_versions:?} ]]; then
|
|
||||||
pecl_install couchbase-2.2.3 >/dev/null 2>&1
|
|
||||||
elif [[ "${version:?}" =~ 5.6|7.[0-1] ]]; then
|
|
||||||
pecl_install couchbase-2.6.2 >/dev/null 2>&1
|
|
||||||
elif [[ "${version:?}" =~ 7.2 ]]; then
|
|
||||||
pecl_install couchbase-3.0.4 >/dev/null 2>&1
|
|
||||||
else
|
|
||||||
pecl_install couchbase >/dev/null 2>&1
|
|
||||||
fi
|
fi
|
||||||
add_extension_log "couchbase" "Installed and enabled"
|
if [[ "$ext" =~ couchbase-[2-3].+ ]]; then
|
||||||
|
add_couchbase_clibs "$ext" >/dev/null 2>&1
|
||||||
|
else
|
||||||
|
add_couchbase_cxxlibs >/dev/null 2>&1
|
||||||
|
fi
|
||||||
|
enable_extension "couchbase" "extension"
|
||||||
|
if check_extension "couchbase"; then
|
||||||
|
add_log "${tick:?}" "couchbase" "Enabled"
|
||||||
|
else
|
||||||
|
if [ "$ext" = "couchbase" ]; then
|
||||||
|
ext="couchbase-$(get_pecl_version "couchbase" "stable")"
|
||||||
|
add_extension_from_source couchbase https://pecl.php.net couchbase couchbase "${ext##*-}" extension pecl >/dev/null 2>&1
|
||||||
|
else
|
||||||
|
pecl_install "${ext}" >/dev/null 2>&1
|
||||||
|
fi
|
||||||
|
add_extension_log "couchbase" "Installed and enabled"
|
||||||
|
fi
|
||||||
|
else
|
||||||
|
if [ -e "${ext_dir:?}"/libcouchbase_php_core.dylib ]; then
|
||||||
|
sudo cp "${ext_dir:?}"/libcouchbase_php_core.dylib "${brew_prefix:?}"/lib
|
||||||
|
fi
|
||||||
|
add_brew_extension couchbase extension
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
50
src/scripts/extensions/event.sh
Normal file
50
src/scripts/extensions/event.sh
Normal file
@ -0,0 +1,50 @@
|
|||||||
|
# Function to get event configure options
|
||||||
|
get_event_configure_opts() {
|
||||||
|
event_opts=(
|
||||||
|
--with-event-core
|
||||||
|
--with-event-extra
|
||||||
|
--with-event-openssl
|
||||||
|
--enable-event-sockets
|
||||||
|
)
|
||||||
|
if [ "$os" = 'Linux' ]; then
|
||||||
|
event_opts+=(
|
||||||
|
--with-openssl-dir=yes
|
||||||
|
--with-event-libevent-dir=/usr
|
||||||
|
)
|
||||||
|
else
|
||||||
|
event_opts+=(
|
||||||
|
--with-openssl-dir="$(brew --prefix openssl@1.1)"
|
||||||
|
--with-event-libevent-dir="$(brew --prefix libevent)"
|
||||||
|
)
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
|
||||||
|
# Helper function to compile and install event
|
||||||
|
add_event_helper() {
|
||||||
|
local ext=$1
|
||||||
|
[[ "$ext" =~ ^event$ ]] && ext="event-$(get_pecl_version "event" "stable")"
|
||||||
|
event_opts=() && get_event_configure_opts
|
||||||
|
export EVENT_LINUX_LIBS='libevent-dev'
|
||||||
|
export EVENT_DARWIN_LIBS='libevent'
|
||||||
|
event_configure_opts="--with-php-config=$(command -v php-config) ${event_opts[*]}"
|
||||||
|
export EVENT_CONFIGURE_OPTS="$event_configure_opts"
|
||||||
|
add_extension_from_source event https://pecl.php.net event event "${ext##*-}" extension pecl
|
||||||
|
}
|
||||||
|
|
||||||
|
# Function to add event
|
||||||
|
add_event() {
|
||||||
|
local ext=$1
|
||||||
|
enable_extension "event" "extension"
|
||||||
|
if check_extension "event"; then
|
||||||
|
add_log "${tick:?}" "event" "Enabled"
|
||||||
|
else
|
||||||
|
if ! [[ "${version:?}" =~ ${old_versions:?} ]] && [ "$os" = "Darwin" ]; then
|
||||||
|
add_brew_extension event extension >/dev/null 2>&1
|
||||||
|
else
|
||||||
|
add_event_helper "$ext" >/dev/null 2>&1
|
||||||
|
fi
|
||||||
|
add_extension_log "event" "Installed and enabled"
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
|
||||||
|
os="$(uname -s)"
|
@ -1,6 +1,7 @@
|
|||||||
add_firebird_client_darwin() {
|
add_firebird_client_darwin() {
|
||||||
firebird_tag='R3_0_7'
|
firebird_tag='R3_0_7'
|
||||||
pkg_name=$(get -s -n "" https://github.com/FirebirdSQL/firebird/releases/tag/"$firebird_tag" | grep -Eo "Firebird-.*.pkg" | head -n 1)
|
pkg_name=$(get -s -n "" https://api.github.com/repos/FirebirdSQL/firebird/releases/tags/"$firebird_tag" | grep -Eo "Firebird-.*.pkg" | head -n 1)
|
||||||
|
[ -z "$pkg_name" ] && pkg_name=$(get -s -n "" https://github.com/FirebirdSQL/firebird/releases/expanded_assets/"$firebird_tag" | grep -Eo "Firebird-.*.pkg" | head -n 1)
|
||||||
get -q -e "/tmp/firebird.pkg" https://github.com/FirebirdSQL/firebird/releases/download/"$firebird_tag"/"$pkg_name"
|
get -q -e "/tmp/firebird.pkg" https://github.com/FirebirdSQL/firebird/releases/download/"$firebird_tag"/"$pkg_name"
|
||||||
sudo installer -pkg /tmp/firebird.pkg -target /
|
sudo installer -pkg /tmp/firebird.pkg -target /
|
||||||
sudo mkdir -p /opt/firebird/include /opt/firebird/lib
|
sudo mkdir -p /opt/firebird/include /opt/firebird/lib
|
||||||
|
@ -1,24 +1,55 @@
|
|||||||
# Function to install phalcon
|
# Function to add phalcon using GitHub releases.
|
||||||
Function Add-PhalconHelper() {
|
Function Add-PhalconFromGitHub() {
|
||||||
if ($extension_version -eq '4') {
|
Param (
|
||||||
Install-Phpextension -Extension phalcon -MinimumStability stable -Path $php_dir
|
[Parameter(Position = 0, Mandatory = $true)]
|
||||||
} else {
|
[ValidateNotNull()]
|
||||||
$domain = 'https://github.com'
|
[string]
|
||||||
$nts = if (!$installed.ThreadSafe) { "_nts" } else { "" }
|
$Semver
|
||||||
$match = Invoke-WebRequest -Uri "$domain/phalcon/cphalcon/releases/v3.4.5" | Select-String -Pattern "href=`"(.*phalcon_x64_.*_php${version}_${extension_version}.*[0-9]${nts}.zip)`""
|
)
|
||||||
$zip_file = $match.Matches[0].Groups[1].Value
|
$domain = 'https://api.github.com/repos'
|
||||||
Invoke-WebRequest -Uri $domain/$zip_file -OutFile $ENV:RUNNER_TOOL_CACHE\phalcon.zip > $null 2>&1
|
$nts = if (!$installed.ThreadSafe) { "_nts" } else { "" }
|
||||||
|
$match = $match = (Invoke-RestMethod -Uri "$domain/phalcon/cphalcon/releases/tags/v$Semver").assets | Select-String -Pattern "browser_download_url=(.*phalcon_${arch}_.*_php${version}_${extension_version}.*[0-9]${nts}.zip)"
|
||||||
|
if($NULL -eq $match) {
|
||||||
|
$nts = if (!$installed.ThreadSafe) { "-nts" } else { "-ts" }
|
||||||
|
$match = (Invoke-RestMethod -Uri "$domain/phalcon/cphalcon/releases/tags/v$Semver").assets | Select-String -Pattern "browser_download_url=(.*phalcon-php${version}${nts}-windows.*-x64.zip)"
|
||||||
|
}
|
||||||
|
if($NULL -ne $match) {
|
||||||
|
$zip_url = $match.Matches[0].Groups[1].Value
|
||||||
|
Invoke-WebRequest -Uri $zip_url -OutFile $ENV:RUNNER_TOOL_CACHE\phalcon.zip > $null 2>&1
|
||||||
Expand-Archive -Path $ENV:RUNNER_TOOL_CACHE\phalcon.zip -DestinationPath $ENV:RUNNER_TOOL_CACHE\phalcon -Force > $null 2>&1
|
Expand-Archive -Path $ENV:RUNNER_TOOL_CACHE\phalcon.zip -DestinationPath $ENV:RUNNER_TOOL_CACHE\phalcon -Force > $null 2>&1
|
||||||
Copy-Item -Path "$ENV:RUNNER_TOOL_CACHE\phalcon\php_phalcon.dll" -Destination "$ext_dir\php_phalcon.dll"
|
Copy-Item -Path "$ENV:RUNNER_TOOL_CACHE\phalcon\php_phalcon.dll" -Destination "$ext_dir\php_phalcon.dll"
|
||||||
Enable-PhpExtension -Extension phalcon -Path $php_dir
|
Enable-PhpExtension -Extension phalcon -Path $php_dir
|
||||||
|
} else {
|
||||||
|
throw "Unable to get Phalcon release from the GitHub release"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
# Function to get phalcon semver.
|
||||||
|
Function Get-PhalconSemver() {
|
||||||
|
if($extension_version -eq '3') {
|
||||||
|
return '3.4.5'
|
||||||
|
} elseif (($extension_version -eq '4') -and ($version -eq '7.2')) {
|
||||||
|
return '4.1.0'
|
||||||
|
}
|
||||||
|
return Get-PeclPackageVersion phalcon $extension_version stable stable | Select-Object -First 1
|
||||||
|
}
|
||||||
|
|
||||||
|
# Function to install phalcon
|
||||||
|
Function Add-PhalconHelper() {
|
||||||
|
$semver = Get-PhalconSemver
|
||||||
|
if (($extension_version -eq '3') -or ($extension_version -eq '5')) {
|
||||||
|
Add-PhalconFromGitHub $semver
|
||||||
|
} elseif ($extension_version -eq '4') {
|
||||||
|
Add-Extension -Extension phalcon -Stability stable -Extension_version $semver
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
# Function to add phalcon
|
||||||
Function Add-Phalcon() {
|
Function Add-Phalcon() {
|
||||||
Param (
|
Param (
|
||||||
[Parameter(Position = 0, Mandatory = $true)]
|
[Parameter(Position = 0, Mandatory = $true)]
|
||||||
[ValidateNotNull()]
|
[ValidateNotNull()]
|
||||||
[ValidateSet('phalcon3', 'phalcon4')]
|
[ValidateSet('phalcon3', 'phalcon4', 'phalcon5')]
|
||||||
[string]
|
[string]
|
||||||
$extension
|
$extension
|
||||||
)
|
)
|
||||||
|
@ -1,13 +1,38 @@
|
|||||||
|
# Helper function to get phalcon version
|
||||||
|
get_phalcon_version() {
|
||||||
|
if [ "$extension" = "phalcon5" ]; then
|
||||||
|
get_pecl_version phalcon stable 5
|
||||||
|
elif [ "$extension" = "phalcon4" ]; then
|
||||||
|
echo '4.1.2'
|
||||||
|
elif [ "$extension" = "phalcon3" ]; then
|
||||||
|
echo '3.4.5'
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
|
||||||
|
# Function to add phalcon from repo.
|
||||||
|
add_phalcon_from_repo(){
|
||||||
|
version=${version:?}
|
||||||
|
if [ "$extension" = "phalcon5" ]; then
|
||||||
|
PHALCON_PATH=build/phalcon
|
||||||
|
else
|
||||||
|
PHALCON_PATH=build/php"${version%.*}"/64bits
|
||||||
|
fi
|
||||||
|
PHALCON_CONFIGURE_OPTS="--enable-phalcon --with-php-config=$(command -v php-config)"
|
||||||
|
export PHALCON_PATH
|
||||||
|
export PHALCON_CONFIGURE_OPTS
|
||||||
|
add_extension_from_source phalcon https://github.com phalcon cphalcon v"$(get_phalcon_version)" extension
|
||||||
|
}
|
||||||
|
|
||||||
# Helper function to add phalcon.
|
# Helper function to add phalcon.
|
||||||
add_phalcon_helper() {
|
add_phalcon_helper() {
|
||||||
status='Installed and enabled'
|
status='Installed and enabled'
|
||||||
if [ "$(uname -s)" = "Darwin" ]; then
|
if [ "$(uname -s)" = "Darwin" ]; then
|
||||||
add_brew_extension "$extension" extension
|
add_brew_extension "$extension" extension
|
||||||
else
|
else
|
||||||
packages=("php${version:?}-$extension")
|
package="php${version:?}-$extension"
|
||||||
[ "$extension" = "phalcon4" ] && packages+=("php${version:?}-psr")
|
|
||||||
add_ppa ondrej/php >/dev/null 2>&1 || update_ppa ondrej/php
|
add_ppa ondrej/php >/dev/null 2>&1 || update_ppa ondrej/php
|
||||||
check_package "${packages[0]}" && install_packages "${packages[@]}"
|
[ "$extension" = "phalcon4" ] && (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
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -44,15 +69,27 @@ add_phalcon4() {
|
|||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
|
# Function to add phalcon3.
|
||||||
|
add_phalcon5() {
|
||||||
|
if shared_extension phalcon; then
|
||||||
|
phalcon_version=$(php -d="extension=phalcon.so" -r "echo phpversion('phalcon');" | cut -d'.' -f 1)
|
||||||
|
if [ "$phalcon_version" != "$extension_major_version" ]; then
|
||||||
|
add_phalcon_helper
|
||||||
|
else
|
||||||
|
enable_extension phalcon extension
|
||||||
|
fi
|
||||||
|
else
|
||||||
|
add_phalcon_helper
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
|
||||||
# Function to add phalcon.
|
# Function to add phalcon.
|
||||||
add_phalcon() {
|
add_phalcon() {
|
||||||
extension=$1
|
local extension=$1
|
||||||
status='Enabled'
|
status='Enabled'
|
||||||
extension_major_version=${extension: -1}
|
extension_major_version=${extension: -1}
|
||||||
if [ "$extension_major_version" = "4" ]; then
|
if [[ "$extension_major_version" =~ [3-5] ]]; then
|
||||||
add_phalcon4 >/dev/null 2>&1
|
add_phalcon"$extension_major_version" >/dev/null 2>&1
|
||||||
elif [ "$extension_major_version" = "3" ]; then
|
|
||||||
add_phalcon3 >/dev/null 2>&1
|
|
||||||
fi
|
fi
|
||||||
add_extension_log "phalcon" "$status"
|
add_extension_log "phalcon" "$status"
|
||||||
}
|
}
|
||||||
|
@ -146,6 +146,7 @@ add_extension_from_source() {
|
|||||||
add_log "${cross:?}" "$source" "$source does not have a PHP extension"
|
add_log "${cross:?}" "$source" "$source does not have a PHP extension"
|
||||||
else
|
else
|
||||||
[[ -n "${libraries// }" ]] && run_group "add_libs $libraries" "add libraries"
|
[[ -n "${libraries// }" ]] && run_group "add_libs $libraries" "add libraries"
|
||||||
|
[ "${debug:?}" = "debug" ] && suffix_opts="$suffix_opts --enable-debug"
|
||||||
patch_extension "$extension" >/dev/null 2>&1
|
patch_extension "$extension" >/dev/null 2>&1
|
||||||
run_group "phpize" "phpize"
|
run_group "phpize" "phpize"
|
||||||
run_group "sudo $prefix_opts ./configure $suffix_opts $opts" "configure"
|
run_group "sudo $prefix_opts ./configure $suffix_opts $opts" "configure"
|
||||||
|
@ -3,7 +3,15 @@ get_sqlsrv_version() {
|
|||||||
if [[ "${version:?}" =~ 7.[0-3] ]]; then
|
if [[ "${version:?}" =~ 7.[0-3] ]]; then
|
||||||
echo '5.9.0'
|
echo '5.9.0'
|
||||||
else
|
else
|
||||||
echo '5.10.0'
|
echo '5.10.1'
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
|
||||||
|
add_unixodbc() {
|
||||||
|
if [ "$(uname -s)" = 'Linux' ]; then
|
||||||
|
install_packages unixodbc-dev
|
||||||
|
else
|
||||||
|
brew install unixodbc
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -11,5 +19,6 @@ get_sqlsrv_version() {
|
|||||||
add_sqlsrv() {
|
add_sqlsrv() {
|
||||||
ext=$1
|
ext=$1
|
||||||
ext_version=$(get_sqlsrv_version)
|
ext_version=$(get_sqlsrv_version)
|
||||||
|
add_unixodbc >/dev/null 2>&1
|
||||||
add_pecl_extension "$ext" "$ext_version" extension
|
add_pecl_extension "$ext" "$ext_version" extension
|
||||||
}
|
}
|
||||||
|
@ -75,9 +75,10 @@ check_package() {
|
|||||||
# Helper function to add an extension.
|
# Helper function to add an extension.
|
||||||
add_extension_helper() {
|
add_extension_helper() {
|
||||||
local extension=$1
|
local extension=$1
|
||||||
package=php"$version"-"$extension"
|
packages=(php"$version"-"$extension")
|
||||||
add_ppa ondrej/php >/dev/null 2>&1 || update_ppa ondrej/php
|
add_ppa ondrej/php >/dev/null 2>&1 || update_ppa ondrej/php
|
||||||
(check_package "$package" && install_packages "$package") || pecl_install "$extension"
|
[ "${debug:?}" = "debug" ] && check_package php"$version"-"$extension"-dbgsym && packages+=(php"$version"-"$extension"-dbgsym)
|
||||||
|
(check_package "${packages[0]}" && install_packages "${packages[@]}") || pecl_install "$extension"
|
||||||
add_extension_log "$extension" "Installed and enabled"
|
add_extension_log "$extension" "Installed and enabled"
|
||||||
sudo chmod 777 "${ini_file[@]}"
|
sudo chmod 777 "${ini_file[@]}"
|
||||||
}
|
}
|
||||||
@ -88,14 +89,14 @@ add_devtools() {
|
|||||||
if ! command -v "$tool$version" >/dev/null; then
|
if ! command -v "$tool$version" >/dev/null; then
|
||||||
install_packages "php$version-dev"
|
install_packages "php$version-dev"
|
||||||
fi
|
fi
|
||||||
add_extension xml extension >/dev/null 2>&1
|
|
||||||
switch_version "phpize" "php-config"
|
switch_version "phpize" "php-config"
|
||||||
|
add_extension xml extension >/dev/null 2>&1
|
||||||
add_log "${tick:?}" "$tool" "Added $tool $semver"
|
add_log "${tick:?}" "$tool" "Added $tool $semver"
|
||||||
}
|
}
|
||||||
|
|
||||||
# Function to setup the nightly build from shivammathur/php-builder
|
# Function to setup the nightly build from shivammathur/php-builder
|
||||||
setup_nightly() {
|
setup_nightly() {
|
||||||
run_script "php-builder" "${runner:?}" "$version"
|
run_script "php-builder" "${runner:?}" "$version" "${debug:?}" ${ts:?}
|
||||||
}
|
}
|
||||||
|
|
||||||
# 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.
|
||||||
@ -133,15 +134,22 @@ switch_version() {
|
|||||||
wait "${to_wait[@]}"
|
wait "${to_wait[@]}"
|
||||||
}
|
}
|
||||||
|
|
||||||
|
# Function to get packages to install
|
||||||
|
get_php_packages() {
|
||||||
|
sed "s/[^ ]*/php$version-&/g" "$src"/configs/php_packages | tr '\n' ' '
|
||||||
|
if [ "${debug:?}" = "debug" ]; then
|
||||||
|
sed "s/[^ ]*/php$version-&-dbgsym/g" "$src"/configs/php_debug_packages | tr '\n' ' '
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
|
||||||
# Function to install packaged PHP
|
# Function to install packaged PHP
|
||||||
add_packaged_php() {
|
add_packaged_php() {
|
||||||
if [ "$runner" = "self-hosted" ] || [ "${use_package_cache:-true}" = "false" ]; then
|
if [ "$runner" = "self-hosted" ] || [ "${use_package_cache:-true}" = "false" ]; then
|
||||||
add_ppa ondrej/php >/dev/null 2>&1 || update_ppa ondrej/php
|
add_ppa ondrej/php >/dev/null 2>&1 || update_ppa ondrej/php
|
||||||
IFS=' ' read -r -a packages <<<"$(sed "s/[^ ]*/php$version-&/g" "$src"/configs/php_packages | tr '\n' ' ')"
|
IFS=' ' read -r -a packages <<<"$(get_php_packages)"
|
||||||
install_packages "${packages[@]}"
|
install_packages "${packages[@]}"
|
||||||
add_pecl
|
|
||||||
else
|
else
|
||||||
run_script "php-ubuntu" "$version"
|
run_script "php-ubuntu" "$version" "${debug:?}"
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -159,13 +167,14 @@ update_php() {
|
|||||||
|
|
||||||
# Function to install PHP.
|
# Function to install PHP.
|
||||||
add_php() {
|
add_php() {
|
||||||
if [[ "$version" =~ ${nightly_versions:?} ]]; then
|
if [[ "$version" =~ ${nightly_versions:?} ]] || [[ "${ts:?}" = "zts" ]]; then
|
||||||
setup_nightly
|
setup_nightly
|
||||||
elif [[ "$version" =~ ${old_versions:?} ]]; then
|
elif [[ "$version" =~ ${old_versions:?} ]]; then
|
||||||
setup_old_versions
|
setup_old_versions
|
||||||
else
|
else
|
||||||
add_packaged_php
|
add_packaged_php
|
||||||
switch_version >/dev/null 2>&1
|
switch_version >/dev/null 2>&1
|
||||||
|
add_pecl
|
||||||
fi
|
fi
|
||||||
status="Installed"
|
status="Installed"
|
||||||
}
|
}
|
||||||
|
@ -1,7 +1,8 @@
|
|||||||
# Variables
|
# Variables
|
||||||
$composer_bin = "$env:APPDATA\Composer\vendor\bin"
|
$composer_home = "$env:APPDATA\Composer"
|
||||||
$composer_json = "$env:APPDATA\Composer\composer.json"
|
$composer_bin = "$composer_home\vendor\bin"
|
||||||
$composer_lock = "$env:APPDATA\Composer\composer.lock"
|
$composer_json = "$composer_home\composer.json"
|
||||||
|
$composer_lock = "$composer_home\composer.lock"
|
||||||
|
|
||||||
# Function to configure composer.
|
# Function to configure composer.
|
||||||
Function Edit-ComposerConfig() {
|
Function Edit-ComposerConfig() {
|
||||||
@ -24,8 +25,30 @@ Function Edit-ComposerConfig() {
|
|||||||
}
|
}
|
||||||
Add-EnvPATH $src\configs\composer.env
|
Add-EnvPATH $src\configs\composer.env
|
||||||
Add-Path $composer_bin
|
Add-Path $composer_bin
|
||||||
if (Test-Path env:COMPOSER_TOKEN) {
|
Set-ComposerAuth
|
||||||
Add-Env COMPOSER_AUTH ('{"github-oauth": {"github.com": "' + $env:COMPOSER_TOKEN + '"}}')
|
}
|
||||||
|
|
||||||
|
# Function to setup authentication in composer.
|
||||||
|
Function Set-ComposerAuth() {
|
||||||
|
if(Test-Path env:COMPOSER_AUTH_JSON) {
|
||||||
|
if(Test-Json -JSON $env:COMPOSER_AUTH_JSON) {
|
||||||
|
Set-Content -Path $composer_home\auth.json -Value $env:COMPOSER_AUTH_JSON
|
||||||
|
} else {
|
||||||
|
Add-Log "$cross" "composer" "Could not parse COMPOSER_AUTH_JSON as valid JSON"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
$composer_auth = @()
|
||||||
|
if(Test-Path env:PACKAGIST_TOKEN) {
|
||||||
|
$composer_auth += '"http-basic": {"repo.packagist.com": { "username": "token", "password": "' + $env:PACKAGIST_TOKEN + '"}}'
|
||||||
|
}
|
||||||
|
if(-not(Test-Path env:GITHUB_TOKEN) -and (Test-Path env:COMPOSER_TOKEN)) {
|
||||||
|
$env:GITHUB_TOKEN = $env:COMPOSER_TOKEN
|
||||||
|
}
|
||||||
|
if (Test-Path env:GITHUB_TOKEN) {
|
||||||
|
$composer_auth += '"github-oauth": {"github.com": "' + $env:GITHUB_TOKEN + '"}'
|
||||||
|
}
|
||||||
|
if($composer_auth.length) {
|
||||||
|
Add-Env COMPOSER_AUTH ('{' + ($composer_auth -join ',') + '}')
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -37,7 +60,7 @@ Function Get-ToolVersion() {
|
|||||||
[Parameter(Position = 1, Mandatory = $true)]
|
[Parameter(Position = 1, Mandatory = $true)]
|
||||||
$param
|
$param
|
||||||
)
|
)
|
||||||
$alp = "[a-zA-Z0-9]"
|
$alp = "[a-zA-Z0-9\.]"
|
||||||
$version_regex = "[0-9]+((\.{1}$alp+)+)(\.{0})(-$alp+){0,1}"
|
$version_regex = "[0-9]+((\.{1}$alp+)+)(\.{0})(-$alp+){0,1}"
|
||||||
if($tool -eq 'composer') {
|
if($tool -eq 'composer') {
|
||||||
$composer_branch_alias = Select-String -Pattern "const\sBRANCH_ALIAS_VERSION" -Path $bin_dir\composer -Raw | Select-String -Pattern $version_regex | ForEach-Object { $_.matches.Value }
|
$composer_branch_alias = Select-String -Pattern "const\sBRANCH_ALIAS_VERSION" -Path $bin_dir\composer -Raw | Select-String -Pattern $version_regex | ForEach-Object { $_.matches.Value }
|
||||||
@ -67,6 +90,13 @@ Function Add-ToolsHelper() {
|
|||||||
Edit-ComposerConfig $bin_dir\$tool
|
Edit-ComposerConfig $bin_dir\$tool
|
||||||
} elseif($tool -eq "cs2pr") {
|
} elseif($tool -eq "cs2pr") {
|
||||||
(Get-Content $bin_dir/cs2pr).replace('exit(9)', 'exit(0)') | Set-Content $bin_dir/cs2pr
|
(Get-Content $bin_dir/cs2pr).replace('exit(9)', 'exit(0)') | Set-Content $bin_dir/cs2pr
|
||||||
|
} elseif($tool -eq "deployer") {
|
||||||
|
if(Test-Path $composer_bin\deployer.phar.bat) {
|
||||||
|
Copy-Item $composer_bin\deployer.phar.bat -Destination $composer_bin\dep.bat
|
||||||
|
}
|
||||||
|
if(Test-Path $composer_bin\dep.bat) {
|
||||||
|
Copy-Item $composer_bin\dep.bat -Destination $composer_bin\deployer.bat
|
||||||
|
}
|
||||||
} elseif($tool -eq "phan") {
|
} elseif($tool -eq "phan") {
|
||||||
$extensions += @('fileinfo', 'ast')
|
$extensions += @('fileinfo', 'ast')
|
||||||
} elseif($tool -eq "phinx") {
|
} elseif($tool -eq "phinx") {
|
||||||
@ -171,10 +201,17 @@ Function Add-ComposertoolHelper() {
|
|||||||
[string]
|
[string]
|
||||||
$composer_args
|
$composer_args
|
||||||
)
|
)
|
||||||
|
$tool_version = $release.split(':')[1]
|
||||||
|
if($NULL -eq $tool_version) {
|
||||||
|
$tool_version = '*'
|
||||||
|
}
|
||||||
if($scope -eq 'global') {
|
if($scope -eq 'global') {
|
||||||
if(Test-Path $composer_lock) {
|
if(Test-Path $composer_lock) {
|
||||||
Remove-Item -Path $composer_lock -Force
|
Remove-Item -Path $composer_lock -Force
|
||||||
}
|
}
|
||||||
|
if((composer global show $prefix$tool $tool_version -a 2>&1 | findstr '^type *: *composer-plugin') -and ($composer_args -ne '')) {
|
||||||
|
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
|
||||||
return composer global show $prefix$tool 2>&1 | findstr '^versions'
|
return composer global show $prefix$tool 2>&1 | findstr '^versions'
|
||||||
} else {
|
} else {
|
||||||
@ -184,6 +221,10 @@ Function Add-ComposertoolHelper() {
|
|||||||
$unix_scoped_dir = $scoped_dir.replace('\', '/')
|
$unix_scoped_dir = $scoped_dir.replace('\', '/')
|
||||||
if(-not(Test-Path $scoped_dir)) {
|
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 "{}"
|
||||||
|
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 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
|
||||||
}
|
}
|
||||||
[System.Environment]::SetEnvironmentVariable(($tool.replace('-', '_') + '_bin'), "$scoped_dir\vendor\bin")
|
[System.Environment]::SetEnvironmentVariable(($tool.replace('-', '_') + '_bin'), "$scoped_dir\vendor\bin")
|
||||||
@ -216,6 +257,7 @@ Function Add-Composertool() {
|
|||||||
[string]
|
[string]
|
||||||
$scope
|
$scope
|
||||||
)
|
)
|
||||||
|
$composer_args = ""
|
||||||
if($composer_version.split('.')[0] -ne "1") {
|
if($composer_version.split('.')[0] -ne "1") {
|
||||||
$composer_args = "--ignore-platform-req=ext-*"
|
$composer_args = "--ignore-platform-req=ext-*"
|
||||||
if($tool -match "prestissimo|composer-prefetcher") {
|
if($tool -match "prestissimo|composer-prefetcher") {
|
||||||
|
@ -9,7 +9,7 @@ export composer_lock="$composer_home/composer.lock"
|
|||||||
get_tool_version() {
|
get_tool_version() {
|
||||||
tool=$1
|
tool=$1
|
||||||
param=$2
|
param=$2
|
||||||
alp="[a-zA-Z0-9]"
|
alp="[a-zA-Z0-9\.]"
|
||||||
version_regex="[0-9]+((\.{1}$alp+)+)(\.{0})(-$alp+){0,1}"
|
version_regex="[0-9]+((\.{1}$alp+)+)(\.{0})(-$alp+){0,1}"
|
||||||
if [ "$tool" = "composer" ]; then
|
if [ "$tool" = "composer" ]; then
|
||||||
composer_alias_version="$(grep -Ea "const\sBRANCH_ALIAS_VERSION" "$tool_path_dir/composer" | grep -Eo "$version_regex")"
|
composer_alias_version="$(grep -Ea "const\sBRANCH_ALIAS_VERSION" "$tool_path_dir/composer" | grep -Eo "$version_regex")"
|
||||||
@ -44,8 +44,27 @@ configure_composer() {
|
|||||||
fi
|
fi
|
||||||
add_env_path "${src:?}"/configs/composer.env
|
add_env_path "${src:?}"/configs/composer.env
|
||||||
add_path "$composer_bin"
|
add_path "$composer_bin"
|
||||||
if [ -n "$COMPOSER_TOKEN" ]; then
|
set_composer_auth
|
||||||
add_env COMPOSER_AUTH '{"github-oauth": {"github.com": "'"$COMPOSER_TOKEN"'"}}'
|
}
|
||||||
|
|
||||||
|
# Function to setup authentication in composer.
|
||||||
|
set_composer_auth() {
|
||||||
|
if [ -n "$COMPOSER_AUTH_JSON" ]; then
|
||||||
|
if php -r "json_decode('$COMPOSER_AUTH_JSON'); if(json_last_error() !== JSON_ERROR_NONE) { throw new Exception('invalid json'); }"; then
|
||||||
|
echo "$COMPOSER_AUTH_JSON" | tee "$composer_home/auth.json" >/dev/null
|
||||||
|
else
|
||||||
|
add_log "${cross:?}" "composer" "Could not parse COMPOSER_AUTH_JSON as valid JSON"
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
composer_auth=()
|
||||||
|
if [ -n "$PACKAGIST_TOKEN" ]; then
|
||||||
|
composer_auth+=( '"http-basic": {"repo.packagist.com": { "username": "token", "password": "'"$PACKAGIST_TOKEN"'"}}' )
|
||||||
|
fi
|
||||||
|
if [ -n "${GITHUB_TOKEN:-$COMPOSER_TOKEN}" ]; then
|
||||||
|
composer_auth+=( '"github-oauth": {"github.com": "'"${GITHUB_TOKEN:-$COMPOSER_TOKEN}"'"}' )
|
||||||
|
fi
|
||||||
|
if ((${#composer_auth[@]})); then
|
||||||
|
add_env COMPOSER_AUTH "{$(IFS=$','; echo "${composer_auth[*]}")}"
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -61,6 +80,13 @@ add_tools_helper() {
|
|||||||
elif [ "$tool" = "cs2pr" ]; then
|
elif [ "$tool" = "cs2pr" ]; then
|
||||||
sudo sed -i 's/\r$//; s/exit(9)/exit(0)/' "$tool_path" 2>/dev/null ||
|
sudo sed -i 's/\r$//; s/exit(9)/exit(0)/' "$tool_path" 2>/dev/null ||
|
||||||
sudo sed -i '' 's/\r$//; s/exit(9)/exit(0)/' "$tool_path"
|
sudo sed -i '' 's/\r$//; s/exit(9)/exit(0)/' "$tool_path"
|
||||||
|
elif [ "$tool" = "deployer" ]; then
|
||||||
|
if [ -e "$composer_bin"/deployer.phar ]; then
|
||||||
|
sudo ln -s "$composer_bin"/deployer.phar "$composer_bin"/dep
|
||||||
|
fi
|
||||||
|
if [ -e "$composer_bin"/dep ]; then
|
||||||
|
sudo ln -s "$composer_bin"/dep "$composer_bin"/deployer
|
||||||
|
fi
|
||||||
elif [ "$tool" = "phan" ]; then
|
elif [ "$tool" = "phan" ]; then
|
||||||
extensions+=(fileinfo ast)
|
extensions+=(fileinfo ast)
|
||||||
elif [ "$tool" = "phinx" ]; then
|
elif [ "$tool" = "phinx" ]; then
|
||||||
@ -134,14 +160,22 @@ add_composertool_helper() {
|
|||||||
scope=$4
|
scope=$4
|
||||||
composer_args=$5
|
composer_args=$5
|
||||||
enable_extensions curl mbstring openssl
|
enable_extensions curl mbstring openssl
|
||||||
|
tool_version=${release##*:}; [ "$tool_version" = "$tool" ] && tool_version="*"
|
||||||
if [ "$scope" = "global" ]; then
|
if [ "$scope" = "global" ]; then
|
||||||
sudo rm -f "$composer_lock" >/dev/null 2>&1 || true
|
sudo rm -f "$composer_lock" >/dev/null 2>&1 || true
|
||||||
|
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
|
||||||
|
fi
|
||||||
composer global require "$prefix$release" "$composer_args" >/dev/null 2>&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 ! [ -d "$scoped_dir" ]; then
|
if ! [ -d "$scoped_dir" ]; then
|
||||||
mkdir -p "$scoped_dir"
|
mkdir -p "$scoped_dir"
|
||||||
|
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
|
||||||
|
composer config -d "$scoped_dir" --no-plugins allow-plugins."$prefix$tool" true >/dev/null 2>&1
|
||||||
|
fi
|
||||||
composer require "$prefix$release" -d "$scoped_dir" "$composer_args" >/dev/null 2>&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
|
composer show "$prefix$tool" -d "$scoped_dir" 2>&1 | grep -E ^versions | sudo tee /tmp/composer.log >/dev/null 2>&1
|
||||||
fi
|
fi
|
||||||
@ -155,6 +189,7 @@ add_composertool() {
|
|||||||
release=$2
|
release=$2
|
||||||
prefix=$3
|
prefix=$3
|
||||||
scope=$4
|
scope=$4
|
||||||
|
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
|
||||||
composer_args="--ignore-platform-req=ext-*"
|
composer_args="--ignore-platform-req=ext-*"
|
||||||
|
83
src/scripts/tools/brew.sh
Normal file
83
src/scripts/tools/brew.sh
Normal file
@ -0,0 +1,83 @@
|
|||||||
|
# Function to fetch a brew tap.
|
||||||
|
fetch_brew_tap() {
|
||||||
|
tap=$1
|
||||||
|
tap_user=$(dirname "$tap")
|
||||||
|
tap_name=$(basename "$tap")
|
||||||
|
mkdir -p "$tap_dir/$tap_user"
|
||||||
|
branch="$(get -s -n "" "https://api.github.com/repos/$tap" | grep default_branch | cut -d: -f 2 | grep -Eo '[^\", ]+' | tr -d '\n')"
|
||||||
|
get -s -n "" "https://github.com/$tap/archive/$branch.tar.gz" | sudo tar -xzf - -C "$tap_dir/$tap_user"
|
||||||
|
sudo mv "$tap_dir/$tap_user/$tap_name-$branch" "$tap_dir/$tap_user/$tap_name"
|
||||||
|
}
|
||||||
|
|
||||||
|
# Function to add a brew tap.
|
||||||
|
add_brew_tap() {
|
||||||
|
tap=$1
|
||||||
|
if ! [ -d "$tap_dir/$tap" ]; then
|
||||||
|
if [ "${runner:?}" = "self-hosted" ]; then
|
||||||
|
brew tap "$tap" >/dev/null 2>&1
|
||||||
|
else
|
||||||
|
fetch_brew_tap "$tap" >/dev/null 2>&1
|
||||||
|
if ! [ -d "$tap_dir/$tap" ]; then
|
||||||
|
brew tap "$tap" >/dev/null 2>&1
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
|
||||||
|
# Function to get brew prefix.
|
||||||
|
get_brew_prefix() {
|
||||||
|
if [ "$(uname -s)" = "Linux" ]; then
|
||||||
|
echo /home/linuxbrew/.linuxbrew
|
||||||
|
else
|
||||||
|
if [ "$(uname -m)" = "arm64" ]; then
|
||||||
|
echo /opt/homebrew
|
||||||
|
else
|
||||||
|
echo /usr/local
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
|
||||||
|
# Function to add brew's bin directories to the PATH.
|
||||||
|
add_brew_bins_to_path() {
|
||||||
|
local brew_prefix=${1:-$(get_brew_prefix)}
|
||||||
|
add_path "$brew_prefix"/bin
|
||||||
|
add_path "$brew_prefix"/sbin
|
||||||
|
}
|
||||||
|
|
||||||
|
# Function to add brew.
|
||||||
|
add_brew() {
|
||||||
|
brew_prefix="$(get_brew_prefix)"
|
||||||
|
if ! [ -d "$brew_prefix"/bin ]; then
|
||||||
|
step_log "Setup Brew"
|
||||||
|
get -s "" "/tmp/install.sh" "https://raw.githubusercontent.com/Homebrew/install/master/install.sh" | bash -s >/dev/null 2>&1
|
||||||
|
add_log "${tick:?}" "Brew" "Installed Homebrew"
|
||||||
|
fi
|
||||||
|
add_brew_bins_to_path "$brew_prefix"
|
||||||
|
}
|
||||||
|
|
||||||
|
# Function to configure brew constants.
|
||||||
|
configure_brew() {
|
||||||
|
brew_path="$(command -v brew)"
|
||||||
|
if [ -z "$brew_path" ]; then
|
||||||
|
add_brew
|
||||||
|
brew_path="$(command -v brew)"
|
||||||
|
fi
|
||||||
|
brew_path_dir="$(dirname "$brew_path")"
|
||||||
|
brew_prefix="$brew_path_dir"/..
|
||||||
|
brew_repo="$brew_path_dir/$(dirname "$(readlink "$brew_path")")"/..
|
||||||
|
tap_dir="$brew_repo"/Library/Taps
|
||||||
|
core_repo="$tap_dir"/homebrew/homebrew-core
|
||||||
|
|
||||||
|
export HOMEBREW_CHANGE_ARCH_TO_ARM=1
|
||||||
|
export HOMEBREW_DEVELOPER=1
|
||||||
|
export HOMEBREW_NO_AUTO_UPDATE=1
|
||||||
|
export HOMEBREW_NO_ENV_HINTS=1
|
||||||
|
export HOMEBREW_NO_INSTALL_CLEANUP=1
|
||||||
|
export HOMEBREW_NO_INSTALLED_DEPENDENTS_CHECK=1
|
||||||
|
export brew_path
|
||||||
|
export brew_path_dir
|
||||||
|
export brew_prefix
|
||||||
|
export brew_repo
|
||||||
|
export tap_dir
|
||||||
|
export core_repo
|
||||||
|
}
|
@ -22,6 +22,8 @@ get_grpc_tag() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
add_grpc_php_plugin_brew() {
|
add_grpc_php_plugin_brew() {
|
||||||
|
. "${0%/*}"/tools/brew.sh
|
||||||
|
configure_brew
|
||||||
brew install grpc
|
brew install grpc
|
||||||
brew link --force --overwrite grpc >/dev/null 2>&1
|
brew link --force --overwrite grpc >/dev/null 2>&1
|
||||||
grpc_tag="v$(brew info grpc | grep "grpc:" | grep -Eo "[0-9]+\.[0-9]+\.[0-9]+")"
|
grpc_tag="v$(brew info grpc | grep "grpc:" | grep -Eo "[0-9]+\.[0-9]+\.[0-9]+")"
|
||||||
|
@ -140,6 +140,20 @@ add_list() {
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
# Function to check if a PPA exists
|
||||||
|
check_ppa() {
|
||||||
|
ppa=$1
|
||||||
|
ppa_url=${2:-"$lp_ppa/$ppa/ubuntu"}
|
||||||
|
package_dist=${3:-"$VERSION_CODENAME"}
|
||||||
|
branches=${4:-main}
|
||||||
|
ppa_search="deb .*$ppa_url $package_dist .*$branches"
|
||||||
|
if check_lists "$ppa" "$ppa_search"; then
|
||||||
|
return 0;
|
||||||
|
else
|
||||||
|
return 1;
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
|
||||||
# Function to remove a PPA.
|
# Function to remove a PPA.
|
||||||
remove_list() {
|
remove_list() {
|
||||||
ppa=${1-ondrej/php}
|
ppa=${1-ondrej/php}
|
||||||
@ -153,8 +167,10 @@ add_ppa() {
|
|||||||
set_base_version
|
set_base_version
|
||||||
ppa=${1:-ondrej/php}
|
ppa=${1:-ondrej/php}
|
||||||
if [[ "$ID" = "ubuntu" || "$ID_LIKE" =~ ubuntu ]] && [[ "$ppa" =~ "ondrej/" ]]; then
|
if [[ "$ID" = "ubuntu" || "$ID_LIKE" =~ ubuntu ]] && [[ "$ppa" =~ "ondrej/" ]]; then
|
||||||
|
[ "${debug:?}" = "debug" ] && add_list "$ppa" "$lp_ppa/$ppa/ubuntu" "$lp_ppa/$ppa/ubuntu" "$VERSION_CODENAME" "main/debug"
|
||||||
add_list "$ppa"
|
add_list "$ppa"
|
||||||
elif [[ "$ID" = "debian" || "$ID_LIKE" =~ debian ]] && [[ "$ppa" =~ "ondrej/" ]]; then
|
elif [[ "$ID" = "debian" || "$ID_LIKE" =~ debian ]] && [[ "$ppa" =~ "ondrej/" ]]; then
|
||||||
|
[ "${debug:?}" = "debug" ] && add_list "$ppa" "$sury"/"${ppa##*/}"/ "$sury"/"${ppa##*/}"/apt.gpg "$VERSION_CODENAME" "main/debug"
|
||||||
add_list "$ppa" "$sury"/"${ppa##*/}"/ "$sury"/"${ppa##*/}"/apt.gpg
|
add_list "$ppa" "$sury"/"${ppa##*/}"/ "$sury"/"${ppa##*/}"/apt.gpg
|
||||||
else
|
else
|
||||||
add_list "$ppa"
|
add_list "$ppa"
|
||||||
|
@ -1,12 +1,12 @@
|
|||||||
get_protobuf_tag() {
|
get_protobuf_tag() {
|
||||||
if [ "$protobuf_tag" = "latest" ]; then
|
if [ "$protobuf_tag" = "latest" ]; then
|
||||||
protobuf_tag=$(get -s -n "" https://github.com/protocolbuffers/protobuf/releases/latest 2<&1 | grep -m 1 -Eo "(v[0-9]+\.[0-9]+\.[0-9]+)" | head -n 1)
|
protobuf_tag=$(get -s -n "" https://github.com/protocolbuffers/protobuf/releases/latest 2<&1 | grep -m 1 -Eo "tag/(v[0-9]+(\.[0-9]+)?(\.[0-9]+)?)" | head -n 1 | cut -d '/' -f 2)
|
||||||
else
|
else
|
||||||
status_code=$(get -v -n /tmp/protobuf.tmp "https://github.com/protocolbuffers/protobuf/releases/tag/v$protobuf_tag")
|
status_code=$(get -v -n /tmp/protobuf.tmp "https://github.com/protocolbuffers/protobuf/releases/tag/v$protobuf_tag")
|
||||||
if [ "$status_code" = "200" ]; then
|
if [ "$status_code" = "200" ]; then
|
||||||
protobuf_tag="v$protobuf_tag"
|
protobuf_tag="v$protobuf_tag"
|
||||||
else
|
else
|
||||||
protobuf_tag=$(get -s -n "" https://github.com/protocolbuffers/protobuf/releases/latest 2<&1 | grep -m 1 -Eo "(v[0-9]+\.[0-9]+\.[0-9]+)" | head -n 1)
|
protobuf_tag=$(get -s -n "" https://github.com/protocolbuffers/protobuf/releases/latest 2<&1 | grep -m 1 -Eo "tag/(v[0-9]+(\.[0-9]+)?(\.[0-9]+)?)" | head -n 1 | cut -d '/' -f 2)
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
@ -1,12 +1,35 @@
|
|||||||
add_symfony() {
|
add_symfony_with_brew() {
|
||||||
|
add_brew_tap symfony-cli/homebrew-tap
|
||||||
|
brew install symfony-cli/tap/symfony-cli
|
||||||
|
}
|
||||||
|
|
||||||
|
get_symfony_artifact_url() {
|
||||||
|
arch=$(dpkg --print-architecture)
|
||||||
|
url=$(get -s -n "" https://raw.githubusercontent.com/symfony-cli/homebrew-tap/main/Formula/symfony-cli.rb 2<&1 | grep -m 1 "url.*linux.*${arch}" | cut -d\" -f 2)
|
||||||
|
if [ -z "$url" ]; then
|
||||||
|
url=$(get -s -n "" https://api.github.com/repos/symfony-cli/symfony-cli/releases 2<&1 | grep -m 1 "url.*linux.*${arch}.*gz\"" | cut -d\" -f 4)
|
||||||
|
fi
|
||||||
|
echo "$url"
|
||||||
|
}
|
||||||
|
|
||||||
|
add_symfony_helper() {
|
||||||
if [ "$(uname -s)" = "Linux" ]; then
|
if [ "$(uname -s)" = "Linux" ]; then
|
||||||
echo 'deb [trusted=yes] https://repo.symfony.com/apt/ /' | sudo tee /etc/apt/sources.list.d/symfony-cli.list >/dev/null 2>&1
|
url="$(get_symfony_artifact_url)"
|
||||||
update_lists symfony repo.symfony.com
|
if [ -z "$url" ]; then
|
||||||
install_packages symfony-cli
|
. "${0%/*}"/tools/brew.sh
|
||||||
|
configure_brew
|
||||||
|
add_symfony_with_brew
|
||||||
|
else
|
||||||
|
get -s -n "" "$url" | sudo tar -xz -C "${tool_path_dir:?}" 2>/dev/null
|
||||||
|
sudo chmod a+x /usr/local/bin/symfony
|
||||||
|
fi
|
||||||
elif [ "$(uname -s)" = "Darwin" ]; then
|
elif [ "$(uname -s)" = "Darwin" ]; then
|
||||||
add_brew_tap symfony-cli/homebrew-tap
|
add_symfony_with_brew
|
||||||
brew install symfony-cli/tap/symfony-cli >/dev/null 2>&1
|
|
||||||
fi
|
fi
|
||||||
|
}
|
||||||
|
|
||||||
|
add_symfony() {
|
||||||
|
add_symfony_helper >/dev/null 2>&1
|
||||||
symfony_path="$(command -v symfony)"
|
symfony_path="$(command -v symfony)"
|
||||||
if [[ -n "$symfony_path" ]]; then
|
if [[ -n "$symfony_path" ]]; then
|
||||||
sudo ln -s "$symfony_path" "${tool_path_dir:?}"/symfony-cli
|
sudo ln -s "$symfony_path" "${tool_path_dir:?}"/symfony-cli
|
||||||
|
@ -43,13 +43,15 @@ set_output() {
|
|||||||
name=$1
|
name=$1
|
||||||
value=$2
|
value=$2
|
||||||
if [ "${GITHUB_ACTIONS}" = "true" ]; then
|
if [ "${GITHUB_ACTIONS}" = "true" ]; then
|
||||||
echo "::set-output name=${name}::${value}"
|
echo "${name}=${value}" | tee -a "$GITHUB_OUTPUT" >/dev/null 2>&1
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
# Function to read env inputs.
|
# Function to read env inputs.
|
||||||
read_env() {
|
read_env() {
|
||||||
update="${update:-${UPDATE:-false}}"
|
update="${update:-${UPDATE:-false}}"
|
||||||
|
[ "${debug:-${DEBUG:-false}}" = "true" ] && debug=debug && update=true || debug=release
|
||||||
|
[ "${phpts:-${PHPTS:-nts}}" = "ts" ] && ts=zts && update=true || ts=nts
|
||||||
fail_fast="${fail_fast:-${FAIL_FAST:-false}}"
|
fail_fast="${fail_fast:-${FAIL_FAST:-false}}"
|
||||||
[[ -z "${ImageOS}" && -z "${ImageVersion}" ]] && _runner=self-hosted || _runner=github
|
[[ -z "${ImageOS}" && -z "${ImageVersion}" ]] && _runner=self-hosted || _runner=github
|
||||||
runner="${runner:-${RUNNER:-$_runner}}"
|
runner="${runner:-${RUNNER:-$_runner}}"
|
||||||
@ -58,6 +60,16 @@ read_env() {
|
|||||||
fail_fast=true
|
fail_fast=true
|
||||||
add_log "$cross" "Runner" "Runner set as github in self-hosted environment"
|
add_log "$cross" "Runner" "Runner set as github in self-hosted environment"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
# Set Update to true if the ubuntu github image does not have PHP PPA.
|
||||||
|
if [[ "$runner" = "github" && "${ImageOS}" =~ ubuntu.* ]]; then
|
||||||
|
check_ppa ondrej/php || update=true
|
||||||
|
fi
|
||||||
|
|
||||||
|
export fail_fast
|
||||||
|
export runner
|
||||||
|
export update
|
||||||
|
export ts
|
||||||
}
|
}
|
||||||
|
|
||||||
# Function to download a file using cURL.
|
# Function to download a file using cURL.
|
||||||
@ -151,6 +163,7 @@ self_hosted_setup() {
|
|||||||
exit 1
|
exit 1
|
||||||
else
|
else
|
||||||
self_hosted_helper >/dev/null 2>&1
|
self_hosted_helper >/dev/null 2>&1
|
||||||
|
add_env RUNNER_TOOL_CACHE /tmp
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
@ -159,10 +172,10 @@ self_hosted_setup() {
|
|||||||
configure_php() {
|
configure_php() {
|
||||||
add_php_config
|
add_php_config
|
||||||
ini_config_dir="${src:?}"/configs/ini
|
ini_config_dir="${src:?}"/configs/ini
|
||||||
ini_files=("$ini_config_dir"/php.ini)
|
ini_config_files=("$ini_config_dir"/php.ini)
|
||||||
[[ "$version" =~ $jit_versions ]] && ini_files+=("$ini_config_dir"/jit.ini)
|
[[ "$version" =~ $jit_versions ]] && ini_config_files+=("$ini_config_dir"/jit.ini)
|
||||||
[[ "$version" =~ $xdebug3_versions ]] && ini_files+=("$ini_config_dir"/xdebug.ini)
|
[[ "$version" =~ $xdebug3_versions ]] && ini_config_files+=("$ini_config_dir"/xdebug.ini)
|
||||||
cat "${ini_files[@]}" | sudo tee -a "${pecl_file:-${ini_file[@]}}" >/dev/null 2>&1
|
cat "${ini_config_files[@]}" | sudo tee -a "${ini_file[@]:?}" >/dev/null 2>&1
|
||||||
}
|
}
|
||||||
|
|
||||||
# Function to get PHP version in semver format.
|
# Function to get PHP version in semver format.
|
||||||
|
@ -43,7 +43,7 @@ Function Set-Output() {
|
|||||||
$value
|
$value
|
||||||
)
|
)
|
||||||
if ($env:GITHUB_ACTIONS -eq 'true') {
|
if ($env:GITHUB_ACTIONS -eq 'true') {
|
||||||
Write-Output "::set-output name=$output::$value"
|
Add-Content "$output=$value" -Path $env:GITHUB_OUTPUT -Encoding utf8
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -88,6 +88,7 @@ Function Add-Path {
|
|||||||
}
|
}
|
||||||
if ($env:GITHUB_PATH) {
|
if ($env:GITHUB_PATH) {
|
||||||
Add-Content $PathItem -Path $env:GITHUB_PATH -Encoding utf8
|
Add-Content $PathItem -Path $env:GITHUB_PATH -Encoding utf8
|
||||||
|
$env:PATH += "$PathItem;"
|
||||||
} else {
|
} else {
|
||||||
$newPath = (Get-ItemProperty -Path 'hkcu:\Environment' -Name PATH).Path.replace("$PathItem;", '')
|
$newPath = (Get-ItemProperty -Path 'hkcu:\Environment' -Name PATH).Path.replace("$PathItem;", '')
|
||||||
$newPath = $PathItem + ';' + $newPath
|
$newPath = $PathItem + ';' + $newPath
|
||||||
@ -228,6 +229,20 @@ Function Set-PhpCache {
|
|||||||
} catch { }
|
} catch { }
|
||||||
}
|
}
|
||||||
|
|
||||||
|
# Function to add debug symbols to PHP.
|
||||||
|
Function Add-DebugSymbols {
|
||||||
|
$release = Invoke-RestMethod https://api.github.com/repos/shivammathur/php-builder-windows/releases/tags/php$version
|
||||||
|
$dev = if ($version -match $nightly_versions) { '-dev' } else { '' }
|
||||||
|
$asset = $release.assets | ForEach-Object {
|
||||||
|
if($_.name -match "php-debug-pack-$version.[0-9]+$dev$env:PHPTS-Win32-.*-$arch.zip") {
|
||||||
|
return $_.name
|
||||||
|
}
|
||||||
|
}
|
||||||
|
Invoke-WebRequest -UseBasicParsing -Uri $php_builder/releases/download/php$version/$asset -OutFile $php_dir\$asset
|
||||||
|
Expand-Archive -Path $php_dir\$asset -DestinationPath $php_dir -Force
|
||||||
|
Get-ChildItem -Path $php_dir -Filter php_*.pdb | Move-Item -Destination $ext_dir
|
||||||
|
}
|
||||||
|
|
||||||
# Function to install nightly version of PHP
|
# Function to install nightly version of PHP
|
||||||
Function Install-PhpNightly {
|
Function Install-PhpNightly {
|
||||||
Invoke-WebRequest -UseBasicParsing -Uri $php_builder/releases/latest/download/Get-PhpNightly.ps1 -OutFile $php_dir\Get-PhpNightly.ps1 > $null 2>&1
|
Invoke-WebRequest -UseBasicParsing -Uri $php_builder/releases/latest/download/Get-PhpNightly.ps1 -OutFile $php_dir\Get-PhpNightly.ps1 > $null 2>&1
|
||||||
@ -295,6 +310,7 @@ if(-not($env:ImageOS) -and -not($env:ImageVersion)) {
|
|||||||
New-Item $php_dir -Type Directory -Force > $null 2>&1
|
New-Item $php_dir -Type Directory -Force > $null 2>&1
|
||||||
Add-Path -PathItem $php_dir
|
Add-Path -PathItem $php_dir
|
||||||
setx PHPROOT $php_dir >$null 2>&1
|
setx PHPROOT $php_dir >$null 2>&1
|
||||||
|
Add-Env -EnvName RUNNER_TOOL_CACHE -EnvValue $env:TEMP
|
||||||
} else {
|
} else {
|
||||||
$current_profile = "$PSHOME\Profile.ps1"
|
$current_profile = "$PSHOME\Profile.ps1"
|
||||||
if(-not(Test-Path -LiteralPath $current_profile)) {
|
if(-not(Test-Path -LiteralPath $current_profile)) {
|
||||||
@ -349,6 +365,10 @@ if ($null -eq $installed -or -not("$($installed.Version).".StartsWith(($version
|
|||||||
Add-PhpConfig
|
Add-PhpConfig
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if($env:DEBUG -eq 'true') {
|
||||||
|
Add-DebugSymbols
|
||||||
|
}
|
||||||
|
|
||||||
$installed = Get-Php -Path $php_dir
|
$installed = Get-Php -Path $php_dir
|
||||||
if($installed.MajorMinorVersion -ne $version) {
|
if($installed.MajorMinorVersion -ne $version) {
|
||||||
Add-Log $cross "PHP" "Could not setup PHP $version"
|
Add-Log $cross "PHP" "Could not setup PHP $version"
|
||||||
|
55
src/tools.ts
55
src/tools.ts
@ -21,8 +21,12 @@ interface IRef {
|
|||||||
export async function getSemverVersion(data: RS): Promise<string> {
|
export async function getSemverVersion(data: RS): Promise<string> {
|
||||||
const search: string = data['version_prefix'] + data['version'];
|
const search: string = data['version_prefix'] + data['version'];
|
||||||
const url = `https://api.github.com/repos/${data['repository']}/git/matching-refs/tags%2F${search}.`;
|
const url = `https://api.github.com/repos/${data['repository']}/git/matching-refs/tags%2F${search}.`;
|
||||||
const token: string = await utils.readEnv('COMPOSER_TOKEN');
|
let github_token: string = await utils.readEnv('GITHUB_TOKEN');
|
||||||
const response: RS = await fetch.fetch(url, token);
|
const composer_token: string = await utils.readEnv('COMPOSER_TOKEN');
|
||||||
|
if (composer_token && !github_token) {
|
||||||
|
github_token = composer_token;
|
||||||
|
}
|
||||||
|
const response: RS = await fetch.fetch(url, github_token);
|
||||||
if (response.error || response.data === '[]') {
|
if (response.error || response.data === '[]') {
|
||||||
data['error'] = response.error ?? `No version found with prefix ${search}.`;
|
data['error'] = response.error ?? `No version found with prefix ${search}.`;
|
||||||
return data['version'];
|
return data['version'];
|
||||||
@ -230,24 +234,34 @@ export async function addBlackfirePlayer(data: RS): Promise<string> {
|
|||||||
* @param data
|
* @param data
|
||||||
*/
|
*/
|
||||||
export async function addComposer(data: RS): Promise<string> {
|
export async function addComposer(data: RS): Promise<string> {
|
||||||
|
const channel = data['version'].replace('latest', 'stable');
|
||||||
const github = data['github'];
|
const github = data['github'];
|
||||||
const getcomposer = data['domain'];
|
const getcomposer = data['domain'];
|
||||||
let cache_url = `${github}/shivammathur/composer-cache/releases/latest/download/composer-${
|
const cds = 'https://dl.cloudsmith.io';
|
||||||
data['php_version']
|
const filename = `composer-${data['php_version']}-${channel}.phar`;
|
||||||
}-${data['version'].replace('latest', 'stable')}.phar`;
|
const releases_url = `${github}/shivammathur/composer-cache/releases/latest/download/${filename}`;
|
||||||
|
const cds_url = `${cds}/public/shivammathur/composer-cache/raw/files/${filename}`;
|
||||||
|
const lts_url = `${getcomposer}/download/latest-2.2.x/composer.phar`;
|
||||||
|
const is_lts = /^5\.[3-6]$|^7\.[0-1]$/.test(data['php_version']);
|
||||||
|
const version_source_url = `${getcomposer}/composer-${channel}.phar`;
|
||||||
|
let cache_url = `${releases_url},${cds_url}`;
|
||||||
let source_url = `${getcomposer}/composer.phar`;
|
let source_url = `${getcomposer}/composer.phar`;
|
||||||
switch (true) {
|
switch (true) {
|
||||||
case /^snapshot$/.test(data['version']):
|
case /^snapshot$/.test(channel):
|
||||||
|
source_url = is_lts ? lts_url : source_url;
|
||||||
break;
|
break;
|
||||||
case /^preview$|^[1-2]$/.test(data['version']):
|
case /^preview$|^2$/.test(channel):
|
||||||
source_url = `${getcomposer}/composer-${data['version']}.phar`;
|
source_url = is_lts ? lts_url : version_source_url;
|
||||||
|
break;
|
||||||
|
case /^1$/.test(channel):
|
||||||
|
source_url = version_source_url;
|
||||||
break;
|
break;
|
||||||
case /^\d+\.\d+\.\d+[\w-]*$/.test(data['version']):
|
case /^\d+\.\d+\.\d+[\w-]*$/.test(data['version']):
|
||||||
cache_url = `${github}/${data['repository']}/releases/download/${data['version']}/composer.phar`;
|
cache_url = `${github}/${data['repository']}/releases/download/${data['version']}/composer.phar`;
|
||||||
source_url = `${getcomposer}/composer-${data['version']}.phar`;
|
source_url = version_source_url;
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
source_url = `${getcomposer}/composer-stable.phar`;
|
source_url = is_lts ? lts_url : version_source_url;
|
||||||
}
|
}
|
||||||
const use_cache: boolean = (await utils.readEnv('NO_TOOLS_CACHE')) !== 'true';
|
const use_cache: boolean = (await utils.readEnv('NO_TOOLS_CACHE')) !== 'true';
|
||||||
data['url'] = use_cache ? `${cache_url},${source_url}` : source_url;
|
data['url'] = use_cache ? `${cache_url},${source_url}` : source_url;
|
||||||
@ -264,8 +278,25 @@ export async function addDeployer(data: RS): Promise<string> {
|
|||||||
if (data['version'] === 'latest') {
|
if (data['version'] === 'latest') {
|
||||||
data['url'] = data['domain'] + '/deployer.phar';
|
data['url'] = data['domain'] + '/deployer.phar';
|
||||||
} else {
|
} else {
|
||||||
data['url'] =
|
const manifest: RS = await fetch.fetch(
|
||||||
data['domain'] + '/releases/v' + data['version'] + '/deployer.phar';
|
'https://deployer.org/manifest.json'
|
||||||
|
);
|
||||||
|
const version_data: RSRS = JSON.parse(manifest.data);
|
||||||
|
const version_key: string | undefined = Object.keys(version_data).find(
|
||||||
|
(key: string) => {
|
||||||
|
return version_data[key]['version'] === data['version'];
|
||||||
|
}
|
||||||
|
);
|
||||||
|
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);
|
||||||
}
|
}
|
||||||
|
23
src/utils.ts
23
src/utils.ts
@ -413,3 +413,26 @@ export async function parseExtensionSource(
|
|||||||
prefix
|
prefix
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Log to console
|
||||||
|
*
|
||||||
|
* @param variable
|
||||||
|
* @param command
|
||||||
|
* @param os
|
||||||
|
*/
|
||||||
|
export async function setVariable(
|
||||||
|
variable: string,
|
||||||
|
command: string,
|
||||||
|
os: string
|
||||||
|
): Promise<string> {
|
||||||
|
switch (os) {
|
||||||
|
case 'win32':
|
||||||
|
return '\n$' + variable + ' = ' + command + '\n';
|
||||||
|
|
||||||
|
case 'linux':
|
||||||
|
case 'darwin':
|
||||||
|
default:
|
||||||
|
return '\n' + variable + '="$(' + command + ')"\n';
|
||||||
|
}
|
||||||
|
}
|
||||||
|
@ -3,7 +3,7 @@
|
|||||||
"declaration": true,
|
"declaration": true,
|
||||||
"esModuleInterop": true,
|
"esModuleInterop": true,
|
||||||
"lib": [
|
"lib": [
|
||||||
"ES2020"
|
"ES2021"
|
||||||
],
|
],
|
||||||
"module": "commonjs",
|
"module": "commonjs",
|
||||||
"moduleResolution": "node",
|
"moduleResolution": "node",
|
||||||
@ -13,7 +13,7 @@
|
|||||||
"rootDir": "./src",
|
"rootDir": "./src",
|
||||||
"sourceMap": true,
|
"sourceMap": true,
|
||||||
"strict": true,
|
"strict": true,
|
||||||
"target": "ES2019"
|
"target": "ES2021"
|
||||||
},
|
},
|
||||||
"exclude": ["__tests__", "lib", "node_modules"]
|
"exclude": ["__tests__", "lib", "node_modules"]
|
||||||
}
|
}
|
Reference in New Issue
Block a user