π A powerful GitHub Action to build LaTeX documents and create automated releases with enhanced performance and reliability.
- π Multi-file Support: Build multiple LaTeX documents in a single workflow
- β‘ Parallel Processing: Optional parallel builds for faster compilation
- π‘οΈ Enhanced Security: Input validation and sanitization
- π§Ή Smart Cleanup: Configurable intermediate file cleanup
- π¦ Automated Releases: Creates GitHub releases with compiled PDFs
- π― Flexible Options: Customizable LaTeX compilation options
- πββοΈ High Performance: Optimized container-based execution
- π Japanese Support: TeXLive environment with full Japanese support
Create .github/workflows/latex-build.yml:
name: LaTeX Build and Release
on:
push:
tags: ['*'] # Trigger on all tags
pull_request:
branches: [ main ]
jobs:
build-latex:
runs-on: ubuntu-latest
container: ghcr.io/smkwlab/texlive-ja-textlint:2026a
permissions:
contents: write # Required for creating releases
steps:
- name: Build and Release LaTeX
uses: smkwlab/latex-release-action@v3
with:
files: "document" # Build document.texname: Advanced LaTeX Build
on:
push:
tags: ['*'] # All tags (e.g., release-1.0, draft-v2, final)
pull_request:
branches: [ main ]
jobs:
build-latex:
runs-on: ubuntu-latest
container: ghcr.io/smkwlab/texlive-ja-textlint:2026a
permissions:
contents: write
steps:
- name: Build Multiple LaTeX Files
uses: smkwlab/latex-release-action@v3
with:
files: "paper, appendix, presentation"
parallel: "true" # Enable parallel builds
latex_options: "-pdf -interaction=nonstopmode -halt-on-error"
cleanup: "true" # Clean intermediate files
release_name: "Research Paper ${{ github.ref_name }}"| Parameter | Required | Default | Description |
|---|---|---|---|
files |
β | - | Comma-separated LaTeX file names (without .tex extension) |
latex_options |
β | -pdf -interaction=nonstopmode |
Custom latexmk compilation options |
parallel |
β | false |
Enable parallel builds for multiple files |
cleanup |
β | true |
Remove intermediate files after build |
release_name |
β | Auto-generated | Custom name for the GitHub release |
include_source |
β | true |
Include source code in release assets |
name: Academic Paper Build
on:
push:
tags: ['*'] # paper-v1, submission-final, etc.
jobs:
build-paper:
runs-on: ubuntu-latest
container: ghcr.io/smkwlab/texlive-ja-textlint:2026a
permissions:
contents: write
steps:
- name: Build Research Paper
uses: smkwlab/latex-release-action@v3
with:
files: "paper/main, appendix/supplementary"
parallel: "true"
latex_options: "-pdf -interaction=nonstopmode -halt-on-error"
release_name: "Paper Draft ${{ github.ref_name }}"name: Multi-Document Build
on:
push:
tags: ['*'] # thesis-draft, final-submission, etc.
jobs:
build-documents:
runs-on: ubuntu-latest
container: ghcr.io/smkwlab/texlive-ja-textlint:2026a
permissions:
contents: write
steps:
- name: Build All Documents
uses: smkwlab/latex-release-action@v3
with:
files: "thesis, slides, poster, abstract"
parallel: "true"
cleanup: "true"name: Sequential Document Build
on:
push:
tags: ['*'] # report-draft, monthly-update, etc.
jobs:
build-reports:
runs-on: ubuntu-latest
container: ghcr.io/smkwlab/texlive-ja-textlint:2026a
permissions:
contents: write
steps:
- name: Build with Dependencies
uses: smkwlab/latex-release-action@v3
with:
files: "main-report, summary-report"
parallel: "false" # Build sequentially
latex_options: "-pdf -interaction=nonstopmode"your-repo/
βββ .github/workflows/latex-build.yml
βββ document.tex
βββ references.bib
βββ images/
βββ figure1.png
your-repo/
βββ .github/workflows/latex-build.yml
βββ paper/
β βββ main.tex
β βββ sections/
β βββ references.bib
βββ slides/
β βββ presentation.tex
βββ appendix/
βββ supplementary.tex
Usage for subdirectories:
with:
files: "paper/main, slides/presentation, appendix/supplementary"- π¨ Builds LaTeX documents for verification
- π Creates pre-release with tag:
{branch-name}-release - β Validates compilation without affecting main releases
- π Builds LaTeX documents for production
- π¦ Creates release with tag:
{tag-name}-release - π Automatically attaches compiled PDFs
## π LaTeX Build Results
This release contains compiled PDF files from the following LaTeX sources:
**Built files:** paper, appendix, presentation
**Build options:** `-pdf -interaction=nonstopmode`
**Parallel build:** true
**Cleanup performed:** true
π€ *This release was automatically generated by LaTeX Release Action*permissions:
contents: write # Required for creating GitHub releasesRecommended approach: Use pre-built TexLive container for optimal performance:
jobs:
build-latex:
runs-on: ubuntu-latest
container: ghcr.io/smkwlab/texlive-ja-textlint:2026a # Recommended
permissions:
contents: write
steps:
- uses: smkwlab/latex-release-action@v3
with:
files: "document"Alternative containers:
texlive/texlive:latest- Official TexLivepandoc/latex:latest- Lightweight option- Custom container with
latexmkinstalled
For security, file names must contain only:
- Alphanumeric characters:
a-z,A-Z,0-9 - Special characters:
_,-,/
# Clone the repository
git clone https://github.com/smkwlab/latex-release-action.git
cd latex-release-action
# Run tests
./test.sh # All tests
./test.sh logic # Quick validation
./test.sh local # Local LaTeX test
./test.sh docker # Container test- β Single file builds
- β Multiple file builds (parallel & sequential)
- β Error handling with non-existent files
- β Container-based execution
- β GitHub Actions emulation
Contributions are welcome! Please check our Contributing Guidelines.
- π Fork the repository
- πΏ Create a feature branch
- β Add tests for new features
- π§ͺ Run the test suite
- π Update documentation
- π Submit a pull request
This project is licensed under the MIT License - see the LICENSE file for details.
- Maintained by: Shimokawa Laboratory
- Contributors: See Contributors
- Special Thanks: All users who provided feedback and bug reports
- π Documentation: GitHub Wiki
- π Bug Reports: GitHub Issues
- π‘ Feature Requests: GitHub Discussions
β Star this repository if you find it helpful!
π Perfect for: Academic papers, thesis documents, technical reports, presentations, and any LaTeX-based documentation workflow.