Skip to content

Commit 6614dbd

Browse files
committed
fix: switch broken apigen workflow to phpDocumentor
The varunsridharan/action-apigen action pulled in apigen 4.1.2, whose transitive dependency herrera-io/json points at a GitHub source repo that no longer exists, breaking installs. Replace with phpDocumentor via phpdocumentor/shim (no PHP version constraints), expose a "composer docs" script for local previews, and rewrite the workflow to build and publish to gh-pages on successful test runs.
1 parent abe3a00 commit 6614dbd

4 files changed

Lines changed: 34 additions & 11 deletions

File tree

.github/workflows/apigen.yml

Lines changed: 23 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -10,11 +10,28 @@ on:
1010
jobs:
1111
Document_Generator:
1212
runs-on: ubuntu-latest
13+
if: ${{ github.event.workflow_run.conclusion == 'success' }}
1314
steps:
14-
- uses: actions/checkout@v2
15-
- name: 📝 ApiGen PHP Document Generator
16-
uses: varunsridharan/action-apigen@2.1
15+
- name: Checkout
16+
uses: actions/checkout@v4
17+
18+
- name: Setup PHP
19+
uses: shivammathur/setup-php@v2
20+
with:
21+
php-version: '8.4'
22+
23+
- name: Install dependencies
24+
run: composer install --no-interaction --no-progress
25+
26+
- name: Generate API docs
27+
run: composer docs
28+
29+
- name: Deploy to GitHub Pages
30+
uses: peaceiris/actions-gh-pages@v4
1731
with:
18-
cached_apigen: 'no'
19-
env:
20-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
32+
github_token: ${{ secrets.GITHUB_TOKEN }}
33+
publish_dir: ./docs
34+
publish_branch: gh-pages
35+
user_name: 'github-actions[bot]'
36+
user_email: 'github-actions[bot]@users.noreply.github.com'
37+
commit_message: 'Docs updated by GitHub Actions'

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,4 +5,5 @@ vendor/
55
composer.lock
66
apigen.phar
77
docs/
8+
.phpdoc/
89
.phpunit.result.cache

apigen.neon

Lines changed: 0 additions & 4 deletions
This file was deleted.

composer.json

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,11 +24,20 @@
2424
"psr/log": "Allows you to make the CLI available as PSR-3 logger"
2525
},
2626
"require-dev": {
27-
"phpunit/phpunit": "^8"
27+
"phpunit/phpunit": "^8",
28+
"phpdocumentor/shim": "^3"
2829
},
2930
"autoload": {
3031
"psr-4": {
3132
"splitbrain\\phpcli\\": "src"
3233
}
34+
},
35+
"scripts": {
36+
"docs": "phpdoc -d src -t docs --no-interaction"
37+
},
38+
"config": {
39+
"allow-plugins": {
40+
"phpdocumentor/shim": true
41+
}
3342
}
3443
}

0 commit comments

Comments
 (0)