1.0.0-alpha #5
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
--- | |
on: # yamllint disable-line rule:truthy | |
release: | |
types: | |
- published | |
name: π¦ Build PHAR release | |
jobs: | |
build-release: | |
runs-on: ubuntu-latest | |
timeout-minutes: 4 | |
strategy: | |
matrix: | |
php-version: | |
- '8.2' | |
dependencies: | |
- locked | |
env: | |
DLOAD_PHAR: ".build/phar/dload.phar" | |
DLOAD_PHAR_SIGNATURE: ".build/phar/dload.phar.asc" | |
GPG_KEYS: ".build/phar/keys.asc" | |
GPG_KEYS_ENCRYPTED: ".github/phar/keys.asc.gpg" | |
steps: | |
- name: π¦ Check out the codebase | |
uses: actions/checkout@v4.1.5 | |
- name: π οΈ Setup PHP | |
uses: shivammathur/setup-php@2.30.4 | |
with: | |
php-version: ${{ matrix.php-version }} | |
extensions: none, ctype, dom, json, mbstring, phar, simplexml, tokenizer, xml, xmlwriter, sockets | |
ini-values: error_reporting=E_ALL | |
coverage: none | |
tools: phive | |
- name: π οΈ Setup problem matchers | |
run: | | |
echo "::add-matcher::${{ runner.tool_cache }}/php.json" | |
- name: π€ Validate composer.json and composer.lock | |
run: composer validate --ansi --strict | |
- name: π Get composer cache directory | |
uses: wayofdev/gh-actions/actions/composer/get-cache-directory@v3.1.0 | |
- name: β»οΈ Restore cached dependencies installed with composer | |
uses: actions/cache@v4.0.2 | |
with: | |
path: ${{ env.COMPOSER_CACHE_DIR }} | |
key: php-${{ matrix.php-version }}-composer-${{ matrix.dependencies }}-${{ hashFiles('composer.lock') }} | |
restore-keys: php-${{ matrix.php-version }}-composer-${{ matrix.dependencies }}- | |
- name: π₯ Install "${{ matrix.dependencies }}" dependencies with composer | |
uses: wayofdev/gh-actions/actions/composer/install@v3.1.0 | |
with: | |
dependencies: ${{ matrix.dependencies }} | |
- name: π₯ Install dependencies with phive | |
uses: wayofdev/gh-actions/actions/phive/install@v3.1.0 | |
with: | |
phive-home: '.phive' | |
trust-gpg-keys: '0xC00543248C87FB13,0x033E5F8D801A2F8D,0x2DF45277AEF09A2F' | |
- name: π Validate configuration for box-project/box | |
run: .phive/box validate box.json.dist --ansi | |
- name: π€ Compile dload.phar with box-project/box | |
run: .phive/box compile --ansi | |
- name: π₯ Show info about dload.phar with box-project/box | |
run: .phive/box info ${{ env.DLOAD_PHAR }} --ansi | |
- name: π€ Run dload.phar help command | |
run: ${{ env.DLOAD_PHAR }} --help | |
- name: π Show gpg version | |
run: gpg --version | |
- name: π Decrypt keys.asc.gpg with gpg | |
run: gpg --batch --output ${{ env.GPG_KEYS }} --passphrase "${{ secrets.GPG_DECRYPT_PASSPHRASE }}" --yes --decrypt ${{ env.GPG_KEYS_ENCRYPTED }} | |
- name: π₯ Import keys from keys.asc with gpg | |
run: gpg --batch --import ${{ env.GPG_KEYS }} | |
- name: π Sign dload.phar with gpg | |
run: gpg --armor --local-user "${{ secrets.GPG_LOCAL_USER }}" --output ${{ env.DLOAD_PHAR_SIGNATURE }} --passphrase "${{ secrets.GPG_KEY_PASSPHRASE }}" --pinentry-mode loopback --yes --detach-sig ${{ env.DLOAD_PHAR }} | |
- name: β Remove decrypted keys.asc | |
run: rm ${{ env.GPG_KEYS }} | |
- name: π€ Upload release assets | |
uses: softprops/action-gh-release@v2.0.5 | |
if: startsWith(github.ref, 'refs/tags/') | |
with: | |
token: "${{ secrets.DLOAD_RELEASE_TOKEN }}" | |
files: | | |
${{ env.DLOAD_PHAR }} | |
${{ env.DLOAD_PHAR_SIGNATURE }} |