-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
fa8d385
commit 6551c70
Showing
2 changed files
with
41 additions
and
7 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 |
---|---|---|
|
@@ -5,6 +5,7 @@ on: | |
paths: | ||
- '**/Material/images/src/**/*.puml' | ||
- '**/Material/images/src/**/*.drawio' | ||
- '**/Material/images/src/**/*.bpmn' | ||
branches-ignore: | ||
- 'main**' | ||
|
||
|
@@ -38,15 +39,16 @@ jobs: | |
run: | | ||
wget -O plantuml.jar "https://github.com/plantuml/plantuml/releases/latest/download/plantuml.jar" | ||
# Clean Folder | ||
# Ensure Folder exsists, otherwise, create it | ||
- name: Ensure and clean folder | ||
run: | | ||
img_dir=Material/images/diagrams | ||
mkdir -p $img_dir | ||
rm -rf Material/images/diagrams/*.svg | ||
# do not clean | ||
# rm -rf Material/images/diagrams/*.svg | ||
|
||
# Generate the SVGs from PUML | ||
- name: Render PUML to SVG and Move files | ||
- name: Render PUML to SVG files | ||
run: | | ||
FileNamePaths=$(find . -path "*/images/src/*/*.puml" -exec dirname {} \; | sort -u) | ||
for dir in $FileNamePaths | ||
|
@@ -70,7 +72,34 @@ jobs: | |
format: svg | ||
action-mode: all | ||
|
||
# Install note.js and bpmn-to-image | ||
- name: Install Notejs and pbmn-to-image | ||
uses: actions/setup-node@v4 | ||
with: | ||
node-version: 18 | ||
- run: npm install -g bpmn-to-image | ||
|
||
# Generate the SVGs from BPMN | ||
- name: Render BPMN to SVG files | ||
run: | | ||
FileNamePaths=$(find . -path "*/images/src/*/*.bpmn" -exec dirname {} \; | sort -u) | ||
for dir in $FileNamePaths | ||
do | ||
# Render SVGs from BPMN | ||
echo $dir | ||
FileBaseNames=$(find $dir -name "*.bpmn" -exec basename "{}" ".bpmn" \; | sort -u) | ||
#FileBaseNames=$(find $dir -name "*.bpmn" | xargs -L1 -I{} basename "{}") | ||
for base in $FileBaseNames | ||
do | ||
echo $base | ||
bpmn-to-image "$dir/$base.bpmn":"$dir/$base.svg"; | ||
done | ||
done | ||
# copies the created SVG files to the images/diagrams folder and deletes the drawio files | ||
# mv for copy and delete, here | ||
- name: Move SVGs to target image folder | ||
run: | | ||
img_dir=Material/images/diagrams | ||
|
@@ -79,7 +108,8 @@ jobs: | |
for dir in $FileNamePaths | ||
do | ||
# Move SVGs to out directory | ||
find $dir -name "*.svg" -exec mv {} $img_dir \; | ||
# find $dir -name "*.svg" -exec rm -rf {} $img_dir \; | ||
find $dir -name "*.svg" -exec mv -f {} $img_dir \; | ||
done | ||
## add and commit the new generated files | ||
|
@@ -99,4 +129,8 @@ jobs: | |
with: | ||
commit_user_name: GitHub Actions Bot | ||
commit_user_email: [email protected] | ||
commit_message: auto-generated diagrams by GitHub Action after source code change | ||
commit_message: auto-generated diagrams by GitHub Action after source code change | ||
|
||
- name: "Run if no changes have been detected" | ||
if: steps.auto-commit-action.outputs.changes_detected == 'false' | ||
run: echo "No Changes!" |
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 |
---|---|---|
|
@@ -28,7 +28,7 @@ jobs: | |
# Steps represent a sequence of tasks that will be executed as part of the job | ||
steps: | ||
- name: Checkout code | ||
uses: actions/checkout@v2 | ||
uses: actions/checkout@v4 | ||
|
||
# Java and .NET are already installed on ubuntu-latest | ||
|
||
|
@@ -50,7 +50,7 @@ jobs: | |
EXPECTED_FAILS: VALIDATION_CONFORMANCE_DOTNET VALIDATION_CONFORMANCE_JAVA VALIDATION_EXAMPLES_JAVA | ||
|
||
- name: Add & Commit | ||
uses: EndBug/add-and-commit@v7 | ||
uses: EndBug/add-and-commit@v9 | ||
with: | ||
committer_name: GitHub Actions Bot | ||
committer_email: [email protected] | ||
|