Compare commits

...

26 Commits

Author SHA1 Message Date
06512d94ed Update macos-latest in README [skip ci] 2025-09-15 13:08:41 +05:30
1c302aed34 Mark macOS 26 as supported [skip ci] 2025-09-15 13:05:52 +05:30
dcffe28928 Fix jit config on arm 2025-09-11 18:38:04 +05:30
6ffdb3d118 Bump version to 2.35.5
Update Node.js dependencies
2025-09-09 05:57:14 +05:30
c97dacbacf Merge pull request #995 from shivammathur/dependabot/github_actions/develop/actions/setup-node-5
Bump actions/setup-node from 4 to 5
2025-09-08 15:51:50 +05:30
34f574e7aa Bump actions/setup-node from 4 to 5
Bumps [actions/setup-node](https://github.com/actions/setup-node) from 4 to 5.
- [Release notes](https://github.com/actions/setup-node/releases)
- [Commits](https://github.com/actions/setup-node/compare/v4...v5)

---
updated-dependencies:
- dependency-name: actions/setup-node
  dependency-version: '5'
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-09-08 10:18:19 +00:00
317a051dea Add fallback cache for keys in ppa.sh 2025-09-07 11:58:20 +05:30
dfcda83968 Add fallback url for composer 2025-09-04 20:26:04 +05:30
96d7cf331d Fix warning on chmod on failure in get 2025-09-02 14:42:11 +05:30
baed2d33b8 Provide better error in tools' setup 2025-09-01 12:27:19 +05:30
1398cb4c9f Fix using new github-input for tools.ts 2025-08-27 17:12:07 +05:30
462e7103e4 Add fallback to github api for adding intl 2025-08-27 09:12:14 +05:30
8582cb12d5 Use seperate releases for shivammathur/icu-intl 2025-08-27 07:36:01 +05:30
ec406be512 Bump version to 2.35.4
Update Node.js dependencies
2025-08-25 14:45:11 +05:30
36a27b0262 Move to main branch for protoc 2025-08-25 14:39:29 +05:30
ea2f858afe Move to main branch for brew 2025-08-25 14:39:29 +05:30
507ff06e8d Merge pull request #989 from shivammathur/dependabot/github_actions/develop/actions/checkout-5
Bump actions/checkout from 4 to 5
2025-08-18 22:32:57 +05:30
629475b7b3 Bump actions/checkout from 4 to 5
Bumps [actions/checkout](https://github.com/actions/checkout) from 4 to 5.
- [Release notes](https://github.com/actions/checkout/releases)
- [Changelog](https://github.com/actions/checkout/blob/main/CHANGELOG.md)
- [Commits](https://github.com/actions/checkout/compare/v4...v5)

---
updated-dependencies:
- dependency-name: actions/checkout
  dependency-version: '5'
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-08-18 16:21:04 +00:00
521f2e5b93 Merge pull request #986 from shivammathur/dependabot/github_actions/develop/actions/download-artifact-5
Bump actions/download-artifact from 4 to 5
2025-08-11 21:32:18 +05:30
259d177178 Bump actions/download-artifact from 4 to 5
Bumps [actions/download-artifact](https://github.com/actions/download-artifact) from 4 to 5.
- [Release notes](https://github.com/actions/download-artifact/releases)
- [Commits](https://github.com/actions/download-artifact/compare/v4...v5)

---
updated-dependencies:
- dependency-name: actions/download-artifact
  dependency-version: '5'
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-08-11 14:51:06 +00:00
20529878ed Bump version to 2.35.3
Bump Node.js dependencies
2025-08-10 12:03:22 +05:30
68634e7bca Fix relay for PHP 7.4 [skip ci] 2025-08-10 12:03:22 +05:30
0ac4874a14 Merge pull request #982 from jrfnl/feature/ghactions-dont-run-cronjobs-on-forks
GH Actions: don't run cron jobs on forks
2025-08-04 20:07:42 +05:30
c9735bcc02 GH Actions: don't run cron jobs on forks
While workflows are disabled by default in forks, it is quite common for contributors to enable them to verify CI will pass before submitting a pull request.

When enabling workflow runs in forks, it's "all or nothing".
This means that:
* All workflows which are only intended to be run on the canonical repo will also be enabled.
    These workflows will also often need access to repo-specific secrets and will typically fail when run from a fork.
* Workflows which contain cron jobs will also be enabled.
    Depending on the type of account the contributor has, this can burn through their "CI minutes".

This commit is based on a review of workflows containing cron jobs and disables running the jobs when a cron job is triggered in a fork.
2025-08-04 16:23:49 +02:00
89b2566bb0 Check github-token on enterprise
On GitHub enterprise we may get a Personal Access token or a default token generated by GitHub that maybe not have the permissions required to access public GitHub, so we check and add it only if it can authenticate with the public GitHub API
2025-08-02 12:12:58 +05:30
dcec1cf0b4 Override GITHUB_TOKEN if COMPOSER_TOKEN is set 2025-07-30 22:30:05 +05:30
23 changed files with 542 additions and 503 deletions

View File

@ -8,6 +8,7 @@ permissions:
jobs:
codeql:
if: github.event.repository.fork == false
permissions:
actions: read # for github/codeql-action/init to get workflow details
contents: read # for actions/checkout to fetch code
@ -15,7 +16,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
uses: actions/checkout@v5
with:
fetch-depth: 2

View File

@ -8,6 +8,7 @@ permissions:
jobs:
create:
if: github.event.repository.fork == false
permissions:
contents: none
name: Create
@ -92,6 +93,7 @@ jobs:
name: lists-php${{ matrix.php-versions }}-${{ matrix.operating-system }}.md
path: php${{ matrix.php-versions }}-${{ matrix.operating-system }}.md
update:
if: github.event.repository.fork == false
permissions:
contents: write # for Git to git push
name: Update
@ -99,11 +101,11 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
uses: actions/checkout@v5
with:
repository: ${{ github.repository }}.wiki
- name: Download artifacts
uses: actions/download-artifact@v4
uses: actions/download-artifact@v5
with:
path: ${{ github.workspace }}/lists
pattern: lists-*

View File

@ -29,12 +29,12 @@ jobs:
operating-system: [ubuntu-latest, windows-latest, macos-latest]
steps:
- name: Checkout
uses: actions/checkout@v4
uses: actions/checkout@v5
with:
fetch-depth: 2
- name: Setup Node.js 20.x
uses: actions/setup-node@v4
uses: actions/setup-node@v5
with:
node-version: 20.x

View File

@ -39,7 +39,7 @@ jobs:
key: cache-v5
steps:
- name: Checkout
uses: actions/checkout@v4
uses: actions/checkout@v5
- name: Setup cache environment
id: cache-env

View File

@ -19,16 +19,16 @@ jobs:
steps:
- name: Checkout release
if: github.event_name != 'workflow_dispatch'
uses: actions/checkout@v4
uses: actions/checkout@v5
- name: Checkout tag
uses: actions/checkout@v4
uses: actions/checkout@v5
if: github.event_name == 'workflow_dispatch'
with:
ref: ${{ github.event.inputs.tag }}
- name: Setup Node.js
uses: actions/setup-node@v4
uses: actions/setup-node@v5
with:
node-version: '20.x'
registry-url: https://registry.npmjs.org
@ -46,7 +46,7 @@ jobs:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
- name: Change to GitHub Packages registry
uses: actions/setup-node@v4
uses: actions/setup-node@v5
with:
registry-url: https://npm.pkg.github.com
scope: '@shivammathur'

View File

@ -77,8 +77,9 @@ Both `GitHub-hosted` and `self-hosted` runners are supported by `setup-php` on t
| Windows Server 2025 | x64 | `windows-2025` | `PHP 8.3` |
| Windows Server 2022 | x64 | `windows-latest` or `windows-2022` | `PHP 8.3` |
| Windows Server 2019 | x64 | `windows-2019` | `PHP 8.3` |
| macOS Sequoia 15.x | arm64 | `macos-15` | - |
| macOS Sonoma 14.x | arm64 | `macos-latest` or `macos-14` | - |
| macOS Tahoe 26.x | arm64 | `macos-26` | - |
| macOS Sequoia 15.x | arm64 | `macos-latest` or `macos-15` | - |
| macOS Sonoma 14.x | arm64 | `macos-14` | - |
| macOS Ventura 13.x | x86_64 | `macos-13` | `PHP 8.3` |
### Self-Hosted Runners
@ -91,6 +92,7 @@ Both `GitHub-hosted` and `self-hosted` runners are supported by `setup-php` on t
| Debian 11 | `self-hosted` or `Linux` |
| Windows 7 and newer | `self-hosted` or `Windows` |
| Windows Server 2012 R2 and newer | `self-hosted` or `Windows` |
| macOS Tahoe 26.x x86_64/arm64 | `self-hosted` or `macOS` |
| macOS Sequoia 15.x x86_64/arm64 | `self-hosted` or `macOS` |
| macOS Sonoma 14.x x86_64/arm64 | `self-hosted` or `macOS` |
| macOS Ventura 13.x x86_64/arm64 | `self-hosted` or `macOS` |
@ -465,6 +467,7 @@ Disable coverage for these reasons:
- Specify the GitHub token to use for authentication.
- Accepts a `string`.
- By default, `GITHUB_TOKEN` secret provided by GitHub Actions is used.
- For GitHub Enterprise users, it is recommended to use a Personal Access Token (PAT).
### Outputs
@ -741,7 +744,7 @@ act -P ubuntu-22.04=shivammathur/node:2204
- 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.
- By default, `opcache.jit=1235` and `opcache.jit_buffer_size=256M` are set which can be changed using `ini-values` input.
- By default, `opcache.jit=1235` and `opcache.jit_buffer_size=256M` (`opcache.jit_buffer_size=128M` on ARM-based environments) are set which can be changed using `ini-values` input.
- For detailed information about JIT related directives refer to the [`official PHP documentation`](https://www.php.net/manual/en/opcache.configuration.php#ini.opcache.jit "opcache.jit documentation").
For example to enable JIT in `tracing` mode with buffer size of `64 MB`.
@ -797,8 +800,6 @@ restore-keys: ${{ runner.os }}-composer-${{ matrix.prefer }}-
By default, setup-php uses the `GITHUB_TOKEN` secret that is generated for each workflow run. In case you want to use a Personal Access Token (PAT) instead, you can set the `github-token` input.
The `COMPOSER_TOKEN` and `GITHUB_TOKEN` environment variables have been deprecated in favor of the `github-token` input and will be removed in the next major version.
```yaml
- name: Setup PHP
uses: shivammathur/setup-php@v2
@ -807,6 +808,10 @@ The `COMPOSER_TOKEN` and `GITHUB_TOKEN` environment variables have been deprecat
github-token: ${{ secrets.YOUR_PAT_TOKEN }}
```
The `COMPOSER_TOKEN` and `GITHUB_TOKEN` environment variables have been deprecated in favor of the `github-token` input and will be removed in the next major version.
For GitHub Enterprise users, the `github-token` input does not default to the `GITHUB_TOKEN` secret. Therefore, it's recommended to set the `github-token` input to a Personal Access Token (PAT).
### Private Packagist Authentication
If you use Private Packagist for your private composer dependencies, you can set the `PACKAGIST_TOKEN` environment variable to authenticate.

View File

@ -332,6 +332,12 @@ describe('Tools tests', () => {
${'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.4'} | ${'true'} | ${'https://artifacts.setup-php.com/composer/composer-7.4-stable.phar'} | ${'https://getcomposer.org/composer-stable.phar'}
${'stable'} | ${'7.4'} | ${'true'} | ${'https://artifacts.setup-php.com/composer/composer-7.4-stable.phar'} | ${'https://getcomposer.org/composer-stable.phar'}
${'snapshot'} | ${'7.4'} | ${'true'} | ${'https://artifacts.setup-php.com/composer/composer-7.4-snapshot.phar'} | ${'https://getcomposer.org/composer.phar'}
${'preview'} | ${'7.4'} | ${'true'} | ${'https://artifacts.setup-php.com/composer/composer-7.4-preview.phar'} | ${'https://getcomposer.org/composer-preview.phar'}
${'1'} | ${'7.4'} | ${'false'} | ${'https://artifacts.setup-php.com/composer/composer-7.4-1.phar'} | ${'https://getcomposer.org/composer-1.phar'}
${'2'} | ${'7.4'} | ${'false'} | ${'https://artifacts.setup-php.com/composer/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'}
@ -395,7 +401,7 @@ describe('Tools tests', () => {
[
'blackfire, blackfire-player, box, churn, cs2pr, flex, grpc_php_plugin, mago, name-collision-detector, parallel-lint, php-cs-fixer, php-scoper, phpDocumentor, phplint, phpstan, phpunit, pecl, phing, phinx, phinx:1.2.3, phive, phpunit-bridge, phpunit-polyfills, pint, php-config, phpize, protoc, symfony, vapor, wp, pie',
[
'add_tool https://github.com/shivammathur/composer-cache/releases/latest/download/composer-7.4-stable.phar,https://dl.cloudsmith.io/public/shivammathur/composer-cache/raw/files/composer-7.4-stable.phar,https://getcomposer.org/composer-stable.phar composer',
'add_tool https://github.com/shivammathur/composer-cache/releases/latest/download/composer-7.4-stable.phar,https://artifacts.setup-php.com/composer/composer-7.4-stable.phar,https://dl.cloudsmith.io/public/shivammathur/composer-cache/raw/files/composer-7.4-stable.phar,https://getcomposer.org/composer-stable.phar composer',
'add_blackfire',
'add_tool https://get.blackfire.io/blackfire-player-v1.22.0.phar blackfire-player "-V"',
'add_tool https://github.com/box-project/box/releases/latest/download/box.phar box "--version"',
@ -440,7 +446,7 @@ describe('Tools tests', () => {
[
'backward-compatibility-check, behat, blackfire, blackfire-player, churn, composer-dependency-analyser, composer-normalize, composer-require-checker, composer-unused, cs2pr:1.2.3, ecs, flex, grpc_php_plugin:1.2.3, infection, mago:0.26.1, name-collision-detector, phan, phan:1.2.3, phing:1.2.3, phinx, phive:1.2.3, php-config, phpcbf, phpcpd, phpcs, phpdoc, phpize, phpmd, phpspec, phpunit-bridge:5.6, phpunit-polyfills:1.0.1, protoc:v1.2.3, psalm, rector, symfony-cli, vapor-cli, wp-cli, pie',
[
'add_tool https://github.com/shivammathur/composer-cache/releases/latest/download/composer-7.4-stable.phar,https://dl.cloudsmith.io/public/shivammathur/composer-cache/raw/files/composer-7.4-stable.phar,https://getcomposer.org/composer-stable.phar composer',
'add_tool https://github.com/shivammathur/composer-cache/releases/latest/download/composer-7.4-stable.phar,https://artifacts.setup-php.com/composer/composer-7.4-stable.phar,https://dl.cloudsmith.io/public/shivammathur/composer-cache/raw/files/composer-7.4-stable.phar,https://getcomposer.org/composer-stable.phar composer',
'add_composer_tool behat behat behat/ scoped',
'add_blackfire',
'add_tool https://get.blackfire.io/blackfire-player-v1.22.0.phar blackfire-player "-V"',
@ -492,7 +498,7 @@ describe('Tools tests', () => {
[
'blackfire, blackfire-player:1.2.3, cs2pr, churn, deployer, does_not_exist, flex, mago, name-collision-detector, phinx, phive:0.13.2, php-config, phpize, phpmd, simple-phpunit, symfony, wp, pie',
[
'Add-Tool https://github.com/shivammathur/composer-cache/releases/latest/download/composer-7.4-stable.phar,https://dl.cloudsmith.io/public/shivammathur/composer-cache/raw/files/composer-7.4-stable.phar,https://getcomposer.org/composer-stable.phar composer',
'Add-Tool https://github.com/shivammathur/composer-cache/releases/latest/download/composer-7.4-stable.phar,https://artifacts.setup-php.com/composer/composer-7.4-stable.phar,https://dl.cloudsmith.io/public/shivammathur/composer-cache/raw/files/composer-7.4-stable.phar,https://getcomposer.org/composer-stable.phar composer',
'Add-Blackfire',
'blackfire-player is not a windows tool',
'Add-Tool https://github.com/staabm/annotate-pull-request-from-checkstyle/releases/latest/download/cs2pr cs2pr "-V"',
@ -524,7 +530,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',
[
'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-Tool https://github.com/shivammathur/composer-cache/releases/latest/download/composer-7.4-1.phar,https://artifacts.setup-php.com/composer/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 prestissimo prestissimo hirak/ global',
'Add-ComposerTool automatic-composer-prefetcher automatic-composer-prefetcher narrowspark/ global',
@ -573,10 +579,10 @@ describe('Tools tests', () => {
it.each`
tools_csv | script
${'none'} | ${''}
${'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-7.4.0.phar,https://phar.phpunit.de/phpunit-7.phar phpunit "--version"'}
${'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://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://dl.cloudsmith.io/public/shivammathur/composer-cache/raw/files/composer-7.4-snapshot.phar,https://getcomposer.org/composer.phar composer snapshot'}
${'none, phpunit'} | ${'\nstep_log "Setup Tools"\nadd_tool https://github.com/shivammathur/composer-cache/releases/latest/download/composer-7.4-stable.phar,https://artifacts.setup-php.com/composer/composer-7.4-stable.phar,https://dl.cloudsmith.io/public/shivammathur/composer-cache/raw/files/composer-7.4-stable.phar,https://getcomposer.org/composer-stable.phar composer latest\n\nadd_tool https://phar.phpunit.de/phpunit-7.4.0.phar,https://phar.phpunit.de/phpunit-7.phar phpunit "--version"'}
${'composer:preview'} | ${'add_tool https://github.com/shivammathur/composer-cache/releases/latest/download/composer-7.4-preview.phar,https://artifacts.setup-php.com/composer/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://artifacts.setup-php.com/composer/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://artifacts.setup-php.com/composer/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}) => {
expect(await tools.addTools(tools_csv, '7.4', 'linux')).toContain(script);
});

2
dist/index.js vendored

File diff suppressed because one or more lines are too long

843
package-lock.json generated

File diff suppressed because it is too large Load Diff

View File

@ -1,6 +1,6 @@
{
"name": "setup-php",
"version": "2.35.2",
"version": "2.35.5",
"private": false,
"description": "Setup PHP for use with GitHub Actions",
"main": "lib/install.js",
@ -40,26 +40,26 @@
"compare-versions": "^6.1.1"
},
"devDependencies": {
"@eslint/compat": "^1.3.1",
"@eslint/js": "9.32.0",
"@eslint/compat": "^1.3.2",
"@eslint/js": "9.35.0",
"@types/jest": "^30.0.0",
"@types/node": "^24.1.0",
"@typescript-eslint/eslint-plugin": "^8.38.0",
"@typescript-eslint/parser": "^8.38.0",
"@types/node": "^24.3.1",
"@typescript-eslint/eslint-plugin": "^8.43.0",
"@typescript-eslint/parser": "^8.43.0",
"@vercel/ncc": "^0.38.3",
"eslint": "9.32.0",
"eslint": "9.35.0",
"eslint-config-prettier": "^10.1.8",
"eslint-plugin-import": "^2.32.0",
"eslint-plugin-jest": "^29.0.1",
"eslint-plugin-prettier": "^5.5.3",
"eslint-plugin-prettier": "^5.5.4",
"globals": "^16.3.0",
"jest": "^30.0.5",
"jest-circus": "^30.0.5",
"nock": "^14.0.7",
"jest": "^30.1.3",
"jest-circus": "^30.1.3",
"nock": "^14.0.10",
"prettier": "^3.6.2",
"simple-git-hooks": "^2.13.0",
"ts-jest": "^29.4.0",
"typescript": "^5.8.3"
"simple-git-hooks": "^2.13.1",
"ts-jest": "^29.4.1",
"typescript": "^5.9.2"
},
"overrides": {
"test-exclude": "^7.0.1"

View File

@ -0,0 +1,3 @@
opcache.enable=1
opcache.jit_buffer_size=128M
opcache.jit=1235

View File

@ -59,10 +59,10 @@ export async function setEnv(): Promise<void> {
* Run the script
*/
export async function run(): Promise<void> {
await setEnv();
const os: string = process.platform;
const tool = await utils.scriptTool(os);
const run_path = await getScript(os);
await setEnv();
await exec(tool + run_path);
}

View File

@ -134,9 +134,9 @@ patch_brew() {
update_dependencies() {
patch_brew
if ! [ -e /tmp/update_dependencies ]; then
for repo in "$brew_repo" "$core_repo"; do
for repo in "$brew_repo" "${core_repo:?}"; do
if [ -e "$repo" ]; then
git_retry -C "$repo" fetch origin master && git -C "$repo" reset --hard origin/master
git_retry -C "$repo" fetch origin main && git -C "$repo" reset --hard origin/main
fi
done
echo '' | sudo tee /tmp/update_dependencies >/dev/null 2>&1

View File

@ -11,13 +11,14 @@ install_icu() {
# Function to add ext-intl with the given version of ICU
add_intl() {
icu=$(echo "$1" | cut -d'-' -f 2)
supported_version=$(get -s -n "" https://api.github.com/repos/shivammathur/icu-intl/releases | grep -Po "${icu//./\\.}" | head -n 1)
if [ "$icu" != "$supported_version" ]; then
add_log "${cross:?}" "intl" "ICU $icu is not supported"
supported_version=$(get -s -n "" https://api.github.com/repos/shivammathur/icu-intl/releases/tags/intl-"$icu" | grep -Po "php${version?}-intl-$icu" | head -n 1)
[ -z "$supported_version" ] && supported_version=$(get -s -n "" https://github.com/shivammathur/icu-intl/releases/expanded_assets/intl-"$icu" | grep -Po "php$version-intl-$icu" | head -n 1)
if [ "php$version-intl-$icu" != "$supported_version" ]; then
add_log "${cross:?}" "intl" "ICU $icu is not supported for PHP $version"
else
[ "${ts:?}" = 'zts' ] && suffix='-zts'
install_icu "$icu" >/dev/null 2>&1
get -q -n "${ext_dir:?}/intl.so" "https://github.com/shivammathur/icu-intl/releases/download/intl/php${version:?}-intl-$icu$suffix$arch_suffix.so"
get -q -n "${ext_dir:?}/intl.so" "https://github.com/shivammathur/icu-intl/releases/download/intl-$icu/php${version:?}-intl-$icu$suffix$arch_suffix.so"
enable_extension intl extension
add_extension_log intl "Installed and enabled with ICU $icu"
fi

View File

@ -48,6 +48,19 @@ change_library_paths() {
fi
}
# Add hiredis library
add_hiredis_1.1.0() {
hiredis_url=https://github.com/redis/hiredis/archive/v1.1.0.tar.gz
hiredis_sha=fe6d21741ec7f3fc9df409d921f47dfc73a4d8ff64f4ac6f1d95f951bf7f53d6
sed -Ei.bak -e "s#^ url.*# url \"$hiredis_url\"#" -e "s#^ sha256.*# sha256 \"$hiredis_sha\"#" ${core_repo:?}/Formula/h/hiredis.rb
brew install -s hiredis
lib_dir="${brew_prefix:?}"/opt/hiredis/lib
if [ -e "$lib_dir"/libhiredis_ssl.1.1.0.dylib ]; then
sudo ln -sf "$lib_dir"/libhiredis_ssl.1.1.0.dylib "$lib_dir"/libhiredis_ssl.dylib.1.1.0
fi
mv ${core_repo:?}/Formula/h/hiredis.rb.bak ${core_repo:?}/Formula/h/hiredis.rb
}
# Add relay dependencies
add_relay_dependencies() {
add_extension json
@ -56,7 +69,12 @@ add_relay_dependencies() {
if [ "$os" = "Darwin" ]; then
. "${0%/*}"/tools/brew.sh
configure_brew
brew install lz4 hiredis zstd concurrencykit
if [ "$relay_version" = "v0.7.0" ]; then
brew install lz4 zstd concurrencykit
add_hiredis_1.1.0 >/dev/null 2>&1
else
brew install lz4 hiredis zstd concurrencykit
fi
fi
}

View File

@ -61,6 +61,19 @@ Function Update-AuthJson {
Set-Content -Path $composer_home\auth.json -Value ($existing | ConvertTo-Json -Depth 5)
}
function Test-GitHubPublicAccess {
param(
[Parameter(Mandatory=$true)]
[string]$Token
)
try {
Invoke-RestMethod -Uri 'https://api.github.com/' -Headers @{ Authorization = "token $Token" } -ErrorAction Stop | Out-Null
return $true
} catch {
return $false
}
}
# Function to setup authentication in composer.
Function Set-ComposerAuth() {
if(Test-Path env:COMPOSER_AUTH_JSON) {
@ -74,11 +87,15 @@ Function Set-ComposerAuth() {
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 + '"}'
$write_token = $true
$token = if ($env:COMPOSER_TOKEN) { $env:COMPOSER_TOKEN } else { $env:GITHUB_TOKEN }
if ($token) {
if ($env:GITHUB_SERVER_URL -ne "https://github.com" -and -not(Test-GitHubPublicAccess $token)) {
$write_token = $false
}
if($write_token) {
$composer_auth += '"github-oauth": {"github.com": "' + $token + '"}'
}
}
if($composer_auth.length) {
Update-AuthJson $composer_auth

View File

@ -65,6 +65,11 @@ update_auth_json() {
printf '%s' "$merged" > "$composer_home/auth.json"
}
# Function to check if public GitHub token authentication is possible.
can_access_public_github() {
curl --fail -s -H "Authorization: token $1" 'https://api.github.com/' >/dev/null 2>&1
}
# Function to setup authentication in composer.
set_composer_auth() {
if [ -n "$COMPOSER_AUTH_JSON" ]; then
@ -78,8 +83,15 @@ set_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}"'"}' )
token="${COMPOSER_TOKEN:-$GITHUB_TOKEN}"
if [ -n "$token" ]; then
write_token=true
if [ "$GITHUB_SERVER_URL" != "https://github.com" ]; then
can_access_public_github "$token" || write_token=false
fi
if [ "$write_token" = 'true' ]; then
composer_auth+=( '"github-oauth": {"github.com": "'"$token"'"}' )
fi
fi
if ((${#composer_auth[@]})); then
update_auth_json "${composer_auth[@]}"
@ -188,7 +200,11 @@ add_tool() {
elif [ -e /tmp/"$tool" ]; then
sudo cp -a /tmp/"$tool" "$tool_path"
fi
add_log "$cross" "$tool" "Could not setup $tool"
if [ "$status_code" = "404" ]; then
add_log "$cross" "$tool" "Failed to download $tool from ${url[*]}"
else
add_log "$cross" "$tool" "Could not setup $tool"
fi
fi
}

View File

@ -49,7 +49,7 @@ 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
get -s "" "/tmp/install.sh" "https://raw.githubusercontent.com/Homebrew/install/main/install.sh" | bash -s >/dev/null 2>&1
add_log "${tick:?}" "Brew" "Installed Homebrew"
fi
add_brew_bins_to_path "$brew_prefix"

View File

@ -66,10 +66,14 @@ update_lists() {
# Function to get fingerprint from an Ubuntu PPA.
ubuntu_fingerprint() {
ppa=$1
get -s -n "" "${lp_api[@]/%//~${ppa%/*}/+archive/${ppa##*/}}" | jq -r '.signing_key_fingerprint'
ppa="$1"
ppa_uri="~${ppa%/*}/+archive/ubuntu/${ppa##*/}"
get -s -n "" "${lp_api[0]}/$ppa_uri" | jq -er '.signing_key_fingerprint' 2>/dev/null \
|| get -s -n "" "${lp_api[1]}/$ppa_uri" | jq -er '.signing_key_fingerprint' 2>/dev/null \
|| get -s -n "" "$ppa_sp/keys/$ppa.fingerprint"
}
# Function to get fingerprint from a Debian PPA.
debian_fingerprint() {
ppa=$1
@ -93,6 +97,7 @@ add_key() {
sks_params="op=get&options=mr&exact=on&search=0x$fingerprint"
key_urls=("${sks[@]/%/\/pks\/lookup\?"$sks_params"}")
fi
key_urls+=("$ppa_sp/keys/$ppa.gpg")
[ ! -e "$key_source" ] && get -q -n "$key_file" "${key_urls[@]}"
if [[ "$(file "$key_file")" =~ .*('Public-Key (old)'|'Secret-Key') ]]; then
sudo gpg --batch --yes --dearmor "$key_file" >/dev/null 2>&1 && sudo mv "$key_file".gpg "$key_file"

View File

@ -35,6 +35,6 @@ Function Add-Protoc() {
Add-ToProfile $current_profile 'protoc' "New-Alias protoc $bin_dir\protoc.exe"
Add-Log $tick "protoc" "Added protoc $($protobuf_tag -replace 'v', '')"
printf "$env:GROUP\033[34;1m%s \033[0m\033[90;1m%s \033[0m\n" "protoc" "Click to read the protoc related license information"
Write-Output (Invoke-WebRequest https://raw.githubusercontent.com/protocolbuffers/protobuf/master/LICENSE).Content
Write-Output (Invoke-WebRequest https://raw.githubusercontent.com/protocolbuffers/protobuf/main/LICENSE).Content
Write-Output "$env:END_GROUP"
}

View File

@ -25,6 +25,6 @@ add_protoc() {
) >/dev/null 2>&1
add_log "${tick:?}" "protoc" "Added protoc ${protobuf_tag:1}"
printf "$GROUP\033[34;1m%s \033[0m\033[90;1m%s \033[0m\n" "protoc" "Click to read the protoc related license information"
curl "${curl_opts[@]:?}" https://raw.githubusercontent.com/protocolbuffers/protobuf/master/LICENSE
curl "${curl_opts[@]:?}" https://raw.githubusercontent.com/protocolbuffers/protobuf/main/LICENSE
echo "$END_GROUP"
}

View File

@ -145,7 +145,7 @@ get() {
status_code=$(sudo curl -w "%{http_code}" -o "$file_path" "${curl_opts[@]}" "$link")
[ "$status_code" = "200" ] && break
done
[ "$execute" = "-e" ] && sudo chmod a+x "$file_path"
[[ "$execute" = "-e" && -e "$file_path" ]] && sudo chmod a+x "$file_path"
[ "$mode" = "-v" ] && echo "$status_code"
[ "$runner" = "self-hosted" ] && release_lock "$lock_path"
fi
@ -244,7 +244,9 @@ configure_php() {
add_php_config
ini_config_dir="${src:?}"/configs/ini
ini_config_files=("$ini_config_dir"/php.ini)
jit_config_files=("$ini_config_dir"/jit.ini)
arch="$(uname -m)"
[[ "$arch" = "arm64" || "$arch" = "aarch64" ]] && jit_ini="$ini_config_dir"/jit_aarch64.ini || jit_ini="$ini_config_dir"/jit.ini
jit_config_files=("$jit_ini")
[[ "$version" =~ $xdebug3_versions ]] && ini_config_files+=("$ini_config_dir"/xdebug.ini)
cat "${ini_config_files[@]}" | sudo tee -a "${ini_file[@]:?}" >/dev/null 2>&1
[[ "$version" =~ $jit_versions ]] && cat "${jit_config_files[@]}" | sudo tee -a "${pecl_file:-${ini_file[@]}}" >/dev/null 2>&1

View File

@ -263,13 +263,15 @@ export async function addComposer(data: RS): Promise<string> {
const github = data['github'];
const getcomposer = data['domain'];
const cds = 'https://dl.cloudsmith.io';
const spc = 'https://artifacts.setup-php.com';
const filename = `composer-${data['php_version']}-${channel}.phar`;
const releases_url = `${github}/shivammathur/composer-cache/releases/latest/download/${filename}`;
const cds_url = `${cds}/public/shivammathur/composer-cache/raw/files/${filename}`;
const spc_url = `${spc}/composer/${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 cache_url = `${releases_url},${spc_url},${cds_url}`;
let source_url = `${getcomposer}/composer.phar`;
switch (true) {
case /^snapshot$/.test(channel):