Merge pull request #7 from KaririCode-Framework/develop #1
Workflow file for this run
This file contains hidden or 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
| name: Release | |
| # ARFA 1.3 / KaririCode Spec V4.0 — Release Pipeline | |
| # Triggers on semantic version tags (v*). | |
| # Full quality gate (kcode quality) must pass before release is published. | |
| on: | |
| push: | |
| tags: | |
| - 'v*' | |
| permissions: | |
| contents: write | |
| jobs: | |
| release: | |
| name: Quality Gate + GitHub Release | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| # PHP 8.4 + pcov: releases MUST pass with coverage (ARFA 1.3 §Testing) | |
| - uses: shivammathur/setup-php@v2 | |
| with: | |
| php-version: '8.4' | |
| extensions: mbstring, xml, openssl | |
| coverage: pcov | |
| tools: composer:v2 | |
| # --no-scripts prevents accidental environment pollution during release | |
| - name: Install dependencies | |
| run: composer install --no-interaction --prefer-dist --no-progress --no-scripts | |
| - name: Install kcode (KaririCode Devkit) | |
| run: | | |
| wget -q https://github.com/KaririCode-Framework/kariricode-devkit/releases/latest/download/kcode.phar | |
| chmod +x kcode.phar | |
| sudo mv kcode.phar /usr/local/bin/kcode | |
| - name: Initialize devkit | |
| run: kcode init | |
| # Full pipeline: cs-fixer → phpstan (L9) → psalm → phpunit (pcov) | |
| # Exit code ≠ 0 aborts the release — zero tolerance (ARFA 1.3) | |
| - name: Run full quality pipeline (release gate) | |
| run: kcode quality | |
| - name: Extract version from tag | |
| id: version | |
| run: echo "tag=${GITHUB_REF#refs/tags/}" >> "$GITHUB_OUTPUT" | |
| - name: Create GitHub Release | |
| uses: softprops/action-gh-release@v2 | |
| with: | |
| tag_name: ${{ steps.version.outputs.tag }} | |
| name: KaririCode Dotenv ${{ steps.version.outputs.tag }} | |
| draft: false | |
| prerelease: false | |
| body: | | |
| ## KaririCode\Dotenv ${{ steps.version.outputs.tag }} | |
| PHP 8.4+ environment variable engine — **zero external dependencies**, | |
| AES-256-GCM encryption, fluent validation DSL, OPcache caching, | |
| and environment-aware cascade loading. **ARFA 1.3 compliant.** | |
| ## Installation | |
| ```bash | |
| composer require kariricode/dotenv | |
| ``` | |
| ## Quick Start | |
| ```php | |
| use KaririCode\Dotenv\Dotenv; | |
| use function KaririCode\Dotenv\env; | |
| // Bootstrap once (e.g. public/index.php) | |
| $dotenv = new Dotenv(__DIR__); | |
| $dotenv->load(); | |
| // Auto type-cast: string, int, float, bool, null, array/JSON | |
| $debug = env('APP_DEBUG'); // bool | |
| $port = env('DB_PORT'); // int | |
| $cfg = env('JSON_CONFIG'); // array | |
| // Fluent validation DSL (collect-all semantics) | |
| $dotenv->validate() | |
| ->required('APP_KEY', 'DB_HOST') | |
| ->isInteger('DB_PORT')->between(1, 65535) | |
| ->allowedValues('APP_ENV', ['local', 'staging', 'production']) | |
| ->assert(); | |
| // bootEnv() cascade: .env → .env.local → .env.{APP_ENV} | |
| $dotenv->bootEnv(); | |
| ``` | |
| ## Quality Metrics | |
| | Metric | Value | | |
| |--------|-------| | |
| | Tests | 205 passing | | |
| | Assertions | 396 | | |
| | PHPStan Level | 9 (0 errors) | | |
| | Psalm | 100% (0 errors) | | |
| | Coverage | 100% | | |
| | Dependencies | 0 (runtime) | | |
| See [CHANGELOG.md](CHANGELOG.md) for details. |