Skip to content

Use centralized phar build #1

Use centralized phar build

Use centralized phar build #1

Workflow file for this run

inputs:
php-version:
description: "The PHP version to use when running the job"
required: true
type: "string"
php-extensions:
description: "The php extensions to install, allowing composer to pass"
required: true
type: "string"
key:
description: "The key to use for caching"
required: true
type: "string"
steps:
- name: Setup cache environment
id: cache-env
uses: shivammathur/cache-extensions@v1
with:
php-version: ${{ input.php-version }}
extensions: ${{ input.extensions }}
key: ${{ input.key }}
- name: Cache extensions
uses: actions/cache@v3
with:
path: ${{ steps.cache-env.outputs.dir }}
key: ${{ steps.cache-env.outputs.key }}
restore-keys: ${{ steps.cache-env.outputs.key }}
- name: Setup PHP
uses: shivammathur/setup-php@v2
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
php-version: ${{ input.php-version }}
extensions: ${{ input.extensions }}
ini-values: memory_limit=2G, display_errors=On, error_reporting=-1
tools: pecl
- name: Install Composer dependencies & cache dependencies
env:
COMPOSER_MIRROR_PATH_REPOS: 1
uses: "ramsey/composer-install@v2"
with:
composer-options: --optimize-autoloader
# Bust the cache at least once a month - output format: YYYY-MM-DD.
custom-cache-suffix: $(date -u -d "-0 month -$(($(date +%d)-1)) days" "+%F")
- name: remove phpstan/extension-installer
env:
COMPOSER_MIRROR_PATH_REPOS: 1
run: composer remove --dev phpstan/extension-installer
- name: Install Composer dependencies & cache dependencies
env:
COMPOSER_MIRROR_PATH_REPOS: 1
uses: "ramsey/composer-install@v2"
with:
composer-options: --optimize-autoloader
# Bust the cache at least once a month - output format: YYYY-MM-DD.
custom-cache-suffix: $(date -u -d "-0 month -$(($(date +%d)-1)) days" "+%F")
- name: warm cache
uses: phpDocumentor/phar-ga@latest
with:
args: php bin/console cache:warmup --env=prod
- name: build phar
run: ./tools/box compile
- name: list keys
uses: phpDocumentor/phar-ga@latest
env:
PASSPHRASE: ${{ secrets.PASSPHRASE }}
SECRET_KEY: ${{ secrets.SECRET_KEY }}
with:
args: gpg --list-secret-keys
- name: sign phar
uses: phpDocumentor/phar-ga@latest
if: github.ref == 'refs/heads/master'
env:
PASSPHRASE: ${{ secrets.PASSPHRASE }}
SECRET_KEY: ${{ secrets.SECRET_KEY }}
with:
args: gpg --command-fd 0 --pinentry-mode loopback -u info@phpdoc.org --batch
--detach-sign --output build/phpDocumentor.phar.asc build/phpDocumentor.phar