diff --git a/.editorconfig b/.editorconfig deleted file mode 100644 index 03207a8..0000000 --- a/.editorconfig +++ /dev/null @@ -1,16 +0,0 @@ -root = true - -[*] -charset = utf-8 -indent_style = tab -indent_size = 4 -end_of_line = lf -insert_final_newline = true -trim_trailing_whitespace = true - -[*.{yml,yaml}] -indent_style = space -indent_size = 2 - -[*.md] -trim_trailing_whitespace = false diff --git a/.gitattributes b/.gitattributes deleted file mode 100644 index 30dc409..0000000 --- a/.gitattributes +++ /dev/null @@ -1,12 +0,0 @@ -# Automatically normalize line endings for all text-based files. -# https://git-scm.com/docs/gitattributes#_end_of_line_conversion - -* text=auto - -.editorconfig text -.gitattributes text -*.md text -*.sh text -*.yml text -Dockerfile txt -LICENSE text diff --git a/README.md b/README.md index ef1b924..ceb689c 100644 --- a/README.md +++ b/README.md @@ -1,15 +1,15 @@ # PlantUML End-to-End Action A GitHub Action for creating a PlantUML file from a Python module and exporting it as an image. -## Python ➡️ PlantUML ➡️ PNG -This repository was forked from [this repo](https://github.com/Timmy/plantuml-action/tree/5f5f57e2ec41225b88f37aa1dc15edda188b47c8) and extends it by automating the end-to-end process, from generating the PlantUML diagram based on Python modules to exporting that diagram as PNG for ease of access and in-repo rendering. +## Python ➡️ PlantUML ➡️ SVG +This repository was forked from [this repo](https://github.com/Timmy/plantuml-action/tree/5f5f57e2ec41225b88f37aa1dc15edda188b47c8) and extends it by automating the end-to-end process, from generating the PlantUML diagram based on Python modules to exporting that diagram as SVG for ease of access and in-repo rendering. ## Usage Use it from the GitHub Actions marketplace. ### Example workflow The following workflow generates a PlantUML diagram from the Python module `tests` -in the `tests` directory and exports it as PUML file as well as PNG to the `diagrams` directory. +in the `tests` directory and exports it as PUML file as well as SVG to the `diagrams` directory. Subsequently, the changed files are committed and pushed to the repository. Note that passing of the parameters `puml_version` as well as `py2puml_version` is optional and both default to `latest`. However, it's recommended to pin down their versions. @@ -61,7 +61,7 @@ jobs: description: the module name of the domain following the py2puml definition required: true output_dir: - description: the directory where the PNG should be saved to. File names default to the module name, but differ by file extension (.puml/.png). + description: the directory where the SVG should be saved to. File names default to the module name, but differ by file extension (.puml/.svg). default: diagrams required: true ``` diff --git a/entrypoint.sh b/entrypoint.sh index 79a8e87..1f516a1 100755 --- a/entrypoint.sh +++ b/entrypoint.sh @@ -25,18 +25,18 @@ else echo "File found: ${INPUT_OUTPUT_DIR}/${INPUT_MODULE}.puml" fi -# Generating the PNG file from the PUML file +# Generating the SVG file from the PUML file if [ "$INPUT_PUML_VERSION" = "latest" ]; then wget -O /tmp/plantuml.jar "http://sourceforge.net/projects/plantuml/files/plantuml.jar/download" else wget -O /tmp/plantuml.jar "http://sourceforge.net/projects/plantuml/files/plantuml.${INPUT_PUML_VERSION}.jar/download" fi -java -jar /tmp/plantuml.jar "${INPUT_OUTPUT_DIR}"/"${INPUT_MODULE}".puml -o ../"${INPUT_OUTPUT_DIR}" +java -jar /tmp/plantuml.jar "${INPUT_OUTPUT_DIR}"/"${INPUT_MODULE}".puml -o ../"${INPUT_OUTPUT_DIR}" -tsvg -# Check if a PNG file is found at the expected location -if [ ! -f "${INPUT_OUTPUT_DIR}/${INPUT_MODULE}.png" ]; then - echo "File not found: ${INPUT_OUTPUT_DIR}/${INPUT_MODULE}.png" +# Check if a SVG file is found at the expected location +if [ ! -f "${INPUT_OUTPUT_DIR}/${INPUT_MODULE}.svg" ]; then + echo "File not found: ${INPUT_OUTPUT_DIR}/${INPUT_MODULE}.svg" exit 1 else - echo "File found: ${INPUT_OUTPUT_DIR}/${INPUT_MODULE}.png" + echo "File found: ${INPUT_OUTPUT_DIR}/${INPUT_MODULE}.svg" fi