diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 42844bc8..ef60e759 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -18,7 +18,6 @@ on: - 'CODEOWNERS' - 'LICENSE' - '*.md' - - '*.adoc' - '*.txt' - '.all-contributorsrc' @@ -49,6 +48,17 @@ jobs: - name: Build with Maven run: mvn '-Dorg.slf4j.simpleLogger.log.org.openapitools=off' -B formatter:validate impsort:check verify --file pom.xml + - name: Store PR id + run: | + echo ${{ github.event.number }} > ./docs/target/generated-docs/pr-id.txt + + - name: Publishing directory for PR preview + uses: actions/upload-artifact@v3 + with: + name: site + path: ./docs/target/generated-docs + retention-days: 3 + build_reactive: name: Build - RESTEasy Reactive runs-on: ${{ matrix.os }} @@ -73,4 +83,15 @@ jobs: cache: 'maven' - name: Build with Maven - run: mvn -Presteasy-reactive '-Dorg.slf4j.simpleLogger.log.org.openapitools=off' -B formatter:validate impsort:check verify --file pom.xml \ No newline at end of file + run: mvn -Presteasy-reactive '-Dorg.slf4j.simpleLogger.log.org.openapitools=off' -B formatter:validate impsort:check verify --file pom.xml + + - name: Store PR id + run: | + echo ${{ github.event.number }} > ./docs/target/generated-docs/pr-id.txt + + - name: Publishing directory for PR preview + uses: actions/upload-artifact@v3 + with: + name: site + path: ./docs/target/generated-docs + retention-days: 3 \ No newline at end of file diff --git a/.github/workflows/preview.yml b/.github/workflows/preview.yml new file mode 100644 index 00000000..b733ed81 --- /dev/null +++ b/.github/workflows/preview.yml @@ -0,0 +1,48 @@ +name: Surge.sh Preview + +on: + workflow_run: + workflows: ["Build"] + types: + - completed + +jobs: + preview: + runs-on: ubuntu-latest + if: github.event.workflow_run.event == 'pull_request' && github.event.workflow_run.conclusion == 'success' + steps: + - name: Download PR Artifact + uses: dawidd6/action-download-artifact@v2 + with: + workflow: ${{ github.event.workflow_run.workflow_id }} + workflow_conclusion: success + name: site + - name: Store PR id as variable + id: pr + run: | + echo "id=$(> $GITHUB_OUTPUT + rm -f pr-id.txt + - name: Publishing to surge for preview + id: deploy + run: npx surge ./ --domain https://quarkus-openapi-generator-preview-pr-${{ steps.pr.outputs.id }}.surge.sh --token ${{ secrets.SURGE_TOKEN }} + - name: Update PR status comment on success + uses: actions-cool/maintain-one-comment@v3.1.1 + with: + token: ${{ secrets.GITHUB_TOKEN }} + body: | + 🎊 PR Preview ${{ github.sha }} has been successfully built and deployed to https://quarkus-openapi-generator-preview-pr-${{ steps.pr.outputs.id }}.surge.sh + + + body-include: '' + number: ${{ steps.pr.outputs.id }} + - name: Update PR status comment on failure + if: ${{ failure() }} + uses: actions-cool/maintain-one-comment@v3.1.1 + with: + token: ${{ secrets.GITHUB_TOKEN }} + body: | + 😭 Deploy PR Preview failed. + + + body-include: '' + number: ${{ steps.pr.outputs.id }} \ No newline at end of file diff --git a/.github/workflows/preview_teardown.yml b/.github/workflows/preview_teardown.yml new file mode 100644 index 00000000..8fb0bd9b --- /dev/null +++ b/.github/workflows/preview_teardown.yml @@ -0,0 +1,24 @@ +name: Surge.sh Preview Teardown + +on: + pull_request_target: + paths: + - '*.adoc' + types: [closed] + +jobs: + preview-teardown: + runs-on: ubuntu-latest + steps: + - name: Teardown surge preview + id: deploy + run: npx surge teardown https://quarkus-openapi-generator-preview-pr-${{ github.event.number }}.surge.sh --token ${{ secrets.SURGE_TOKEN }} + - name: Update PR status comment + uses: actions-cool/maintain-one-comment@v3.1.1 + with: + token: ${{ secrets.GITHUB_TOKEN }} + body: | + 🙈 The PR is closed and the preview is expired. + + body-include: '' + number: ${{ github.event.number }} \ No newline at end of file diff --git a/README.md b/README.md index 75af7618..bf2b77a0 100644 --- a/README.md +++ b/README.md @@ -834,7 +834,7 @@ public interface DefaultApi { /* omitted */ } ## Additional Properties as Attribute -If you want to map your models using composition instead inheretance for a better experience with Jackson, see the [Additional properties as attribute](./docs/modules/ROOT/pages/additional-properties-as-attribute.adoc) documentation. +If you want to map your models using composition instead inheretance for a better experience with Jackson, see the [Additional properties as attribute](./docs/modules/ROOT/pages/includes/additional-properties-as-attribute.adoc) documentation. ## Template Customization diff --git a/docs/modules/ROOT/pages/additional-properties-as-attribute.adoc b/docs/modules/ROOT/pages/includes/additional-properties-as-attribute.adoc similarity index 100% rename from docs/modules/ROOT/pages/additional-properties-as-attribute.adoc rename to docs/modules/ROOT/pages/includes/additional-properties-as-attribute.adoc diff --git a/docs/modules/ROOT/pages/config.adoc b/docs/modules/ROOT/pages/includes/config.adoc similarity index 96% rename from docs/modules/ROOT/pages/config.adoc rename to docs/modules/ROOT/pages/includes/config.adoc index df243b25..41bf795c 100644 --- a/docs/modules/ROOT/pages/config.adoc +++ b/docs/modules/ROOT/pages/includes/config.adoc @@ -108,7 +108,7 @@ a|icon:lock[title=Fixed at build time] [[quarkus-freemarker_quarkus.freemarker.d List of directives to register with format name=classname --|`Map` | -a| [[quarkus-freemarker_quarkus.freemarker.object-wrapper-expose-fields]]`link:#quarkus-freemarker_quarkus.freemarker.object-wrapper-expose-fields[quarkus.freemarker.object-wrapper-expose-fields]` +a| [[quarkus-freemarker_quarkus.freemarker.object-wrapper-expose-fields1]]`link:#quarkus-freemarker_quarkus.freemarker.object-wrapper-expose-fields[quarkus.freemarker.object-wrapper-expose-fields]` [.description] -- diff --git a/docs/modules/ROOT/pages/index.adoc b/docs/modules/ROOT/pages/index.adoc index 421ed290..d16ea1c5 100644 --- a/docs/modules/ROOT/pages/index.adoc +++ b/docs/modules/ROOT/pages/index.adoc @@ -19,4 +19,4 @@ In your `pom.xml` file, add: [[extension-configuration-reference]] == Extension Configuration Reference -include::config.adoc[leveloffset=+1, opts=optional] +include::./includes/config.adoc[] diff --git a/docs/pom.xml b/docs/pom.xml new file mode 100644 index 00000000..d19ea1a9 --- /dev/null +++ b/docs/pom.xml @@ -0,0 +1,71 @@ + + + 4.0.0 + + + io.quarkiverse.openapi.generator + quarkus-openapi-generator-parent + 3.0.0-SNAPSHOT + ../pom.xml + + quarkus-openapi-generator-docs + Quarkus - Openapi Generator - Documentation + + + + + io.quarkiverse.openapi.generator + quarkus-openapi-generator-deployment + ${project.version} + + + + + + + it.ozimov + yaml-properties-maven-plugin + + + initialize + + read-project-properties + + + + ${project.basedir}/../.github/project.yml + + + + + + + maven-resources-plugin + + + copy-resources + generate-resources + + copy-resources + + + ${project.basedir}/modules/ROOT/pages/includes/ + + + ${project.basedir}/../target/asciidoc/generated/config/ + quarkus-openapi-generator.adoc + false + + + + + + + + org.asciidoctor + asciidoctor-maven-plugin + + + + + diff --git a/pom.xml b/pom.xml index 164b9f12..86a9bfac 100644 --- a/pom.xml +++ b/pom.xml @@ -15,6 +15,7 @@ deployment runtime test-utils + docs :git:git@github.com:quarkiverse/quarkus-openapi-generator.git