Adapt test files for pdfresources changes #72
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
name: Build PST package documentation | |
on: | |
push: | |
branches: | |
- trunk | |
tags: | |
- "*" | |
jobs: | |
texlive-cache: | |
runs-on: ubuntu-latest | |
name: Update TeX Live | |
outputs: | |
cache_key: ${{ steps.texlive.outputs.cache_key }} | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v3 | |
- name: Install TeX Live | |
id: texlive | |
uses: zauguin/install-texlive@experiment | |
with: | |
tlcontrib: "true" | |
package_file: .github/tl_packages | |
profile: .github/texlive.profile | |
build-docs: | |
runs-on: ubuntu-latest | |
strategy: | |
fail-fast: false | |
matrix: | |
include: | |
# - path: generic/pstricks | |
# document: pst-user | |
# patch: pst-user.diff | |
# extra-command: tar xzf pst-user.tgz | |
- path: generic/pstricks-add | |
document: pstricks-add-doc | |
patch: add_documentmetadata.diff | |
- path: generic/pst-3d | |
document: pst-3d-doc | |
patch: pst-3d.diff | |
- path: generic/pst-3dplot | |
document: pst-3dplot-doc | |
patch: pst-3dplot.diff | |
- path: generic/pst-am | |
document: pst-am-doc | |
patch: pst-am.diff | |
extra-command: iconv -f ISO_8859-15 -t UTF-8 pst-am-doc.tex | sponge pst-am-doc.tex | |
- path: generic/pst-antiprism | |
document: pst-antiprism-doc | |
patch: add_documentmetadata.diff | |
- path: generic/pst-barcode | |
document: pst-barcode-doc | |
extension: ltx | |
- path: generic/pst-bezier | |
document: pst-bezier-doc | |
patch: add_documentmetadata.diff | |
- path: generic/pst-cie | |
document: pst-cie-doc | |
- path: generic/pst-circ | |
document: pst-circ-doc | |
- path: generic/pst-coil | |
document: pst-coil-doc | |
patch: pst-coil.diff | |
- path: generic/pst-dart | |
document: pst-dart-doc | |
- path: generic/pst-eucl | |
document: pst-eucl-doc | |
patch: pst-eucl.diff | |
- path: generic/pst-func | |
document: pst-func-doc | |
- path: generic/pst-knot | |
document: pst-knot-doc | |
patch: pst-knot.diff | |
extra-command: cp ~/texlive/texmf-dist/doc/generic/pst-func/pst-func-doc.bib . | |
- path: generic/pst-node | |
document: pst-node-doc | |
- path: generic/pst-ovl | |
document: pst-ovl-doc | |
patch: add_documentmetadata.diff | |
- path: generic/pst-platon | |
document: pst-platon-doc | |
patch: pst-platon.diff | |
- path: generic/pst-plot | |
document: pst-plot-doc | |
- path: generic/pst-poly | |
document: pst-poly-doc | |
patch: pst-poly.diff | |
- path: generic/pst-solarsystem | |
document: pst-solarsystem-doc | |
patch: add_documentmetadata.diff | |
- path: generic/pst-soroban | |
document: pst-soroban-doc | |
patch: pst-soroban.diff | |
- path: generic/pst-spinner | |
document: pst-spinner-doc | |
patch: add_documentmetadata.diff | |
- path: generic/pst-stru | |
document: pst-stru-doc | |
patch: pst-stru.diff | |
- path: generic/pst-tools | |
document: pst-tools-doc | |
- path: generic/pst-tree | |
document: pst-tree-doc | |
- path: generic/pst-turtle | |
document: pst-turtle-doc | |
patch: add_documentmetadata.diff | |
- path: generic/pst-vehicle | |
document: pst-vehicle-doc | |
patch: pst-vehicle.diff | |
- path: generic/pst-venn | |
document: pst-venn-doc | |
patch: add_documentmetadata.diff | |
name: "${{ matrix.document }}" | |
needs: texlive-cache | |
steps: | |
- run: sudo apt update && sudo apt -y install moreutils ghostscript | |
- name: Checkout repository | |
uses: actions/checkout@v3 | |
with: | |
path: luapstricks | |
- name: Restore TeX Live from cache | |
uses: actions/cache/restore@v3 | |
with: | |
path: ~/texlive | |
key: ${{ needs.texlive-cache.outputs.cache_key }} | |
fail-on-cache-miss: true | |
- run: echo $HOME/texlive/bin/x86_64-linux >> $GITHUB_PATH | |
- run: l3build install | |
working-directory: luapstricks | |
- run: cp -R "$HOME/texlive/texmf-dist/doc/${{ matrix.path }}" document_dir | |
- run: cp -R "$HOME/texlive/texmf-dist/doc/generic/pstricks/pst-doc.pdf" document_dir | |
- name: Run extra command | |
if: matrix.extra-command | |
working-directory: document_dir | |
run: "${{ matrix.extra-command }}" | |
- name: Patch documentation | |
if: matrix.patch | |
working-directory: document_dir | |
run: patch "${{ matrix.document }}.${{ matrix.extension || 'tex' }}" "${{ github.workspace }}/luapstricks/.github/doc_patches/${{ matrix.patch }}" | |
- name: Run latexmk | |
working-directory: document_dir | |
run: "latexmk -pdflua ${{ matrix.document }}.${{ matrix.extension || 'tex' }}" | |
- name: Save resulting document | |
uses: actions/upload-artifact@v3 | |
with: | |
name: documentation | |
retention-days: 1 | |
path: document_dir/${{ matrix.document }}.pdf | |
deploy: | |
runs-on: ubuntu-latest | |
name: Deploy to Pages branch | |
needs: build-docs | |
if: github.ref_type == 'branch' | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v3 | |
with: | |
ref: refs/heads/gh-pages | |
- name: Delete old files in target directory | |
run: rm -Rf "static/version/${{ github.ref_name }}" | |
- name: Download artifact | |
uses: actions/download-artifact@v3 | |
with: | |
name: documentation | |
path: static/version/${{ github.ref_name }}/doc | |
- name: Commit and push new Page | |
run: git add "static/version/${{ github.ref_name }}" && git commit -m "Generated documentation from ${{ github.sha }}" && git push origin @:refs/heads/gh-pages | |
env: | |
GIT_AUTHOR_NAME: "${{ github.event.head_commit.author.name }}" | |
GIT_AUTHOR_EMAIL: "${{ github.event.head_commit.author.email }}" | |
GIT_COMMITTER_NAME: "${{ github.event.head_commit.committer.name }}" | |
GIT_COMMITTER_EMAIL: "${{ github.event.head_commit.committer.email }}" | |
- name: Trigger pusblishing workflow | |
run: gh workflow run deploy-page.yaml --ref gh-pages | |
env: | |
GH_TOKEN: ${{ github.token }} | |
# We could use the same workflow here as for branches and just push into the gh-pages branch, | |
# but then we would collect a huge number of files in there, wasting space. | |
release: | |
runs-on: ubuntu-latest | |
name: Create GitHub release | |
needs: build-docs | |
if: github.ref_type == 'tag' | |
steps: | |
- name: Download artifact | |
uses: actions/download-artifact@v3 | |
with: | |
name: documentation | |
- name: Create GitHub release | |
uses: ncipollo/release-action@a2e71bdd4e7dab70ca26a852f29600c98b33153e | |
with: | |
artifacts: "*.pdf" | |
artifactContentType: application/pdf | |
token: ${{ secrets.GITHUB_TOKEN }} | |
- name: Trigger pusblishing workflow | |
run: gh workflow run deploy-page.yaml --repo "$GITHUB_REPOSITORY" --ref gh-pages | |
env: | |
GH_TOKEN: ${{ github.token }} |