fix some docs #7
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: TLA+ PDF Generation | |
on: | |
push: | |
branches: | |
- main | |
paths: | |
- 'p2p.tla' | |
- 'Blockchain.tla' | |
- 'Utils.tla' | |
- 'Operators.tla' | |
workflow_dispatch: | |
jobs: | |
generate_pdfs: | |
runs-on: ubuntu-latest | |
permissions: | |
contents: write | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v3 | |
with: | |
persist-credentials: true | |
# Install Java | |
- name: Set up Java | |
uses: actions/setup-java@v3 | |
with: | |
distribution: 'temurin' | |
java-version: '21' | |
# Install LaTeX and Ghostscript for PDF generation | |
- name: Install LaTeX and Ghostscript | |
run: | | |
sudo apt-get update | |
sudo apt-get install -y texlive-latex-base texlive-latex-extra texlive-fonts-recommended ghostscript | |
# Download TLA+ Tools for PDF generation | |
- name: Download TLA+ Tools | |
run: | | |
wget https://github.com/tlaplus/tlaplus/releases/latest/download/tla2tools.jar | |
# Generate PDFs for each TLA+ file | |
- name: Generate PDF for TLA+ files | |
run: | | |
java -cp tla2tools.jar tla2tex.TLA -shade -noPcalShade p2p.tla | |
ps2pdf p2p.ps p2p.pdf | |
java -cp tla2tools.jar tla2tex.TLA -shade -noPcalShade Blockchain.tla | |
ps2pdf Blockchain.ps Blockchain.pdf | |
java -cp tla2tools.jar tla2tex.TLA -shade -noPcalShade Utils.tla | |
ps2pdf Utils.ps Utils.pdf | |
java -cp tla2tools.jar tla2tex.TLA -shade -noPcalShade Operators.tla | |
ps2pdf Operators.ps Operators.pdf | |
# Move PDFs to documents directory | |
- name: Move PDFs to documents folder | |
run: mv -f p2p.pdf Blockchain.pdf Utils.pdf Operators.pdf documents/ | |
# Commit and push PDF files to the documents directory | |
- name: Push documents | |
uses: stefanzweifel/git-auto-commit-action@v5 | |
with: | |
file_pattern: 'documents/*.pdf' | |
commit_message: 'Add generated PDFs to documents directory' | |