Skip to content

Commit

Permalink
auto-generated diagrams by GitHub Action after source code change
Browse files Browse the repository at this point in the history
Change to default author
simplifier cant process svg, just png
  • Loading branch information
MaxMTheilig committed Jan 12, 2024
1 parent f62ca53 commit 74d8e12
Show file tree
Hide file tree
Showing 5 changed files with 20 additions and 22 deletions.
29 changes: 14 additions & 15 deletions .github/workflows/RenderAllDiagrams.yml
Original file line number Diff line number Diff line change
Expand Up @@ -43,38 +43,38 @@ jobs:
run: |
img_dir=ImplementationGuide/images/diagrams
mkdir -p $img_dir
rm -rf ImplementationGuide/images/diagrams/*.svg
rm -rf ImplementationGuide/images/diagrams/*.png
# Generate the SVGs from PUML
- name: Render PUML to SVG and Move files
# Generate the PNGs from PUML
- name: Render PUML to PNG and Move files
run: |
FileNamePaths=$(find . -path "*/imgsrc/*/*.puml" -exec dirname {} \; | sort -u)
for dir in $FileNamePaths
do
# Render SVGs from PUMLs
find $dir -name "*.puml" -exec java -jar plantuml.jar -tsvg {} \;
# Render PNGs from PUMLs
find $dir -name "*.puml" -exec java -jar plantuml.jar -png {} \;
done
# Generate the SVGs from DrawIO
- name: Render DrawIO to SVG with predefined action
# Generate the PNGs from DrawIO
- name: Render DrawIO to PNG with predefined action
uses: rlespinasse/drawio-export-action@v2
with:
path: ./Material/imgsrc/drawio/
remove-page-suffix: true
output: .
format: svg
format: png
action-mode: all

# copies the created png & svg files to the images/diagrams folder and deletes the drawio files
- name: Move SVGs to target image folder
# copies the created png & png files to the images/diagrams folder and deletes the drawio files
- name: Move PNGs to target image folder
run: |
img_dir=ImplementationGuide/images/diagrams
# Find all unique directories containing *.svg files under any /imgsrc/ folder
FileNamePaths=$(find . -path "*/imgsrc/*/*.svg" -exec dirname {} \; | sort -u)
# Find all unique directories containing *.png files under any /imgsrc/ folder
FileNamePaths=$(find . -path "*/imgsrc/*/*.png" -exec dirname {} \; | sort -u)
for dir in $FileNamePaths
do
# Move SVGs to out directory
find $dir -name "*.svg" -exec mv {} $img_dir \;
# Move PNGs to out directory
find $dir -name "*.png" -exec mv {} $img_dir \;
done
## add and commit the new generated files
Expand All @@ -94,5 +94,4 @@ jobs:
with:
commit_user_name: GitHub Actions Bot
commit_user_email: [email protected]
commit_author: ${{ github.actor }}
commit_message: auto-generated diagrams by GitHub Action after source code change
13 changes: 6 additions & 7 deletions .github/workflows/RenderPlantUML.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ jobs:
sudo apt-get install -y graphviz
wget -O plantuml.jar "https://github.com/plantuml/plantuml/releases/latest/download/plantuml.jar"
- name: Render and Move SVG files
- name: Render and Move PNG files
run: |
# Find all unique directories containing *.puml files under any /imgsrc/ folder
directories=$(find . -path "*/imgsrc/*/*.puml" -exec dirname {} \; | sort -u)
Expand All @@ -32,11 +32,11 @@ jobs:
out_dir=ImplementationGuide/images/diagrams
mkdir -p $out_dir
# Render SVGs from PUMLs
find $dir -name "*.puml" -exec java -jar plantuml.jar -tsvg {} \;
# Render PNGs from PUMLs
find $dir -name "*.puml" -exec java -jar plantuml.jar -tpng {} \;

# Move SVGs to out directory
find $dir -name "*.svg" -exec mv {} $out_dir \;
# Move PNGs to out directory
find $dir -name "*.png" -exec mv {} $out_dir \;
done


Expand All @@ -57,13 +57,12 @@ jobs:
# git config --local user.email "[email protected]"
# git config --local user.name "GitHub Action"
# git add -A
# git commit -m "Add rendered PlantUML to SVG diagrams" || exit 0
# git commit -m "Add rendered PlantUML to PNG diagrams" || exit 0
# git push

- name: Commit rendered files
uses: stefanzweifel/git-auto-commit-action@v5
with:
commit_user_name: GitHub Actions Bot
commit_user_email: [email protected]
commit_author: ${{ github.actor }}
commit_message: auto-generated diagrams by GitHub Action after source code change
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit 74d8e12

Please sign in to comment.