mirror of
https://github.com/shivammathur/setup-php.git
synced 2025-09-09 14:24:06 +07:00
Compare commits
29 Commits
Author | SHA1 | Date | |
---|---|---|---|
6ffdb3d118 | |||
c97dacbacf | |||
34f574e7aa | |||
317a051dea | |||
dfcda83968 | |||
96d7cf331d | |||
baed2d33b8 | |||
1398cb4c9f | |||
462e7103e4 | |||
8582cb12d5 | |||
ec406be512 | |||
36a27b0262 | |||
ea2f858afe | |||
507ff06e8d | |||
629475b7b3 | |||
521f2e5b93 | |||
259d177178 | |||
20529878ed | |||
68634e7bca | |||
0ac4874a14 | |||
c9735bcc02 | |||
89b2566bb0 | |||
dcec1cf0b4 | |||
ccf2c627fe | |||
2a597f617d | |||
2282b6a082 | |||
11373c6dce | |||
50ad25710d | |||
c1c6c51867 |
3
.github/workflows/codeql.yml
vendored
3
.github/workflows/codeql.yml
vendored
@ -8,6 +8,7 @@ permissions:
|
|||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
codeql:
|
codeql:
|
||||||
|
if: github.event.repository.fork == false
|
||||||
permissions:
|
permissions:
|
||||||
actions: read # for github/codeql-action/init to get workflow details
|
actions: read # for github/codeql-action/init to get workflow details
|
||||||
contents: read # for actions/checkout to fetch code
|
contents: read # for actions/checkout to fetch code
|
||||||
@ -15,7 +16,7 @@ jobs:
|
|||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout
|
- name: Checkout
|
||||||
uses: actions/checkout@v4
|
uses: actions/checkout@v5
|
||||||
with:
|
with:
|
||||||
fetch-depth: 2
|
fetch-depth: 2
|
||||||
|
|
||||||
|
6
.github/workflows/docs.yml
vendored
6
.github/workflows/docs.yml
vendored
@ -8,6 +8,7 @@ permissions:
|
|||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
create:
|
create:
|
||||||
|
if: github.event.repository.fork == false
|
||||||
permissions:
|
permissions:
|
||||||
contents: none
|
contents: none
|
||||||
name: Create
|
name: Create
|
||||||
@ -92,6 +93,7 @@ jobs:
|
|||||||
name: lists-php${{ matrix.php-versions }}-${{ matrix.operating-system }}.md
|
name: lists-php${{ matrix.php-versions }}-${{ matrix.operating-system }}.md
|
||||||
path: php${{ matrix.php-versions }}-${{ matrix.operating-system }}.md
|
path: php${{ matrix.php-versions }}-${{ matrix.operating-system }}.md
|
||||||
update:
|
update:
|
||||||
|
if: github.event.repository.fork == false
|
||||||
permissions:
|
permissions:
|
||||||
contents: write # for Git to git push
|
contents: write # for Git to git push
|
||||||
name: Update
|
name: Update
|
||||||
@ -99,11 +101,11 @@ jobs:
|
|||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout
|
- name: Checkout
|
||||||
uses: actions/checkout@v4
|
uses: actions/checkout@v5
|
||||||
with:
|
with:
|
||||||
repository: ${{ github.repository }}.wiki
|
repository: ${{ github.repository }}.wiki
|
||||||
- name: Download artifacts
|
- name: Download artifacts
|
||||||
uses: actions/download-artifact@v4
|
uses: actions/download-artifact@v5
|
||||||
with:
|
with:
|
||||||
path: ${{ github.workspace }}/lists
|
path: ${{ github.workspace }}/lists
|
||||||
pattern: lists-*
|
pattern: lists-*
|
||||||
|
4
.github/workflows/node.yml
vendored
4
.github/workflows/node.yml
vendored
@ -29,12 +29,12 @@ jobs:
|
|||||||
operating-system: [ubuntu-latest, windows-latest, macos-latest]
|
operating-system: [ubuntu-latest, windows-latest, macos-latest]
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout
|
- name: Checkout
|
||||||
uses: actions/checkout@v4
|
uses: actions/checkout@v5
|
||||||
with:
|
with:
|
||||||
fetch-depth: 2
|
fetch-depth: 2
|
||||||
|
|
||||||
- name: Setup Node.js 20.x
|
- name: Setup Node.js 20.x
|
||||||
uses: actions/setup-node@v4
|
uses: actions/setup-node@v5
|
||||||
with:
|
with:
|
||||||
node-version: 20.x
|
node-version: 20.x
|
||||||
|
|
||||||
|
2
.github/workflows/php.yml
vendored
2
.github/workflows/php.yml
vendored
@ -39,7 +39,7 @@ jobs:
|
|||||||
key: cache-v5
|
key: cache-v5
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout
|
- name: Checkout
|
||||||
uses: actions/checkout@v4
|
uses: actions/checkout@v5
|
||||||
|
|
||||||
- name: Setup cache environment
|
- name: Setup cache environment
|
||||||
id: cache-env
|
id: cache-env
|
||||||
|
8
.github/workflows/publish.yml
vendored
8
.github/workflows/publish.yml
vendored
@ -19,16 +19,16 @@ jobs:
|
|||||||
steps:
|
steps:
|
||||||
- name: Checkout release
|
- name: Checkout release
|
||||||
if: github.event_name != 'workflow_dispatch'
|
if: github.event_name != 'workflow_dispatch'
|
||||||
uses: actions/checkout@v4
|
uses: actions/checkout@v5
|
||||||
|
|
||||||
- name: Checkout tag
|
- name: Checkout tag
|
||||||
uses: actions/checkout@v4
|
uses: actions/checkout@v5
|
||||||
if: github.event_name == 'workflow_dispatch'
|
if: github.event_name == 'workflow_dispatch'
|
||||||
with:
|
with:
|
||||||
ref: ${{ github.event.inputs.tag }}
|
ref: ${{ github.event.inputs.tag }}
|
||||||
|
|
||||||
- name: Setup Node.js
|
- name: Setup Node.js
|
||||||
uses: actions/setup-node@v4
|
uses: actions/setup-node@v5
|
||||||
with:
|
with:
|
||||||
node-version: '20.x'
|
node-version: '20.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@v4
|
uses: actions/setup-node@v5
|
||||||
with:
|
with:
|
||||||
registry-url: https://npm.pkg.github.com
|
registry-url: https://npm.pkg.github.com
|
||||||
scope: '@shivammathur'
|
scope: '@shivammathur'
|
||||||
|
@ -465,6 +465,7 @@ Disable coverage for these reasons:
|
|||||||
- Specify the GitHub token to use for authentication.
|
- Specify the GitHub token to use for authentication.
|
||||||
- Accepts a `string`.
|
- Accepts a `string`.
|
||||||
- By default, `GITHUB_TOKEN` secret provided by GitHub Actions is used.
|
- 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
|
### Outputs
|
||||||
|
|
||||||
@ -797,8 +798,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.
|
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
|
```yaml
|
||||||
- name: Setup PHP
|
- name: Setup PHP
|
||||||
uses: shivammathur/setup-php@v2
|
uses: shivammathur/setup-php@v2
|
||||||
@ -807,6 +806,10 @@ The `COMPOSER_TOKEN` and `GITHUB_TOKEN` environment variables have been deprecat
|
|||||||
github-token: ${{ secrets.YOUR_PAT_TOKEN }}
|
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
|
### Private Packagist Authentication
|
||||||
|
|
||||||
If you use Private Packagist for your private composer dependencies, you can set the `PACKAGIST_TOKEN` environment variable to authenticate.
|
If you use Private Packagist for your private composer dependencies, you can set the `PACKAGIST_TOKEN` environment variable to authenticate.
|
||||||
|
@ -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'}
|
${'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'}
|
${'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'}
|
${'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'}
|
${'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'}
|
${'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'}
|
${'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',
|
'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_blackfire',
|
||||||
'add_tool https://get.blackfire.io/blackfire-player-v1.22.0.phar blackfire-player "-V"',
|
'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"',
|
'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',
|
'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_composer_tool behat behat behat/ scoped',
|
||||||
'add_blackfire',
|
'add_blackfire',
|
||||||
'add_tool https://get.blackfire.io/blackfire-player-v1.22.0.phar blackfire-player "-V"',
|
'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',
|
'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',
|
'Add-Blackfire',
|
||||||
'blackfire-player is not a windows tool',
|
'blackfire-player is not a windows tool',
|
||||||
'Add-Tool https://github.com/staabm/annotate-pull-request-from-checkstyle/releases/latest/download/cs2pr cs2pr "-V"',
|
'Add-Tool https://github.com/staabm/annotate-pull-request-from-checkstyle/releases/latest/download/cs2pr cs2pr "-V"',
|
||||||
@ -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',
|
'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 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',
|
||||||
@ -573,10 +579,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://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"'}
|
${'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://dl.cloudsmith.io/public/shivammathur/composer-cache/raw/files/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://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://dl.cloudsmith.io/public/shivammathur/composer-cache/raw/files/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://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://dl.cloudsmith.io/public/shivammathur/composer-cache/raw/files/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://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}) => {
|
`('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);
|
||||||
});
|
});
|
||||||
|
2
dist/index.js
vendored
2
dist/index.js
vendored
File diff suppressed because one or more lines are too long
843
package-lock.json
generated
843
package-lock.json
generated
File diff suppressed because it is too large
Load Diff
28
package.json
28
package.json
@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "setup-php",
|
"name": "setup-php",
|
||||||
"version": "2.35.0",
|
"version": "2.35.5",
|
||||||
"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",
|
||||||
@ -40,26 +40,26 @@
|
|||||||
"compare-versions": "^6.1.1"
|
"compare-versions": "^6.1.1"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@eslint/compat": "^1.3.1",
|
"@eslint/compat": "^1.3.2",
|
||||||
"@eslint/js": "9.32.0",
|
"@eslint/js": "9.35.0",
|
||||||
"@types/jest": "^30.0.0",
|
"@types/jest": "^30.0.0",
|
||||||
"@types/node": "^24.1.0",
|
"@types/node": "^24.3.1",
|
||||||
"@typescript-eslint/eslint-plugin": "^8.38.0",
|
"@typescript-eslint/eslint-plugin": "^8.43.0",
|
||||||
"@typescript-eslint/parser": "^8.38.0",
|
"@typescript-eslint/parser": "^8.43.0",
|
||||||
"@vercel/ncc": "^0.38.3",
|
"@vercel/ncc": "^0.38.3",
|
||||||
"eslint": "9.32.0",
|
"eslint": "9.35.0",
|
||||||
"eslint-config-prettier": "^10.1.8",
|
"eslint-config-prettier": "^10.1.8",
|
||||||
"eslint-plugin-import": "^2.32.0",
|
"eslint-plugin-import": "^2.32.0",
|
||||||
"eslint-plugin-jest": "^29.0.1",
|
"eslint-plugin-jest": "^29.0.1",
|
||||||
"eslint-plugin-prettier": "^5.5.3",
|
"eslint-plugin-prettier": "^5.5.4",
|
||||||
"globals": "^16.3.0",
|
"globals": "^16.3.0",
|
||||||
"jest": "^30.0.5",
|
"jest": "^30.1.3",
|
||||||
"jest-circus": "^30.0.5",
|
"jest-circus": "^30.1.3",
|
||||||
"nock": "^14.0.7",
|
"nock": "^14.0.10",
|
||||||
"prettier": "^3.6.2",
|
"prettier": "^3.6.2",
|
||||||
"simple-git-hooks": "^2.13.0",
|
"simple-git-hooks": "^2.13.1",
|
||||||
"ts-jest": "^29.4.0",
|
"ts-jest": "^29.4.1",
|
||||||
"typescript": "^5.8.3"
|
"typescript": "^5.9.2"
|
||||||
},
|
},
|
||||||
"overrides": {
|
"overrides": {
|
||||||
"test-exclude": "^7.0.1"
|
"test-exclude": "^7.0.1"
|
||||||
|
@ -59,10 +59,10 @@ export async function setEnv(): Promise<void> {
|
|||||||
* Run the script
|
* Run the script
|
||||||
*/
|
*/
|
||||||
export async function run(): Promise<void> {
|
export async function run(): Promise<void> {
|
||||||
|
await setEnv();
|
||||||
const os: string = process.platform;
|
const os: string = process.platform;
|
||||||
const tool = await utils.scriptTool(os);
|
const tool = await utils.scriptTool(os);
|
||||||
const run_path = await getScript(os);
|
const run_path = await getScript(os);
|
||||||
await setEnv();
|
|
||||||
await exec(tool + run_path);
|
await exec(tool + run_path);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -134,9 +134,9 @@ patch_brew() {
|
|||||||
update_dependencies() {
|
update_dependencies() {
|
||||||
patch_brew
|
patch_brew
|
||||||
if ! [ -e /tmp/update_dependencies ]; then
|
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
|
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
|
fi
|
||||||
done
|
done
|
||||||
echo '' | sudo tee /tmp/update_dependencies >/dev/null 2>&1
|
echo '' | sudo tee /tmp/update_dependencies >/dev/null 2>&1
|
||||||
|
@ -11,13 +11,14 @@ install_icu() {
|
|||||||
# Function to add ext-intl with the given version of ICU
|
# Function to add ext-intl with the given version of ICU
|
||||||
add_intl() {
|
add_intl() {
|
||||||
icu=$(echo "$1" | cut -d'-' -f 2)
|
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)
|
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)
|
||||||
if [ "$icu" != "$supported_version" ]; then
|
[ -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)
|
||||||
add_log "${cross:?}" "intl" "ICU $icu is not supported"
|
if [ "php$version-intl-$icu" != "$supported_version" ]; then
|
||||||
|
add_log "${cross:?}" "intl" "ICU $icu is not supported for PHP $version"
|
||||||
else
|
else
|
||||||
[ "${ts:?}" = 'zts' ] && suffix='-zts'
|
[ "${ts:?}" = 'zts' ] && suffix='-zts'
|
||||||
install_icu "$icu" >/dev/null 2>&1
|
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
|
enable_extension intl extension
|
||||||
add_extension_log intl "Installed and enabled with ICU $icu"
|
add_extension_log intl "Installed and enabled with ICU $icu"
|
||||||
fi
|
fi
|
||||||
|
@ -1,7 +1,11 @@
|
|||||||
patch_geos() {
|
patch_geos() {
|
||||||
if [ "$(php -r "echo PHP_VERSION_ID;")" -ge 70000 ]; then
|
php_version_id="$(php -r "echo PHP_VERSION_ID;")"
|
||||||
|
if [ "$php_version_id" -ge 70000 ]; then
|
||||||
sed -i~ -e "s/, ce->name/, ZSTR_VAL(ce->name)/; s/ulong /zend_ulong /" geos.c
|
sed -i~ -e "s/, ce->name/, ZSTR_VAL(ce->name)/; s/ulong /zend_ulong /" geos.c
|
||||||
fi
|
fi
|
||||||
|
if [ "$php_version_id" -ge 80500 ]; then
|
||||||
|
sed -i~ -e "s/zend_exception_get_default(TSRMLS_C)/zend_ce_exception/" geos.c
|
||||||
|
fi
|
||||||
get -q -n /tmp/php8.patch https://git.remirepo.net/cgit/rpms/php/php-geos.git/plain/0003-add-all-arginfo-and-fix-build-with-PHP-8.patch
|
get -q -n /tmp/php8.patch https://git.remirepo.net/cgit/rpms/php/php-geos.git/plain/0003-add-all-arginfo-and-fix-build-with-PHP-8.patch
|
||||||
get -q -n /tmp/toString.patch https://git.remirepo.net/cgit/rpms/php/php-geos.git/plain/0006-fix-__toString-with-8.2.patch
|
get -q -n /tmp/toString.patch https://git.remirepo.net/cgit/rpms/php/php-geos.git/plain/0006-fix-__toString-with-8.2.patch
|
||||||
patch -p1 < /tmp/php8.patch 2>/dev/null || true
|
patch -p1 < /tmp/php8.patch 2>/dev/null || true
|
||||||
|
@ -48,6 +48,19 @@ change_library_paths() {
|
|||||||
fi
|
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_relay_dependencies() {
|
add_relay_dependencies() {
|
||||||
add_extension json
|
add_extension json
|
||||||
@ -56,7 +69,12 @@ add_relay_dependencies() {
|
|||||||
if [ "$os" = "Darwin" ]; then
|
if [ "$os" = "Darwin" ]; then
|
||||||
. "${0%/*}"/tools/brew.sh
|
. "${0%/*}"/tools/brew.sh
|
||||||
configure_brew
|
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
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -28,6 +28,52 @@ Function Edit-ComposerConfig() {
|
|||||||
Set-ComposerAuth
|
Set-ComposerAuth
|
||||||
}
|
}
|
||||||
|
|
||||||
|
# Function to update auth.json.
|
||||||
|
Function Update-AuthJson {
|
||||||
|
[CmdletBinding()]
|
||||||
|
param(
|
||||||
|
[Parameter(Mandatory)][string[]] $ComposerAuth
|
||||||
|
)
|
||||||
|
if (Test-Path $composer_home\auth.json) {
|
||||||
|
try {
|
||||||
|
$existing = Get-Content $composer_home\auth.json -Raw | ConvertFrom-Json
|
||||||
|
} catch {
|
||||||
|
$existing = [PSCustomObject]@{}
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
$existing = [PSCustomObject]@{}
|
||||||
|
}
|
||||||
|
foreach ($fragment in $ComposerAuth) {
|
||||||
|
$piece = ('{' + $fragment + '}') | ConvertFrom-Json
|
||||||
|
foreach ($prop in $piece.PSObject.Properties) {
|
||||||
|
if ($prop.Name -eq 'http-basic') {
|
||||||
|
if (-not $existing.'http-basic') {
|
||||||
|
$existing | Add-Member -MemberType NoteProperty -Name 'http-basic' -Value ([PSCustomObject]@{}) -Force
|
||||||
|
}
|
||||||
|
foreach ($domainProp in $prop.Value.PSObject.Properties) {
|
||||||
|
$existing.'http-basic' | Add-Member -MemberType NoteProperty -Name $domainProp.Name -Value $domainProp.Value -Force
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
$existing | Add-Member -MemberType NoteProperty -Name $prop.Name -Value $prop.Value -Force
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
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 to setup authentication in composer.
|
||||||
Function Set-ComposerAuth() {
|
Function Set-ComposerAuth() {
|
||||||
if(Test-Path env:COMPOSER_AUTH_JSON) {
|
if(Test-Path env:COMPOSER_AUTH_JSON) {
|
||||||
@ -41,14 +87,18 @@ Function Set-ComposerAuth() {
|
|||||||
if(Test-Path env:PACKAGIST_TOKEN) {
|
if(Test-Path env:PACKAGIST_TOKEN) {
|
||||||
$composer_auth += '"http-basic": {"repo.packagist.com": { "username": "token", "password": "' + $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)) {
|
$write_token = $true
|
||||||
$env:GITHUB_TOKEN = $env:COMPOSER_TOKEN
|
$token = if ($env:COMPOSER_TOKEN) { $env:COMPOSER_TOKEN } else { $env:GITHUB_TOKEN }
|
||||||
}
|
if ($token) {
|
||||||
if (Test-Path env:GITHUB_TOKEN) {
|
if ($env:GITHUB_SERVER_URL -ne "https://github.com" -and -not(Test-GitHubPublicAccess $token)) {
|
||||||
$composer_auth += '"github-oauth": {"github.com": "' + $env:GITHUB_TOKEN + '"}'
|
$write_token = $false
|
||||||
|
}
|
||||||
|
if($write_token) {
|
||||||
|
$composer_auth += '"github-oauth": {"github.com": "' + $token + '"}'
|
||||||
|
}
|
||||||
}
|
}
|
||||||
if($composer_auth.length) {
|
if($composer_auth.length) {
|
||||||
Add-Env COMPOSER_AUTH ('{' + ($composer_auth -join ',') + '}')
|
Update-AuthJson $composer_auth
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -11,7 +11,7 @@ get_tool_version() {
|
|||||||
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")"
|
||||||
if [[ -n "$composer_alias_version" ]]; then
|
if [[ -n "$composer_alias_version" ]]; then
|
||||||
composer_version="$composer_alias_version+$(grep -Ea "const\sVERSION" "$tool_path_dir/composer" | grep -Eo "$alp+" | tail -n 1)"
|
composer_version="$composer_alias_version+$(grep -Ea "const\sVERSION" "$tool_path_dir/composer" | grep -Eo "$alp+" | tail -n 1)"
|
||||||
else
|
else
|
||||||
@ -46,6 +46,30 @@ configure_composer() {
|
|||||||
set_composer_auth
|
set_composer_auth
|
||||||
}
|
}
|
||||||
|
|
||||||
|
# Function to merge auth.json fragments.
|
||||||
|
update_auth_json() {
|
||||||
|
local auth_file="$composer_home/auth.json"
|
||||||
|
local merged
|
||||||
|
[[ -f "$auth_file" ]] && merged=$(<"$auth_file") || merged='{}'
|
||||||
|
for frag in "$@"; do
|
||||||
|
local obj="{$frag}"
|
||||||
|
merged=$(jq -n --argjson b "$merged" --argjson n "$obj" '
|
||||||
|
if $n|has("http-basic") then
|
||||||
|
(($b["http-basic"]//{}) + $n["http-basic"]) as $hb
|
||||||
|
| ($b + $n) | .["http-basic"] = $hb
|
||||||
|
else
|
||||||
|
$b + $n
|
||||||
|
end
|
||||||
|
')
|
||||||
|
done
|
||||||
|
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.
|
# Function to setup authentication in composer.
|
||||||
set_composer_auth() {
|
set_composer_auth() {
|
||||||
if [ -n "$COMPOSER_AUTH_JSON" ]; then
|
if [ -n "$COMPOSER_AUTH_JSON" ]; then
|
||||||
@ -59,11 +83,18 @@ set_composer_auth() {
|
|||||||
if [ -n "$PACKAGIST_TOKEN" ]; then
|
if [ -n "$PACKAGIST_TOKEN" ]; then
|
||||||
composer_auth+=( '"http-basic": {"repo.packagist.com": { "username": "token", "password": "'"$PACKAGIST_TOKEN"'"}}' )
|
composer_auth+=( '"http-basic": {"repo.packagist.com": { "username": "token", "password": "'"$PACKAGIST_TOKEN"'"}}' )
|
||||||
fi
|
fi
|
||||||
if [ -n "${GITHUB_TOKEN:-$COMPOSER_TOKEN}" ]; then
|
token="${COMPOSER_TOKEN:-$GITHUB_TOKEN}"
|
||||||
composer_auth+=( '"github-oauth": {"github.com": "'"${GITHUB_TOKEN:-$COMPOSER_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
|
fi
|
||||||
if ((${#composer_auth[@]})); then
|
if ((${#composer_auth[@]})); then
|
||||||
add_env COMPOSER_AUTH "{$(IFS=$','; echo "${composer_auth[*]}")}"
|
update_auth_json "${composer_auth[@]}"
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -169,7 +200,11 @@ add_tool() {
|
|||||||
elif [ -e /tmp/"$tool" ]; then
|
elif [ -e /tmp/"$tool" ]; then
|
||||||
sudo cp -a /tmp/"$tool" "$tool_path"
|
sudo cp -a /tmp/"$tool" "$tool_path"
|
||||||
fi
|
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
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -49,7 +49,7 @@ add_brew() {
|
|||||||
brew_prefix="$(get_brew_prefix)"
|
brew_prefix="$(get_brew_prefix)"
|
||||||
if ! [ -d "$brew_prefix"/bin ]; then
|
if ! [ -d "$brew_prefix"/bin ]; then
|
||||||
step_log "Setup Brew"
|
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"
|
add_log "${tick:?}" "Brew" "Installed Homebrew"
|
||||||
fi
|
fi
|
||||||
add_brew_bins_to_path "$brew_prefix"
|
add_brew_bins_to_path "$brew_prefix"
|
||||||
|
@ -66,10 +66,14 @@ update_lists() {
|
|||||||
|
|
||||||
# Function to get fingerprint from an Ubuntu PPA.
|
# Function to get fingerprint from an Ubuntu PPA.
|
||||||
ubuntu_fingerprint() {
|
ubuntu_fingerprint() {
|
||||||
ppa=$1
|
ppa="$1"
|
||||||
get -s -n "" "${lp_api[@]/%//~${ppa%/*}/+archive/${ppa##*/}}" | jq -r '.signing_key_fingerprint'
|
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.
|
# Function to get fingerprint from a Debian PPA.
|
||||||
debian_fingerprint() {
|
debian_fingerprint() {
|
||||||
ppa=$1
|
ppa=$1
|
||||||
@ -93,6 +97,7 @@ add_key() {
|
|||||||
sks_params="op=get&options=mr&exact=on&search=0x$fingerprint"
|
sks_params="op=get&options=mr&exact=on&search=0x$fingerprint"
|
||||||
key_urls=("${sks[@]/%/\/pks\/lookup\?"$sks_params"}")
|
key_urls=("${sks[@]/%/\/pks\/lookup\?"$sks_params"}")
|
||||||
fi
|
fi
|
||||||
|
key_urls+=("$ppa_sp/keys/$ppa.gpg")
|
||||||
[ ! -e "$key_source" ] && get -q -n "$key_file" "${key_urls[@]}"
|
[ ! -e "$key_source" ] && get -q -n "$key_file" "${key_urls[@]}"
|
||||||
if [[ "$(file "$key_file")" =~ .*('Public-Key (old)'|'Secret-Key') ]]; then
|
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"
|
sudo gpg --batch --yes --dearmor "$key_file" >/dev/null 2>&1 && sudo mv "$key_file".gpg "$key_file"
|
||||||
|
@ -35,6 +35,6 @@ Function Add-Protoc() {
|
|||||||
Add-ToProfile $current_profile 'protoc' "New-Alias protoc $bin_dir\protoc.exe"
|
Add-ToProfile $current_profile 'protoc' "New-Alias protoc $bin_dir\protoc.exe"
|
||||||
Add-Log $tick "protoc" "Added protoc $($protobuf_tag -replace 'v', '')"
|
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"
|
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"
|
Write-Output "$env:END_GROUP"
|
||||||
}
|
}
|
||||||
|
@ -25,6 +25,6 @@ add_protoc() {
|
|||||||
) >/dev/null 2>&1
|
) >/dev/null 2>&1
|
||||||
add_log "${tick:?}" "protoc" "Added protoc ${protobuf_tag: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"
|
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"
|
echo "$END_GROUP"
|
||||||
}
|
}
|
||||||
|
@ -145,7 +145,7 @@ get() {
|
|||||||
status_code=$(sudo curl -w "%{http_code}" -o "$file_path" "${curl_opts[@]}" "$link")
|
status_code=$(sudo curl -w "%{http_code}" -o "$file_path" "${curl_opts[@]}" "$link")
|
||||||
[ "$status_code" = "200" ] && break
|
[ "$status_code" = "200" ] && break
|
||||||
done
|
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"
|
[ "$mode" = "-v" ] && echo "$status_code"
|
||||||
[ "$runner" = "self-hosted" ] && release_lock "$lock_path"
|
[ "$runner" = "self-hosted" ] && release_lock "$lock_path"
|
||||||
fi
|
fi
|
||||||
|
@ -263,13 +263,15 @@ export async function addComposer(data: RS): Promise<string> {
|
|||||||
const github = data['github'];
|
const github = data['github'];
|
||||||
const getcomposer = data['domain'];
|
const getcomposer = data['domain'];
|
||||||
const cds = 'https://dl.cloudsmith.io';
|
const cds = 'https://dl.cloudsmith.io';
|
||||||
|
const spc = 'https://artifacts.setup-php.com';
|
||||||
const filename = `composer-${data['php_version']}-${channel}.phar`;
|
const filename = `composer-${data['php_version']}-${channel}.phar`;
|
||||||
const releases_url = `${github}/shivammathur/composer-cache/releases/latest/download/${filename}`;
|
const releases_url = `${github}/shivammathur/composer-cache/releases/latest/download/${filename}`;
|
||||||
const cds_url = `${cds}/public/shivammathur/composer-cache/raw/files/${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 lts_url = `${getcomposer}/download/latest-2.2.x/composer.phar`;
|
||||||
const is_lts = /^5\.[3-6]$|^7\.[0-1]$/.test(data['php_version']);
|
const is_lts = /^5\.[3-6]$|^7\.[0-1]$/.test(data['php_version']);
|
||||||
const version_source_url = `${getcomposer}/composer-${channel}.phar`;
|
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`;
|
let source_url = `${getcomposer}/composer.phar`;
|
||||||
switch (true) {
|
switch (true) {
|
||||||
case /^snapshot$/.test(channel):
|
case /^snapshot$/.test(channel):
|
||||||
|
Reference in New Issue
Block a user