Skip to content
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

docs: run autodoc and upload resulting md to docusaurus #808

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
4 changes: 2 additions & 2 deletions .github/actions/setup-java/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,8 @@ runs:
using: "composite"
steps:
- name: Setup JDK 17
uses: actions/setup-java@v3.11.0
uses: actions/setup-java@v3.13.0
with:
java-version: '17'
distribution: 'temurin'
cache: 'gradle'
cache: 'gradle'
8 changes: 8 additions & 0 deletions .github/workflows/publish-docusaurus.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,8 @@ jobs:
steps:
- uses: actions/checkout@v4

- uses: ./.github/actions/setup-java

- name: "Extract version"
id: extract_version
run: |
Expand All @@ -55,6 +57,12 @@ jobs:
echo "DOWNSTREAM_VERSION=${{ inputs.downstream-version }}" >> "$GITHUB_OUTPUT"
fi

- name: "Run autodoc"
run: |
./gradlew autodoc
./gradlew mergeManifests
./gradlew doc2md

- name: "Gather documentation files"
run: |
chmod +x ./resources/create_kit_documentation.sh
Expand Down
9 changes: 2 additions & 7 deletions .github/workflows/publish-swaggerhub.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -51,12 +51,7 @@ jobs:
steps:
- uses: actions/checkout@v4

- name: Setup JDK 17
uses: actions/[email protected]
with:
java-version: '17'
distribution: 'temurin'
cache: 'gradle'
- uses: ./.github/actions/setup-java

- name: Setup node
uses: actions/setup-node@v3
Expand Down Expand Up @@ -110,4 +105,4 @@ jobs:
else
echo "snapshot, will set the API to 'unpublished'";
swaggerhub api:update ${{ env.SWAGGERHUB_USER }}/tractusx-edc/${{ env.DOWNSTREAM_VERSION }} -f ./resources/openapi/yaml/tractusx-edc-api.yaml --visibility=public --published=unpublish
fi
fi
2 changes: 1 addition & 1 deletion DEPENDENCIES
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
maven/mavencentral/com.apicatalog/carbon-did/0.0.2, Apache-2.0, approved, #9239

Check warning on line 1 in DEPENDENCIES

View workflow job for this annotation

GitHub Actions / verify / verify-dependencies / Dash-Verify-Licenses

Restricted Dependencies found

Some dependencies are marked 'restricted' - please review them
maven/mavencentral/com.apicatalog/iron-verifiable-credentials/0.8.1, Apache-2.0, approved, #9234
maven/mavencentral/com.apicatalog/titanium-json-ld/1.0.0, Apache-2.0, approved, clearlydefined
maven/mavencentral/com.apicatalog/titanium-json-ld/1.3.1, Apache-2.0, approved, #8912
Expand Down Expand Up @@ -406,7 +406,7 @@
maven/mavencentral/org.testcontainers/junit-jupiter/1.19.0, MIT, approved, #10344
maven/mavencentral/org.testcontainers/postgresql/1.19.0, MIT, approved, #10350
maven/mavencentral/org.testcontainers/testcontainers/1.19.0, Apache-2.0 AND MIT, approved, #10347
maven/mavencentral/org.testcontainers/vault/1.19.0, MIT, approved, clearlydefined
maven/mavencentral/org.testcontainers/vault/1.19.0, None, restricted, #10852
maven/mavencentral/org.yaml/snakeyaml/2.0, Apache-2.0 AND (Apache-2.0 OR BSD-3-Clause OR EPL-1.0 OR GPL-2.0-or-later OR LGPL-2.1-or-later), approved, #7275
maven/mavencentral/org.yaml/snakeyaml/2.2, Apache-2.0 AND (Apache-2.0 OR BSD-3-Clause OR EPL-1.0 OR GPL-2.0-or-later OR LGPL-2.1-or-later), approved, #10232
maven/mavencentral/software.amazon.awssdk/annotations/2.20.146, Apache-2.0, approved, #8598
Expand Down
87 changes: 46 additions & 41 deletions resources/create_kit_documentation.sh
Original file line number Diff line number Diff line change
Expand Up @@ -8,46 +8,51 @@ echo $1 $2 $3

cd ${repo_root}

mkdir -p ${output_dir}/tractusx-edc/Connector\ Kit/
rsync -a --prune-empty-dirs --exclude 'build' --include '*' ./docs/kit/* ${output_dir}/tractusx-edc/Connector\ Kit/

mkdir -p ${output_dir}/tractusx-edc/Connector\ Kit/Operation\ View/03_deployment_via_helm
cp ./docs/samples/example-dataspace/README.md ${output_dir}/tractusx-edc/Connector\ Kit/Operation\ View/03_deployment_via_helm/00_example_dataspace.md
cp ./docs/samples/edr-api-overview/edr-api-overview.md ${output_dir}/tractusx-edc/Connector\ Kit/Operation\ View/03_deployment_via_helm/01_edr_api_overview.md

mkdir -p ${output_dir}/tractusx-edc/Connector\ Kit/Operation\ View/04_Test\ Your\ Setup
cp ./docs/development/postman/README.md ${output_dir}/tractusx-edc/Connector\ Kit/Operation\ View/04_Test\ Your\ Setup/00_postman.md
cp ./docs/samples/Transfer\ Data.md ${output_dir}/tractusx-edc/Connector\ Kit/Operation\ View/04_Test\ Your\ Setup/02_transfer_data.md
cp -r ./docs/samples/diagrams ${output_dir}/tractusx-edc/Connector\ Kit/Operation\ View/04_Test\ Your\ Setup/

mkdir -p ${output_dir}/tractusx-edc/Connector\ Kit/Operation\ View/05_Migration
cp ./docs/migration/* ${output_dir}/tractusx-edc/Connector\ Kit/Operation\ View/05_Migration/

mkdir -p ${output_dir}/tractusx-edc/Connector\ Kit/Development\ View
cp ./docs/README.md ${output_dir}/tractusx-edc/Connector\ Kit/Development\ View/00_tractusx_edc.md
cp ./core/edr-core/README.md ${output_dir}/tractusx-edc/Connector\ Kit/Development\ View/06_edr_core.md
cp ./docs/development/Release.md ${output_dir}/tractusx-edc/Connector\ Kit/Development\ View/07_release.md

mkdir -p ${output_dir}/tractusx-edc/Connector\ Kit/Development\ View/03_EDC\ Controlplane
rsync -a --prune-empty-dirs --include '*/' --exclude 'build' --include '*.md' --include '*.png' --include '*.puml' --exclude '*' ./edc-controlplane/* ${output_dir}/tractusx-edc/Connector\ Kit/Development\ View/03_EDC\ Controlplane

mkdir -p ${output_dir}/tractusx-edc/Connector\ Kit/Development\ View/04_EDC\ Dataplane
rsync -a --prune-empty-dirs --include '*/' --exclude 'build' --include '*.md' --include '*.png' --include '*.puml' --exclude '*' ./edc-dataplane/* ${output_dir}/tractusx-edc/Connector\ Kit/Development\ View/04_EDC\ Dataplane

mkdir -p ${output_dir}/tractusx-edc/Connector\ Kit/Development\ View/05_EDC\ Extensions
rsync -a --prune-empty-dirs --include '*/' --exclude 'build' --include '*.md' --include '*.png' --include '*.puml' --exclude '*' ./edc-extensions/* ${output_dir}/tractusx-edc/Connector\ Kit/Development\ View/05_EDC\ Extensions

mkdir -p ${output_dir}/tractusx-edc/Connector\ Kit/Documentation
cp ./docs/development/coding-principles.md ${output_dir}/tractusx-edc/Connector\ Kit/Documentation/02_coding_principles.md
cp ./pr_etiquette.md ${output_dir}/tractusx-edc/Connector\ Kit/Documentation/03_pr_etiquette.md
cp ./styleguide.md ${output_dir}/tractusx-edc/Connector\ Kit/Documentation/04_styleguide.md
mkdir -p ${output_dir}/tractusx-edc/Connector\ Kit/Documentation/resources
cp ./resources/tx-checkstyle-config.xml ${output_dir}/tractusx-edc/Connector\ Kit/Documentation/resources
cp ./SECURITY.md ${output_dir}/tractusx-edc/Connector\ Kit/Documentation/05_security.md
mkdir -p ${output_dir}/tractusx-edc/Connector\ Kit/Documentation/resources
cp ./resources/save_actions_scr.png ${output_dir}/tractusx-edc/Connector\ Kit/Documentation/resources/

curl https://api.swaggerhub.com/apis/tractusx-edc/${release_version}/swagger.yaml > ${output_dir}/tractusx-edc/tractusx-edc-${release_version}.yaml
connector_kit="${output_dir}/tractusx-edc/Connector Kit"
mkdir -p "${connector_kit}"
rsync -a --prune-empty-dirs --exclude 'build' --include '*' ./docs/kit/* "${connector_kit}/"

operation_view="${connector_kit}/Operation View"
mkdir -p "${operation_view}/03_deployment_via_helm"
cp ./docs/samples/example-dataspace/README.md "${operation_view}/03_deployment_via_helm/00_example_dataspace.md"
cp ./docs/samples/edr-api-overview/edr-api-overview.md "${operation_view}/03_deployment_via_helm/01_edr_api_overview.md"

mkdir -p "${operation_view}/04_Test Your Setup"
cp ./docs/development/postman/README.md "${operation_view}/04_Test Your Setup/00_postman.md"
cp ./docs/samples/Transfer\ Data.md "${operation_view}/04_Test Your Setup/02_transfer_data.md"
cp -r ./docs/samples/diagrams "${operation_view}/04_Test Your Setup/"

mkdir -p "${operation_view}/05_Migration"
cp ./docs/migration/* "${operation_view}/05_Migration/"

development_view="${connector_kit}/Development View"
mkdir -p "${development_view}"
cp ./docs/README.md "${development_view}/00_tractusx_edc.md"
cp ./core/edr-core/README.md "${development_view}/06_edr_core.md"
cp ./docs/development/Release.md "${development_view}/07_release.md"

mkdir -p "${development_view}/03_EDC Controlplane"
rsync -a --prune-empty-dirs --include '*/' --exclude 'build' --include '*.md' --include '*.png' --include '*.puml' --exclude '*' ./edc-controlplane/* "${development_view}/03_EDC Controlplane"

mkdir -p "${development_view}/04_EDC Dataplane"
rsync -a --prune-empty-dirs --include '*/' --exclude 'build' --include '*.md' --include '*.png' --include '*.puml' --exclude '*' ./edc-dataplane/* "${development_view}/04_EDC Dataplane"

mkdir -p "${development_view}/05_EDC Extensions"
rsync -a --prune-empty-dirs --include '*/' --exclude 'build' --include '*.md' --include '*.png' --include '*.puml' --exclude '*' ./edc-extensions/* "${development_view}/05_EDC Extensions"
cp ./build/tractusx-edc.md "${development_view}/05_EDC Extensions/01_autodoc_manifest.md"

documentation="${output_dir}/tractusx-edc/Connector Kit/Documentation"
mkdir -p "${documentation}"
cp ./docs/development/coding-principles.md "${documentation}/02_coding_principles.md"
cp ./pr_etiquette.md "${documentation}/03_pr_etiquette.md"
cp ./styleguide.md "${documentation}/04_styleguide.md"
mkdir -p "${documentation}/resources"
cp ./resources/tx-checkstyle-config.xml "${documentation}/resources"
cp ./SECURITY.md "${documentation}/05_security.md"
mkdir -p "${documentation}/resources"
cp ./resources/save_actions_scr.png "${documentation}/resources/"

curl "https://api.swaggerhub.com/apis/tractusx-edc/${release_version}/swagger.yaml" > "${output_dir}/tractusx-edc/tractusx-edc-${release_version}.yaml"

cd ${output_dir}/tractusx-edc
zip -r ../tractusx-edc-docusaurus-${release_version}.zip ./*
zip -r ../tractusx-edc-docusaurus-${release_version}.zip ./*