Gradle plugin published under the Apache 2.0 license on the Gradle Plugin Portal.
It automatically generates GitHub-compatible README.adoc files from README_plantuml.adoc source files containing native PlantUML blocks.
README_plantuml.adoc is the only file you edit.
README.adoc is a generated artifact β never edited by hand.
my-project/ (1)
βββ settings.gradle.kts
βββ build.gradle.kts
βββ readme-plantuml.yml (2)
βββ README_plantuml.adoc (3)
βββ README_plantuml_fr.adoc (3)
β
βββ plugin/ (4)
βββ settings.gradle.kts
βββ build.gradle.kts
βββ src/main/kotlin/...-
Consumer project β root
-
Plugin configuration (injected from CI secret)
-
Sources of truth β the only files you edit
-
Plugin as local composite build
rootProject.name = "my-project"
pluginManagement.repositories {
gradlePluginPortal() // (1)
}-
Remote resolution β no need for the source everything is downloaded.
my-project/
βββ README.adoc (1)
βββ README_fr.adoc (1)
βββ .github/
βββ workflows/
βββ readme_plantuml.yml (2)
βββ readmes/
βββ images/
βββ en/
β βββ architecture.png (1)
β βββ sequence.png (1)
βββ fr/
βββ architecture.png (1)
βββ sequence.png (1)-
Artifacts generated by CI β never edit these
-
GitHub Actions workflow
Configuration is externalized in readme-plantuml.yml.
This file never contains the token in plain text in the repository.
Its full content (token included) is stored in the GitHub secret README_GRADLE_PLUGIN.
source:
dir: "." # (1)
defaultLang: "en" # (2)
output:
imgDir: ".github/workflows/readmes/images" # (3)
git:
userName: "github-actions[bot]"
userEmail: "github-actions[bot]@users.noreply.github.com"
commitMessage: "chore: generate readme [skip ci]"
token: "<YOUR_GITHUB_PAT>" # (4)
watchedBranches:
- "main"
- "master"-
Directory containing the
README_plantuml*.adocfiles -
Default language when no
_xxsuffix is present in the filename -
Generated images folder β versioned in git
-
Replaced by the real PAT only inside the GitHub secret
| Task | Description | Usage |
|---|---|---|
|
Generates PNG files and rewrites |
Local or CI |
|
Chains |
CI only |
name: Generate README from PlantUML sources
on:
push:
branches:
- main
- master
paths:
- "README_plantuml*.adoc"
workflow_dispatch:
jobs:
generate-readme:
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- uses: actions/setup-java@v4
with:
java-version: '17'
distribution: 'temurin'
cache: gradle
- name: Grant execute permission for gradlew
run: chmod +x gradlew
- name: Inject plugin config
run: echo "${{ secrets.README_GRADLE_PLUGIN }}" > readme-truth.yml
- name: Generate README and commit via JGit
run: ./gradlew -q -s commitGeneratedReadme --no-daemon| Dependency | Version | Role |
|---|---|---|
|
|
PNG generation from PlantUML blocks |
|
|
Git operations without a system git binary |
|
|
Parsing of |
|
|
YAML β Kotlin data class mapping (Jakarta) |
Distributed under the Apache 2.0 license.






