You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
if git ls-remote --exit-code --heads origin "${{ steps.version_and_branches.outputs.work_branch }}"; then
89
+
echo "::error title=Branch exists::The branch ${{ steps.version_and_branches.outputs.work_branch }} already exists. You can use the 'force' option to overwrite it."
`tools/api_refs/api_refs.sh` is a script generating PHP API Reference, by default, under `docs/api/php_api/php_api_reference/`.
11
+
`tools/api_refs/api_refs.sh` is a script generating PHP & REST API References, by default, under `docs/api/php_api/php_api_reference/` and `docs/api/rest_api/rest_api_reference/`.
10
12
11
-
- For Composer, if you do not use a global authentication to retrieve _Commerce_ edition, a path to an auth.json file can be given as first argument. For example:
13
+
- For Composer, if you do not use a global authentication to retrieve _Commerce_ edition, a path to an auth.json file can be given as first optional argument. For example:
- The second argument can be a path to an output directory to use instead of the default one. For example, using the Composer global authentication file as first argument and the path to directory (which is created if it doesn't exist yet):
17
+
- The second optional argument can be a path to an output directory to use instead of the default one. For example, using the Composer global authentication file as first argument and the path to directory (which is created if it doesn't exist yet):
`-f version=<tag>` to pass the Ibexa DXP version tag for which the API References are built.
139
+
`-f use_dev_version=<false|true>` to use the released version designed by the tag, or to use the development version (`v5.0.x-dev`) for an incoming tag.
140
+
`--ref <branch>` to use the `api_refs.yaml` workflow from a given branch instead of the default branch (`5.0`).
141
+
`-f base_branch=<branch>` to use the `api_refs.sh` from a given branch and make a PR to that branch.
142
+
`-f work_branch=<branch>` to use a given target branch to commit the build and make a PR from that branch.
143
+
`-f force=<false|true>` to force the commit on the target branch even if it already exists.
144
+
145
+
Examples:
146
+
147
+
Build from the dev branch `5.0.x-dev` API references for `v5.0.999`:
148
+
149
+
```bash
150
+
gh workflow run api_refs.yaml -f version=v5.0.999 -f use_dev_version=true
151
+
```
152
+
153
+
Rebuild references for the released version `v5.0.10` from `my-tools`'s `api_refs.yaml` with `my-tools`'s tools and commit the result into `my-api-refs` even if it already exists:
On the GitHub repository page, go to the "Actions" tab and, in the workflow list, select ["Build API Refs"](https://github.com/ibexa/documentation-developer/actions/workflows/api_refs.yaml).
162
+
On top right of the past workflow table, unfold "Run workflow" menu, set the fields, then click "Run workflow" button.
Copy file name to clipboardExpand all lines: tools/api_refs/api_refs.sh
+23-17Lines changed: 23 additions & 17 deletions
Original file line number
Diff line number
Diff line change
@@ -1,8 +1,8 @@
1
1
#!/usr/bin/env bash
2
2
3
-
set-x;
3
+
set+x;
4
4
5
-
AUTH_JSON=${1:-~/.composer/auth.json};# Path to an auth.json file allowing to install the targeted edition and version
5
+
AUTH_JSON=$(realpath ${1:-~/.composer/auth.json});# Path to an auth.json file allowing to install the targeted edition and version
6
6
PHP_API_OUTPUT_DIR=${2:-./docs/api/php_api/php_api_reference};# Path to the directory where the built PHP API Reference is hosted
7
7
REST_API_OUTPUT_FILE=${3:-./docs/api/rest_api/rest_api_reference/rest_api_reference.html};# Path to the REST API Reference file
8
8
REST_API_OPENAPI_FILE_YAML=${4:-./docs/api/rest_api/rest_api_reference/openapi.yaml};# Path to the REST API OpenAPI spec file
@@ -24,6 +24,7 @@ REDOCLY_TEMPLATE="$(pwd)/tools/api_refs/redocly.hbs"; # Absolute path to Redocly
24
24
OPENAPI_FIX="$(pwd)/tools/api_refs/openapi.php";# A script editing and fixing few things on the dumped schema (should be temporary and fixes reported to source)
25
25
26
26
PHP_BINARY="php -d error_reporting=`php -r 'echo E_ALL & ~E_DEPRECATED;'`";# Avoid depreciation messages from phpDocumentor/Reflection/issues/529 when using PHP 8.2 or higher
27
+
COMPOSER_BINARY='composer';
27
28
TMP_DXP_DIR=/tmp/ibexa-dxp-phpdoc;# Absolute path of the temporary directory in which Ibexa DXP will be installed and the PHP API Reference built
28
29
FORCE_DXP_INSTALL=1;# If 1, empty the temporary directory, install DXP from scratch, build, remove temporary directory; if 0, potentially reuse the DXP already installed in temporary directory, keep temporary directory for future uses.
29
30
BASE_DXP_BRANCH="${BASE_DXP_BRANCH:-}";# Branch from and for which the Reference is built when using a dev branch as version; can be overridden by the BASE_DXP_BRANCH env var
@@ -61,42 +62,47 @@ fi;
61
62
cd$TMP_DXP_DIR;# /!\ Change working directory (reason why all paths must be absolute)
0 commit comments