diff --git a/.github/workflows/reduce_readme.yml b/.github/workflows/reduce_readme.yml new file mode 100644 index 0000000000..0f609ac3f5 --- /dev/null +++ b/.github/workflows/reduce_readme.yml @@ -0,0 +1,45 @@ +name: WildFly Quickstarts Reduce READMEs + +on: + push: + branches: + - main + +# Only run the latest job +concurrency: + group: '${{ github.workflow }} @ ${{ github.ref || github.run_id }}' + cancel-in-progress: true + +jobs: + build: + runs-on: ubuntu-latest + steps: + - name: Checkout Repository + uses: actions/checkout@v3 + - name: Install Asciidoctor Reducer + run: sudo gem install asciidoctor-reducer + - name: Reduce README + run: | + CURRENT_DIR="$( pwd -P)" + #Get a list of subdirectories that don't start with a . + subdirs=`find . -maxdepth 1 -type d ! -iname ".*"` + #Loop over the subdirectories + for subdir in $subdirs + do + cd $subdir + #Check if the directory contains README-source.adoc + if [ -e README-source.adoc ] + then + #Get the dirname to define artifactId in the adoc + ARTIFACT_ID=":artifactId: $(basename `pwd`)" + #Use asciidoctor-reducer to create a flattened README.adoc + asciidoctor-reducer --preserve-conditionals -o README.adoc README-source.adoc + #Insert the directory name with env-github def so that this only affects GitHub rendering + sed -i "1s/^/ifdef::env-github[]\n$ARTIFACT_ID\nendif::[]\n\n/" README.adoc + fi + cd $CURRENT_DIR + done + - name: Commit and Push README + uses: EndBug/add-and-commit@v9 + with: + add: '*.adoc' diff --git a/batch-processing/README.adoc b/batch-processing/README-source.adoc similarity index 100% rename from batch-processing/README.adoc rename to batch-processing/README-source.adoc diff --git a/bmt/README.adoc b/bmt/README-source.adoc similarity index 100% rename from bmt/README.adoc rename to bmt/README-source.adoc diff --git a/cmt/README.adoc b/cmt/README-source.adoc similarity index 100% rename from cmt/README.adoc rename to cmt/README-source.adoc diff --git a/contacts-jquerymobile/README.adoc b/contacts-jquerymobile/README-source.adoc similarity index 100% rename from contacts-jquerymobile/README.adoc rename to contacts-jquerymobile/README-source.adoc diff --git a/ee-security/README.adoc b/ee-security/README-source.adoc similarity index 100% rename from ee-security/README.adoc rename to ee-security/README-source.adoc diff --git a/ejb-multi-server/README.adoc b/ejb-multi-server/README-source.adoc similarity index 100% rename from ejb-multi-server/README.adoc rename to ejb-multi-server/README-source.adoc diff --git a/ejb-remote/README.adoc b/ejb-remote/README-source.adoc similarity index 100% rename from ejb-remote/README.adoc rename to ejb-remote/README-source.adoc diff --git a/ejb-security-context-propagation/README.adoc b/ejb-security-context-propagation/README-source.adoc similarity index 100% rename from ejb-security-context-propagation/README.adoc rename to ejb-security-context-propagation/README-source.adoc diff --git a/ejb-security-programmatic-auth/README.adoc b/ejb-security-programmatic-auth/README-source.adoc similarity index 100% rename from ejb-security-programmatic-auth/README.adoc rename to ejb-security-programmatic-auth/README-source.adoc diff --git a/ejb-throws-exception/README.adoc b/ejb-throws-exception/README-source.adoc similarity index 100% rename from ejb-throws-exception/README.adoc rename to ejb-throws-exception/README-source.adoc diff --git a/ejb-timer/README.adoc b/ejb-timer/README-source.adoc similarity index 100% rename from ejb-timer/README.adoc rename to ejb-timer/README-source.adoc diff --git a/ejb-txn-remote-call/README.adoc b/ejb-txn-remote-call/README-source.adoc similarity index 100% rename from ejb-txn-remote-call/README.adoc rename to ejb-txn-remote-call/README-source.adoc diff --git a/ha-singleton-deployment/README.adoc b/ha-singleton-deployment/README-source.adoc similarity index 100% rename from ha-singleton-deployment/README.adoc rename to ha-singleton-deployment/README-source.adoc diff --git a/ha-singleton-service/README.adoc b/ha-singleton-service/README-source.adoc similarity index 100% rename from ha-singleton-service/README.adoc rename to ha-singleton-service/README-source.adoc diff --git a/helloworld-jms/README.adoc b/helloworld-jms/README-source.adoc similarity index 100% rename from helloworld-jms/README.adoc rename to helloworld-jms/README-source.adoc diff --git a/helloworld-mdb/README.adoc b/helloworld-mdb/README-source.adoc similarity index 100% rename from helloworld-mdb/README.adoc rename to helloworld-mdb/README-source.adoc diff --git a/helloworld-mutual-ssl-secured/README.adoc b/helloworld-mutual-ssl-secured/README-source.adoc similarity index 100% rename from helloworld-mutual-ssl-secured/README.adoc rename to helloworld-mutual-ssl-secured/README-source.adoc diff --git a/helloworld-mutual-ssl/README.adoc b/helloworld-mutual-ssl/README-source.adoc similarity index 100% rename from helloworld-mutual-ssl/README.adoc rename to helloworld-mutual-ssl/README-source.adoc diff --git a/helloworld-singleton/README.adoc b/helloworld-singleton/README-source.adoc similarity index 100% rename from helloworld-singleton/README.adoc rename to helloworld-singleton/README-source.adoc diff --git a/helloworld-ws/README.adoc b/helloworld-ws/README-source.adoc similarity index 100% rename from helloworld-ws/README.adoc rename to helloworld-ws/README-source.adoc diff --git a/helloworld/README.adoc b/helloworld/README-source.adoc similarity index 100% rename from helloworld/README.adoc rename to helloworld/README-source.adoc diff --git a/hibernate/README.adoc b/hibernate/README-source.adoc similarity index 100% rename from hibernate/README.adoc rename to hibernate/README-source.adoc diff --git a/http-custom-mechanism/README.adoc b/http-custom-mechanism/README-source.adoc similarity index 100% rename from http-custom-mechanism/README.adoc rename to http-custom-mechanism/README-source.adoc diff --git a/jaxrs-client/README.adoc b/jaxrs-client/README-source.adoc similarity index 100% rename from jaxrs-client/README.adoc rename to jaxrs-client/README-source.adoc diff --git a/jaxrs-jwt/README.adoc b/jaxrs-jwt/README-source.adoc similarity index 100% rename from jaxrs-jwt/README.adoc rename to jaxrs-jwt/README-source.adoc diff --git a/jaxws-ejb/README.adoc b/jaxws-ejb/README-source.adoc similarity index 100% rename from jaxws-ejb/README.adoc rename to jaxws-ejb/README-source.adoc diff --git a/jaxws-retail/README.adoc b/jaxws-retail/README-source.adoc similarity index 100% rename from jaxws-retail/README.adoc rename to jaxws-retail/README-source.adoc diff --git a/jsonp/README.adoc b/jsonp/README-source.adoc similarity index 100% rename from jsonp/README.adoc rename to jsonp/README-source.adoc diff --git a/jta-crash-rec/README.adoc b/jta-crash-rec/README-source.adoc similarity index 100% rename from jta-crash-rec/README.adoc rename to jta-crash-rec/README-source.adoc diff --git a/jts/README.adoc b/jts/README-source.adoc similarity index 100% rename from jts/README.adoc rename to jts/README-source.adoc diff --git a/kitchensink/README.adoc b/kitchensink/README-source.adoc similarity index 100% rename from kitchensink/README.adoc rename to kitchensink/README-source.adoc diff --git a/logging/README.adoc b/logging/README-source.adoc similarity index 100% rename from logging/README.adoc rename to logging/README-source.adoc diff --git a/mail/README.adoc b/mail/README-source.adoc similarity index 100% rename from mail/README.adoc rename to mail/README-source.adoc diff --git a/messaging-clustering-singleton/README.adoc b/messaging-clustering-singleton/README-source.adoc similarity index 100% rename from messaging-clustering-singleton/README.adoc rename to messaging-clustering-singleton/README-source.adoc diff --git a/microprofile-config/README.adoc b/microprofile-config/README-source.adoc similarity index 100% rename from microprofile-config/README.adoc rename to microprofile-config/README-source.adoc diff --git a/microprofile-fault-tolerance/README.adoc b/microprofile-fault-tolerance/README-source.adoc similarity index 100% rename from microprofile-fault-tolerance/README.adoc rename to microprofile-fault-tolerance/README-source.adoc diff --git a/microprofile-health/README.adoc b/microprofile-health/README-source.adoc similarity index 100% rename from microprofile-health/README.adoc rename to microprofile-health/README-source.adoc diff --git a/microprofile-jwt/README.adoc b/microprofile-jwt/README-source.adoc similarity index 100% rename from microprofile-jwt/README.adoc rename to microprofile-jwt/README-source.adoc diff --git a/microprofile-lra/README.adoc b/microprofile-lra/README-source.adoc similarity index 100% rename from microprofile-lra/README.adoc rename to microprofile-lra/README-source.adoc diff --git a/microprofile-openapi/README.adoc b/microprofile-openapi/README-source.adoc similarity index 100% rename from microprofile-openapi/README.adoc rename to microprofile-openapi/README-source.adoc diff --git a/microprofile-reactive-messaging-kafka/README.adoc b/microprofile-reactive-messaging-kafka/README-source.adoc similarity index 100% rename from microprofile-reactive-messaging-kafka/README.adoc rename to microprofile-reactive-messaging-kafka/README-source.adoc diff --git a/microprofile-rest-client/README.adoc b/microprofile-rest-client/README-source.adoc similarity index 100% rename from microprofile-rest-client/README.adoc rename to microprofile-rest-client/README-source.adoc diff --git a/numberguess/README.adoc b/numberguess/README-source.adoc similarity index 100% rename from numberguess/README.adoc rename to numberguess/README-source.adoc diff --git a/remote-helloworld-mdb/README.adoc b/remote-helloworld-mdb/README-source.adoc similarity index 100% rename from remote-helloworld-mdb/README.adoc rename to remote-helloworld-mdb/README-source.adoc diff --git a/security-domain-to-domain/README.adoc b/security-domain-to-domain/README-source.adoc similarity index 100% rename from security-domain-to-domain/README.adoc rename to security-domain-to-domain/README-source.adoc diff --git a/servlet-async/README.adoc b/servlet-async/README-source.adoc similarity index 100% rename from servlet-async/README.adoc rename to servlet-async/README-source.adoc diff --git a/servlet-filterlistener/README.adoc b/servlet-filterlistener/README-source.adoc similarity index 100% rename from servlet-filterlistener/README.adoc rename to servlet-filterlistener/README-source.adoc diff --git a/servlet-security/README.adoc b/servlet-security/README-source.adoc similarity index 100% rename from servlet-security/README.adoc rename to servlet-security/README-source.adoc diff --git a/spring-resteasy/README.adoc b/spring-resteasy/README-source.adoc similarity index 100% rename from spring-resteasy/README.adoc rename to spring-resteasy/README-source.adoc diff --git a/tasks-jsf/README.adoc b/tasks-jsf/README-source.adoc similarity index 100% rename from tasks-jsf/README.adoc rename to tasks-jsf/README-source.adoc diff --git a/temperature-converter/README.adoc b/temperature-converter/README-source.adoc similarity index 100% rename from temperature-converter/README.adoc rename to temperature-converter/README-source.adoc diff --git a/template/README.adoc b/template/README-source.adoc similarity index 100% rename from template/README.adoc rename to template/README-source.adoc diff --git a/thread-racing/README.adoc b/thread-racing/README-source.adoc similarity index 100% rename from thread-racing/README.adoc rename to thread-racing/README-source.adoc diff --git a/todo-backend/README.adoc b/todo-backend/README-source.adoc similarity index 100% rename from todo-backend/README.adoc rename to todo-backend/README-source.adoc diff --git a/websocket-endpoint/README.adoc b/websocket-endpoint/README-source.adoc similarity index 100% rename from websocket-endpoint/README.adoc rename to websocket-endpoint/README-source.adoc diff --git a/websocket-hello/README.adoc b/websocket-hello/README-source.adoc similarity index 100% rename from websocket-hello/README.adoc rename to websocket-hello/README-source.adoc diff --git a/wsat-simple/README.adoc b/wsat-simple/README-source.adoc similarity index 100% rename from wsat-simple/README.adoc rename to wsat-simple/README-source.adoc diff --git a/wsba-coordinator-completion-simple/README.adoc b/wsba-coordinator-completion-simple/README-source.adoc similarity index 100% rename from wsba-coordinator-completion-simple/README.adoc rename to wsba-coordinator-completion-simple/README-source.adoc diff --git a/wsba-participant-completion-simple/README.adoc b/wsba-participant-completion-simple/README-source.adoc similarity index 100% rename from wsba-participant-completion-simple/README.adoc rename to wsba-participant-completion-simple/README-source.adoc