-
Notifications
You must be signed in to change notification settings - Fork 9
59 lines (48 loc) · 1.65 KB
/
generate-images-plantuml.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
name: PlantUML images
on:
push:
branches:
- '**'
paths:
- '.github/workflows/generate-images-plantuml.yml'
- 'src/plantuml/**'
workflow_dispatch:
env:
PLANTUML_VERSION: 1.2024.4
PLANTUML_SRC: src/plantuml
PLANTUML_OUT: images/plantuml
jobs:
generate:
runs-on: ubuntu-latest
steps:
- name: Check out repository
uses: actions/checkout@v4
- name: Set up Java
uses: actions/setup-java@v4
with:
distribution: 'temurin'
java-version: '11'
check-latest: true
- name: Set up Graphviz
run: |
sudo apt-get update
sudo apt-get install --yes --no-install-recommends graphviz
- name: Download PlantUML JAR
run: |
# Ironically, manually fetching the JAR is faster than installing the Debian plantuml package
wget -O plantuml.jar "https://github.com/plantuml/plantuml/releases/download/v${{ env.PLANTUML_VERSION }}/plantuml-${{ env.PLANTUML_VERSION }}.jar"
- name: Prepare output folder
run: |
rm -rf "${{ env.PLANTUML_OUT }}"
mkdir -p "${{ env.PLANTUML_OUT }}"
- name: Export PlantUML files as png / svg
run: |
for ext in png svg; do
java -jar plantuml.jar -t$ext -v -nometadata -failfast2 -nbthread auto -o "." "${{ env.PLANTUML_SRC }}/**.puml"
rsync -v --recursive --include="*.$ext" --filter="-! */" "${{ env.PLANTUML_SRC }}"/* "${{ env.PLANTUML_OUT }}"
done
- name: Add & Commit
uses: EndBug/add-and-commit@v9
with:
add: ${{ env.PLANTUML_OUT }}
pull: --rebase --autostash