diff --git a/.github/workflows/build-and-publish.yml b/.github/workflows/build-and-publish.yml index 1cefbb2..80501bd 100644 --- a/.github/workflows/build-and-publish.yml +++ b/.github/workflows/build-and-publish.yml @@ -1,5 +1,12 @@ name: Build -on: [push, pull_request] +on: + pull_request: + push: + branches: + main +concurrency: + group: "${{ github.workflow }}-${{ github.head_ref || github.ref }}" + cancel-in-progress: true jobs: ctan: runs-on: ubuntu-latest @@ -7,42 +14,57 @@ jobs: - name: Set up Git repository uses: actions/checkout@v4 - name: release.sh - uses: dante-ev/latex-action@latest + # We need java, pandoc, and more, which is not provided directly by the image + uses: dante-ev/latex-action@edge with: entrypoint: ./release.sh - uses: actions/upload-artifact@v4 with: name: ctan path: plantuml.tar.gz - build_and_publish: + build_and_ghpages: runs-on: ubuntu-latest steps: - - name: Set up Git repository - uses: actions/checkout@v4 - - name: example-minimal - uses: dante-ev/latex-action@latest + - uses: actions/setup-java@v4 with: - root_file: example-minimal.tex - compiler: lualatex - args: -interaction=nonstopmode -shell-escape - - name: example-class-relations--svg - uses: dante-ev/latex-action@latest + distribution: 'temurin' + java-version: '21' + - name: Cache PlantUML jar + id: cache-plantuml + uses: actions/cache@v4 with: - root_file: example-class-relations--svg.tex - compiler: lualatex - args: -interaction=nonstopmode -shell-escape - - name: example-class-relations--latex - uses: dante-ev/latex-action@latest + path: /tmp/plantuml + key: plantuml-asl-1.2024.6.jar + - name: wget PlantUML jar + if: steps.cache-plantuml.outputs.cache-hit != 'true' + run: | + mkdir /tmp/plantuml + cd /tmp/plantuml + wget https://github.com/plantuml/plantuml/releases/download/v1.2024.6/plantuml-asl-1.2024.6.jar + - name: Set PLANTUML_JAR + run: echo "PLANTUML_JAR=/tmp/plantuml/plantuml-asl-1.2024.6.jar" >> "$GITHUB_ENV" + - uses: actions/checkout@v4 + - uses: awalsh128/cache-apt-pkgs-action@latest with: - root_file: example-class-relations--latex.tex - compiler: lualatex - args: -interaction=nonstopmode -shell-escape - - name: example-component-diagram - uses: dante-ev/latex-action@latest + packages: graphviz inkscape + version: 1.0 + execute_install_scripts: true + - run: dpkg -L inkscape + - run: which inkscape + - name: Install TeX Live + uses: zauguin/install-texlive@v3 with: - root_file: example-component-diagram.tex - compiler: lualatex - args: -interaction=nonstopmode -shell-escape + package_file: tl_packages + - name: example-minimal + run: lualatex -shell-escape example-minimal.tex + - name: example-class-relations--latex + run: lualatex -shell-escape example-class-relations--latex + - name: example-class-relations--svg + run: lualatex -shell-escape example-class-relations--svg + - name: example-component-diagram + run: lualatex -shell-escape example-component-diagram + - name: example-multiple-diagrams-svg + run: lualatex -shell-escape example-multiple-diagrams-svg - name: Gather build artifacts run: | mkdir build @@ -50,10 +72,15 @@ jobs: mv example-*.png build/ cp -r README.md .github/_config.yml build/ - name: Publish to GitHub pages - if: success() && github.ref == 'refs/heads/main' + if: github.ref == 'refs/heads/main' uses: crazy-max/ghaction-github-pages@v4 with: target_branch: gh-pages build_dir: build/ env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + - uses: actions/upload-artifact@v4 + if: github.ref != 'refs/heads/main' + with: + name: gh-pages + path: build/ diff --git a/README.md b/README.md index 14a182d..f386687 100644 --- a/README.md +++ b/README.md @@ -12,7 +12,7 @@ Check [issue #1](https://github.com/koppor/plantuml/issues/1) for the current st 1. Environment variable `PLANTUML_JAR` set to the location of `plantuml.jar`. You get it from . -2. Enviroment variable `GRAPHVIZ_DOT` set to the location of `dot.exe`. +2. Windows: Environment variable `GRAPHVIZ_DOT` set to the location of `dot.exe`. Example: `C:\Program Files (x86)\Graphviz2.38\bin\dot.exe`. You can install graphviz using `choco install graphviz`. 3. lualatex available with command line parameter `-shell-escape` included. diff --git a/ExampleMultiSVGs/example-component-diagram.tex b/example-multiple-diagrams-svg.tex similarity index 72% rename from ExampleMultiSVGs/example-component-diagram.tex rename to example-multiple-diagrams-svg.tex index 78ad3e3..359bc6d 100644 --- a/ExampleMultiSVGs/example-component-diagram.tex +++ b/example-multiple-diagrams-svg.tex @@ -1,10 +1,7 @@ \documentclass{scrartcl} \usepackage{graphics} -% Enables inclusion of SVG graphics - 1:1 approach -% This is NOT the approach of https://ctan.org/pkg/svg-inkscape -% which allows text in SVG to be typeset using LaTeX. -% We just include the SVG as is. + \usepackage{epstopdf} \epstopdfDeclareGraphicsRule{.svg}{pdf}{.pdf}{% inkscape #1 --export-filename=\OutputFile @@ -22,24 +19,24 @@ [component 1] as c1 [component 2] as c2 [component 3] as c3 - + c1 -- I2 c1 -- I3 - + I2 )-- c2 I3 )-- c3 @enduml \end{plantuml} - + \newpage \begin{plantuml} @startuml class Car - + Driver - Car : drives > Car *- Wheel : have 4 > Car -- Person : < owns @enduml \end{plantuml} -\end{document} \ No newline at end of file +\end{document} diff --git a/tl_packages b/tl_packages new file mode 100644 index 0000000..177896d --- /dev/null +++ b/tl_packages @@ -0,0 +1,37 @@ + +# Proudly generated by the Island of TeX's DEPendency Printer https://gitlab.com/islandoftex/texmf/depp +adjustbox +cm +collectbox +ctablestack +epstopdf-pkg +fancyvrb +graphics +graphics-cfg +graphics-def +grfext +ifoddpage +iftex +infwarerr +koma-script +kvdefinekeys +kvoptions +kvsetkeys +l3backend +l3kernel +l3packages +latex +latex-bin +latex-fonts +latexconfig +lm +ltxcmds +luacode +luatexbase +pdftexcmds +pgf +plantuml +scheme-minimal +varwidth +xcolor +xkeyval