Skip to content

IBX-9904: Workflow to build API refs into new PR #2723

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 28 commits into from
May 13, 2025
Merged
Changes from all commits
Commits
Show all changes
28 commits
Select commit Hold shift + click to select a range
efc2c1a
Draft workflow to open API refs PR
adriendupuis Apr 30, 2025
a41b6da
api_refs.yaml: checkout the right branch before forking a new one.
adriendupuis May 6, 2025
530cb71
api_refs.yaml: dummy triggers to register workflow
adriendupuis May 7, 2025
351dd86
Revert "api_refs.yaml: dummy triggers to register workflow"
adriendupuis May 7, 2025
d35164c
api_refs.yaml: Fix base_branch parsing
adriendupuis May 7, 2025
8608526
api_refs.yaml: Fix new branch creation
adriendupuis May 7, 2025
3583718
api_refs.yaml: Set a Git user
adriendupuis May 7, 2025
2877a5f
api_refs.yaml: Fix branch push
adriendupuis May 7, 2025
212c761
api_refs.yaml: Fix branch push
adriendupuis May 7, 2025
07dbfe0
api_refs.yaml: Fix branch push and PR create
adriendupuis May 7, 2025
966229f
api_refs.yaml: Fix branch push and PR create
adriendupuis May 7, 2025
339e28b
api_refs.yaml: Composer authentication
adriendupuis May 7, 2025
a5ebbf9
api_refs.yaml: Composer authentication
adriendupuis May 7, 2025
a05d429
api_refs.yaml: Enh. PHP performance
adriendupuis May 7, 2025
042e1b5
api_refs.yaml: Prepare PR state and labels
adriendupuis May 7, 2025
2338db6
api_refs.yaml: Try to debug the \E issue
adriendupuis May 12, 2025
4ad53d2
api_refs.yaml: Try to debug the \E issue
adriendupuis May 12, 2025
de4a959
api_refs.yaml: Try to debug the \E issue
adriendupuis May 12, 2025
0f262ab
api_refs.yaml: Try to debug the \E issue
adriendupuis May 12, 2025
312b68c
api_refs.yaml: Try to fix the \E issue
adriendupuis May 12, 2025
16fd5be
api_refs.yaml: Try to fix the \E issue
adriendupuis May 12, 2025
dd4d8b9
Revert "api_refs.yaml: Try to fix the \E issue"
adriendupuis May 12, 2025
d4611c3
api_refs.yaml: Try to fix the \E issue
adriendupuis May 12, 2025
6595e79
api_refs.yaml: Clean-up after debug
adriendupuis May 12, 2025
bfb1f44
api_refs.yaml: Try to trigger PR workflows
adriendupuis May 12, 2025
7dc8794
api_refs.yaml: Try to trigger PR workflows
adriendupuis May 12, 2025
946d0e3
api_refs.yaml: Try to trigger PR workflows
adriendupuis May 13, 2025
dabdfa9
api_refs.yaml: Set prod conf back
adriendupuis May 13, 2025
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
66 changes: 66 additions & 0 deletions .github/workflows/api_refs.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
name: 'Build API Refs'

on:
workflow_dispatch:
inputs:
version:
description: 'Released version'
required: true
type: string

jobs:
open_php_api_ref_pr:
name: "PHP & REST API References' PR"
runs-on: ubuntu-latest

steps:
- name: Set version and branches
id: version_and_branches
run: |
version="${{ inputs.version }}"
base_branch="$(echo $version | sed 's/v\(.*\..*\)\..*/\1/')"
work_branch="api_refs_$version"
echo "version=$version" >> "$GITHUB_OUTPUT"
echo "base_branch=$base_branch" >> "$GITHUB_OUTPUT"
echo "work_branch=$work_branch" >> "$GITHUB_OUTPUT"

- name: Checkout documentation
uses: actions/checkout@v4
with:
ref: ${{ steps.version_and_branches.outputs.base_branch }}

- name: Disable PHP coverage
uses: shivammathur/setup-php@v2
with:
coverage: none

- name: Build API Refs
env:
SATIS_NETWORK_KEY: ${{ secrets.SATIS_NETWORK_KEY }}
SATIS_NETWORK_TOKEN: ${{ secrets.SATIS_NETWORK_TOKEN }}
run: |
composer config --global http-basic.updates.ibexa.co $SATIS_NETWORK_KEY $SATIS_NETWORK_TOKEN
#TODO: On 5.0, update tool to handle both PHP & REST APIs
tools/php_api_ref/phpdoc.sh
# Fix escape character:
perl -pi -e 's/\e/\\E/g' tools/php_api_ref/.phpdoc/template/package-edition-map.twig

- name: Commit
run: |
git config --global user.name "${GITHUB_ACTOR}"
git config --global user.email "${GITHUB_ACTOR}@users.noreply.github.com"
git add docs/api/php_api/php_api_reference/ tools/php_api_ref/.phpdoc/template/package-edition-map.twig
git commit -m "PHP API Ref HTML"
#TODO: git add doc/api/rest_api/rest_api_reference/rest_api_reference.html
#TODO: git commit -m "REST API Ref HTML"

- name: Create Pull Request
uses: peter-evans/create-pull-request@v7
with:
token: ${{ secrets.EZROBOT_PAT }}
title: "PHP API Ref ${{ steps.version_and_branches.outputs.version }}"
body: "PHP API Reference update for ${{ steps.version_and_branches.outputs.version }}"
branch: "${{ steps.version_and_branches.outputs.work_branch }}"
base: "${{ steps.version_and_branches.outputs.base_branch }}"
draft: false
labels: 'Needs DOC review'
Loading