diff --git a/.github/workflows/automate_javadoc.yml b/.github/workflows/automate_javadoc.yml index 3ac03a52c..66babb61e 100644 --- a/.github/workflows/automate_javadoc.yml +++ b/.github/workflows/automate_javadoc.yml @@ -1,27 +1,29 @@ -# SPDX-FileCopyrightText: 2022 RTE FRANCE +# SPDX-FileCopyrightText: 2022 2023 RTE FRANCE # # SPDX-License-Identifier: Apache-2.0 name: Continuous Deployment - JavaDocs on: - push: - branches: - - 'feat/javadoc' + pull_request: + types: [ labeled, closed ] + jobs: build: + if: ${{ github.event.pull_request.base.ref == 'develop' && github.actor != 'dependabot[bot]' && (github.event.label.name == 'javadoc' || github.event.label.name == 'documentation') }} name: Java Docs runs-on: ubuntu-latest env: - from_branch: feat/javadoc - target_branch: feat/117_Documentation_SCD_Generation_Process + DEPLOYMENT_BRANCH: gh-pages + DEPENDABOT_BRANCH: dependabot/javadoc-${{ github.head_ref || github.ref_name }}-${{ github.event.pull_request.number }} steps: - # Use develop as base branch to generate javadoc - - name: Setup Environment + - name: Checkout uses: actions/checkout@v3 + + - name: Set up JDK 17 + uses: actions/setup-java@v3 with: distribution: 'zulu' java-version: '17' - ref: ${{ env.target_branch }} - name: Create custom Maven Settings.xml uses: whelk-io/maven-settings-xml-action@v21 @@ -33,6 +35,8 @@ jobs: run: | git config --global user.name '${{ secrets.CONFIG_CI_USER_NAME }}' git config --global user.email '${{ secrets.CONFIG_CI_USER_EMAIL }}' + git config pull.rebase false + git fetch origin ${{ env.DEPLOYMENT_BRANCH }} - name: Import GPG key id: import_gpg @@ -42,27 +46,38 @@ jobs: git_user_signingkey: true git_commit_gpgsign: true - - name: Prepare Pull Request branch + # Take note that your GitHub Pages site is currently being built from the /docs folder in the DEPLOYMENT_BRANCH branch. + - name: Prepare Pull Request branch & commit files run: | mvn -s custom_maven_settings.xml clean javadoc:aggregate -P javadoc mkdir -p docs/javadoc yes | cp -Rf target/site/apidocs/* docs/javadoc/ - git checkout -b ${{ env.from_branch }}-pull-request + git checkout -b temp + git add docs/javadoc/ + git commit -m "[dependabot/javadoc/temp]: update javadoc" + git checkout ${{ env.DEPLOYMENT_BRANCH }} + git clean -fdx + git checkout -b ${{ env.DEPENDABOT_BRANCH }} + git cherry-pick -n -X theirs temp + git commit -m "[dependabot/javadoc]: update javadoc" # Note that will fail if branch already exists. - name: Push Git Branch uses: ad-m/github-push-action@v0.6.0 with: github_token: ${{ secrets.GITHUB_TOKEN }} - branch: ${{ env.from_branch }}-pull-request + branch: ${{ env.DEPENDABOT_BRANCH }} # Note that will silently fail if PR already exists. - name: Create Pull Request uses: repo-sync/pull-request@v2 with: github_token: ${{ secrets.GITHUB_TOKEN }} - source_branch: ${{ env.from_branch }}-pull-request - destination_branch: ${{ env.target_branch }} + source_branch: ${{ env.DEPENDABOT_BRANCH }} + destination_branch: ${{ env.DEPLOYMENT_BRANCH }} pr_title: "Docs: Update Java docs repository" - pr_body: "Automatically created from CI workflow" - pr_label: "documentation,javadoc" \ No newline at end of file + pr_body: | + :customs: *Automatically created from CI workflow* + _Created by [repo-sync/pull-request](https://github.com/repo-sync/pull-request)_ + pr_label: "documentation,javadoc" + pr_assignee: ${{ github.actor }} \ No newline at end of file diff --git a/.github/workflows/automate_projects.yml b/.github/workflows/automate_projects.txt similarity index 100% rename from .github/workflows/automate_projects.yml rename to .github/workflows/automate_projects.txt diff --git a/.github/workflows/sonarcloud-analysis.yml b/.github/workflows/sonarcloud-analysis.txt similarity index 100% rename from .github/workflows/sonarcloud-analysis.yml rename to .github/workflows/sonarcloud-analysis.txt diff --git a/pom.xml b/pom.xml index a8de927d6..caaaded0e 100644 --- a/pom.xml +++ b/pom.xml @@ -218,7 +218,6 @@ ${javadoc.title} ${javadoc.lint} - --no-module-directories diff --git a/sct-app/src/main/java/org/lfenergy/compas/sct/app/package-info.java b/sct-app/src/main/java/org/lfenergy/compas/sct/app/package-info.java index c83b8e50c..fe9a2d02f 100644 --- a/sct-app/src/main/java/org/lfenergy/compas/sct/app/package-info.java +++ b/sct-app/src/main/java/org/lfenergy/compas/sct/app/package-info.java @@ -3,6 +3,6 @@ // SPDX-License-Identifier: Apache-2.0 /** - *

sct-app is a group of automation services

+ *

sct-app is a group of automation services

*/ package org.lfenergy.compas.sct.app; \ No newline at end of file diff --git a/sct-commons/src/main/java/org/lfenergy/compas/sct/commons/dto/package-info.java b/sct-commons/src/main/java/org/lfenergy/compas/sct/commons/dto/package-info.java index ee24e919f..9f762c71b 100644 --- a/sct-commons/src/main/java/org/lfenergy/compas/sct/commons/dto/package-info.java +++ b/sct-commons/src/main/java/org/lfenergy/compas/sct/commons/dto/package-info.java @@ -3,8 +3,8 @@ // SPDX-License-Identifier: Apache-2.0 /** - *

sct.commons.dto is a group of DTO utils for operating on + *

sct.commons.dto is a group of DTO utils for operating on * {@link org.lfenergy.compas.scl2007b4.model.SCL SCL} services - *

+ * */ package org.lfenergy.compas.sct.commons.dto; \ No newline at end of file diff --git a/sct-commons/src/main/java/org/lfenergy/compas/sct/commons/scl/com/package-info.java b/sct-commons/src/main/java/org/lfenergy/compas/sct/commons/scl/com/package-info.java index fbf637d8e..8b72f2343 100644 --- a/sct-commons/src/main/java/org/lfenergy/compas/sct/commons/scl/com/package-info.java +++ b/sct-commons/src/main/java/org/lfenergy/compas/sct/commons/scl/com/package-info.java @@ -3,9 +3,9 @@ // SPDX-License-Identifier: Apache-2.0 /** - *

scl.com is a group of services for operating on + *

scl.com is a group of services for operating on * {@link org.lfenergy.compas.scl2007b4.model.TCommunication Communication} object - *

+ * * @see org.lfenergy.compas.scl2007b4.model.TCommunication * @see org.lfenergy.compas.scl2007b4.model.TSubNetwork * @see org.lfenergy.compas.scl2007b4.model.TConnectedAP diff --git a/sct-commons/src/main/java/org/lfenergy/compas/sct/commons/scl/dtt/package-info.java b/sct-commons/src/main/java/org/lfenergy/compas/sct/commons/scl/dtt/package-info.java index 81afa71b1..020d29d34 100644 --- a/sct-commons/src/main/java/org/lfenergy/compas/sct/commons/scl/dtt/package-info.java +++ b/sct-commons/src/main/java/org/lfenergy/compas/sct/commons/scl/dtt/package-info.java @@ -3,9 +3,9 @@ // SPDX-License-Identifier: Apache-2.0 /** - *

scl.dtt is a group of services for operating on + *

scl.dtt is a group of services for operating on * {@link org.lfenergy.compas.scl2007b4.model.TDataTypeTemplates DataTypeTemplates} object - *

+ * * @see org.lfenergy.compas.scl2007b4.model.TLNodeType * @see org.lfenergy.compas.scl2007b4.model.TDOType * @see org.lfenergy.compas.scl2007b4.model.TDAType diff --git a/sct-commons/src/main/java/org/lfenergy/compas/sct/commons/scl/header/package-info.java b/sct-commons/src/main/java/org/lfenergy/compas/sct/commons/scl/header/package-info.java index 55eaf1e46..53782746e 100644 --- a/sct-commons/src/main/java/org/lfenergy/compas/sct/commons/scl/header/package-info.java +++ b/sct-commons/src/main/java/org/lfenergy/compas/sct/commons/scl/header/package-info.java @@ -3,9 +3,9 @@ // SPDX-License-Identifier: Apache-2.0 /** - *

scl.header is a group of services for operating on + *

scl.header is a group of services for operating on * {@link org.lfenergy.compas.scl2007b4.model.THeader Header} object - *

+ * * @see org.lfenergy.compas.scl2007b4.model.THeader * @see org.lfenergy.compas.scl2007b4.model.THitem * @see Issue !6 diff --git a/sct-commons/src/main/java/org/lfenergy/compas/sct/commons/scl/ied/package-info.java b/sct-commons/src/main/java/org/lfenergy/compas/sct/commons/scl/ied/package-info.java index 5d8086435..5bbacdaba 100644 --- a/sct-commons/src/main/java/org/lfenergy/compas/sct/commons/scl/ied/package-info.java +++ b/sct-commons/src/main/java/org/lfenergy/compas/sct/commons/scl/ied/package-info.java @@ -3,9 +3,9 @@ // SPDX-License-Identifier: Apache-2.0 /** - *

scl.ied is a group of services for operating on + *

scl.ied is a group of services for operating on * {@link org.lfenergy.compas.scl2007b4.model.TIED IED} object - *

+ * * @see org.lfenergy.compas.scl2007b4.model.TAccessPoint * @see org.lfenergy.compas.scl2007b4.model.TServices * @see org.lfenergy.compas.scl2007b4.model.TLDevice diff --git a/sct-commons/src/main/java/org/lfenergy/compas/sct/commons/scl/package-info.java b/sct-commons/src/main/java/org/lfenergy/compas/sct/commons/scl/package-info.java index 9385c8a5a..4529100aa 100644 --- a/sct-commons/src/main/java/org/lfenergy/compas/sct/commons/scl/package-info.java +++ b/sct-commons/src/main/java/org/lfenergy/compas/sct/commons/scl/package-info.java @@ -3,13 +3,13 @@ // SPDX-License-Identifier: Apache-2.0 /** - *

commons.scl is a group of services for operating on + *

commons.scl is a group of services for operating on * {@link org.lfenergy.compas.scl2007b4.model.THeader Header} , * {@link org.lfenergy.compas.scl2007b4.model.TSubstation Substation} , * {@link org.lfenergy.compas.scl2007b4.model.TCommunication Communication} , * {@link org.lfenergy.compas.scl2007b4.model.TIED IED} , * {@link org.lfenergy.compas.scl2007b4.model.TDataTypeTemplates DataTypeTemplates} objects - *

+ * * @see org.lfenergy.compas.scl2007b4.model.SCL */ package org.lfenergy.compas.sct.commons.scl; \ No newline at end of file diff --git a/sct-commons/src/main/java/org/lfenergy/compas/sct/commons/scl/sstation/package-info.java b/sct-commons/src/main/java/org/lfenergy/compas/sct/commons/scl/sstation/package-info.java index 2f3987594..45b2f2e0d 100644 --- a/sct-commons/src/main/java/org/lfenergy/compas/sct/commons/scl/sstation/package-info.java +++ b/sct-commons/src/main/java/org/lfenergy/compas/sct/commons/scl/sstation/package-info.java @@ -2,9 +2,9 @@ // // SPDX-License-Identifier: Apache-2.0 /** - *

scl.sstation is a group of services for operating on + *

scl.sstation is a group of services for operating on * {@link org.lfenergy.compas.scl2007b4.model.TSubstation Substation} object - *

+ * * @see org.lfenergy.compas.scl2007b4.model.TVoltageLevel * @see org.lfenergy.compas.scl2007b4.model.TFunction * @see org.lfenergy.compas.scl2007b4.model.TBay