File tree Expand file tree Collapse file tree 3 files changed +61
-0
lines changed
Expand file tree Collapse file tree 3 files changed +61
-0
lines changed Original file line number Diff line number Diff line change 2727 nvc-version : ${{ matrix.version }}
2828 can-fail : ${{ matrix.can-fail }}
2929
30+ Extract-images :
31+ runs-on : ubuntu-24.04
32+ steps :
33+ - name : Install draw.io CLI
34+ run : |
35+ wget https://github.com/jgraph/drawio/releases/download/v24.11.8/drawio-linux-24.11.8.zip
36+ unzip drawio-linux-*.zip
37+ sudo mv drawio /usr/local/bin/
38+
39+ - name : Run export script
40+ run : |
41+ chmod +x ./tools/GitLab-CI/export-drawio.sh
42+ ./tools/GitLab-CI/export-drawio.sh "${{ github.event.inputs.drawio_file || 'test.drawio' }}"
43+ env :
44+ DRAWIO_FILE : " ${{ github.event.inputs.drawio_file || 'test.drawio' }}"
45+
46+ - name : Upload PNG artifacts
47+ uses : actions/upload-artifact@v4
48+ with :
49+ name : drawio-exports
50+ path : " *.png"
51+ retention-days : 1
52+
3053 PublishTestResults :
3154 uses : pyTooling/Actions/.github/workflows/PublishTestResults.yml@r6
3255 needs :
Original file line number Diff line number Diff line change 1+ <mxfile host="Electron" agent="Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) draw.io/28.1.2 Chrome/138.0.7204.243 Electron/37.4.0 Safari/537.36" version="28.1.2">
2+ <diagram name="Seite-1" id="2-pXOjWM6SXTimIP5exn">
3+ <mxGraphModel dx="1426" dy="841" grid="1" gridSize="10" guides="1" tooltips="1" connect="1" arrows="1" fold="1" page="1" pageScale="1" pageWidth="827" pageHeight="1169" math="0" shadow="0">
4+ <root>
5+ <mxCell id="0" />
6+ <mxCell id="1" parent="0" />
7+ <mxCell id="UljRTUy-i_8bFENZkZiz-1" value="test" style="rounded=0;whiteSpace=wrap;html=1;" vertex="1" parent="1">
8+ <mxGeometry x="250" y="250" width="120" height="60" as="geometry" />
9+ </mxCell>
10+ </root>
11+ </mxGraphModel>
12+ </diagram>
13+ </mxfile>
Original file line number Diff line number Diff line change 1+ #! /bin/bash
2+
3+ ANSI_LIGHT_GREEN=$' \x1b [92m'
4+ ANSI_LIGHT_YELLOW=$' \x1b [93m'
5+ ANSI_LIGHT_BLUE=$' \x1b [94m'
6+ ANSI_NOCOLOR=$' \x1b [0m'
7+
8+ for file in " $@ " ; do
9+ base_name=" ${file% .* } "
10+
11+ # Count how many pages exist per *.drawio file. Use "diagram" tag as indication. Also extract page names.
12+ mapfile -t names < <( sed -nE ' s/.*<diagram.*name="([^"]*).*/\1/p' " $file " )
13+ printf " ${ANSI_LIGHT_YELLOW} Exporting from '$base_name '${ANSI_NOCOLOR} \n"
14+
15+ # Export each page as an PNG
16+ for i in " ${! names[@]} " ; do
17+ printf " ${ANSI_LIGHT_BLUE} page '${names[i]} ' ...${ANSI_NOCOLOR} \n"
18+ drawio --export --page-index $(( i+ 1 )) --crop --border 5 --output " ${base_name} _${names[i]} .png" " $file " &
19+ done
20+ done
21+
22+ printf " ${ANSI_LIGHT_YELLOW} Waiting for exports to finish ...${ANSI_NOCOLOR} \n"
23+ wait
24+
25+ printf " ${ANSI_LIGHT_GREEN} Finished export${ANSI_NOCOLOR} \n"
You can’t perform that action at this time.
0 commit comments