-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
auto-generated diagrams by GitHub Action after source code change
Change to default author simplifier cant process svg, just png
- Loading branch information
1 parent
f62ca53
commit 74d8e12
Showing
5 changed files
with
20 additions
and
22 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -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 | ||
|
@@ -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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -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) | ||
|
@@ -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 | ||
|
||
|
||
|
@@ -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.