Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Binary file added .github/phar/keys.asc.gpg
Binary file not shown.
103 changes: 103 additions & 0 deletions .github/workflows/build-phar-release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,103 @@
---

on: # yamllint disable-line rule:truthy
release:
types:
- published
workflow_dispatch:

name: 📦 Build PHAR release

jobs:
build-release:
runs-on: ubuntu-latest
timeout-minutes: 4
strategy:
matrix:
php-version:
- '8.3'
dependencies:
- locked
env:
PHONY_PHAR: ".build/phar/phony.phar"
PHONY_PHAR_SIGNATURE: ".build/phar/phony.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

- name: 🛠️ Setup PHP
uses: shivammathur/setup-php@2.33.0
with:
php-version: ${{ matrix.php-version }}
extensions: none, ctype, dom, json, mbstring, phar, simplexml, tokenizer, xml, xmlwriter, sockets, intl
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.3.0

- name: ♻️ Restore cached dependencies installed with composer
uses: actions/cache@v4
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.3.0
with:
dependencies: ${{ matrix.dependencies }}

- name: 📥 Install dependencies with phive
uses: wayofdev/gh-actions/actions/phive/install@v3.3.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 phony.phar with box-project/box
run: .phive/box compile --ansi

- name: 💥 Show info about phony.phar with box-project/box
run: .phive/box info ${{ env.PHONY_PHAR }} --ansi

- name: 🤔 Run phony.phar help command
run: ${{ env.PHONY_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 phony.phar with gpg
run: gpg --armor --local-user "${{ secrets.GPG_LOCAL_USER }}" --output ${{ env.PHONY_PHAR_SIGNATURE }} --passphrase "${{ secrets.GPG_KEY_PASSPHRASE }}" --pinentry-mode loopback --yes --detach-sig ${{ env.PHONY_PHAR }}

- name: ❎ Remove decrypted keys.asc
run: rm ${{ env.GPG_KEYS }}

- name: 📤 Upload release assets
uses: softprops/action-gh-release@v2.5.0
if: startsWith(github.ref, 'refs/tags/')
with:
token: "${{ secrets.GITHUB_TOKEN }}"
files: |
${{ env.PHONY_PHAR }}
${{ env.PHONY_PHAR_SIGNATURE }}

...
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,6 @@

<br>

# Phony: All in one PHP toolchain
# Phony — Your PHP Quality Stable

This package @todo
File renamed without changes.
Loading