-
Notifications
You must be signed in to change notification settings - Fork 0
110 lines (86 loc) · 3.46 KB
/
release.yml
File metadata and controls
110 lines (86 loc) · 3.46 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
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.