diff --git a/.github/workflows/daily.yml b/.github/workflows/daily.yml new file mode 100644 index 0000000..445e860 --- /dev/null +++ b/.github/workflows/daily.yml @@ -0,0 +1,30 @@ +name: Nightly Sphinx Build and Link Check + +on: + schedule: + - cron: "0 2 * * *" + # This allows the job to be manually triggered. + workflow_dispatch: + +jobs: + build-and-check-links: + name: "Build PDF and HTML documentation" + runs-on: ubuntu-24.04 + steps: + - uses: actions/checkout@v4 + - uses: actions/setup-python@v5 + - name: Install dependencies + run: | + sudo apt-get update + sudo apt-get install -y librsvg2-bin \ + python3-sphinx latexmk texlive-latex-extra \ + python3-sphinxcontrib.svg2pdfconverter sphinx-multiversion \ + python3-sphinx-rtd-theme + + - name: Build Sphinx documentation + run: | + make html latexpdf + + - name: Check for broken links + run: | + sphinx-build -b linkcheck source/ _build/linkcheck diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml new file mode 100644 index 0000000..d65fe9f --- /dev/null +++ b/.github/workflows/main.yml @@ -0,0 +1,54 @@ +name: Build specification +on: + push: + branches: [main] + pull_request: + branches: [main] + +permissions: + contents: write + +jobs: + build-docs: + name: "Build PDF and HTML documentation" + runs-on: ubuntu-24.04 + steps: + - uses: actions/checkout@v4 + - uses: actions/setup-python@v5 + - name: Install Packages + run: | + sudo apt-get update + sudo apt-get install -y librsvg2-bin \ + python3-sphinx latexmk texlive-latex-extra \ + python3-sphinxcontrib.svg2pdfconverter sphinx-multiversion \ + python3-sphinx-rtd-theme + + - name: Generate PDF Documentation + run: | + make latexpdf + + - name: Generate HTML Documentation + run: | + if [[ "${{ github.event_name }}" == "push" && "${{ github.ref }}" == "refs/heads/main" ]]; then + git fetch --tags + + sphinx-multiversion source build/html + cp source/assets/redirect.html build/html/index.html + else + make html + fi + + - name: Archive PDF + uses: actions/upload-artifact@v4 + with: + name: project_specific_transfer_entries.pdf + path: build/latex/project_specific_transfer_entries.pdf + + - name: Deploy to GitHub Pages + uses: peaceiris/actions-gh-pages@v3 + if: ${{ github.event_name == 'push' && github.ref == 'refs/heads/main' }} + with: + publish_branch: gh-pages + github_token: ${{ secrets.GITHUB_TOKEN }} + publish_dir: build/html + force_orphan: true diff --git a/README.md b/README.md index 36061b9..684c13c 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@ -[![Build Status](https://github.com/FirmwareHandoff/ProjectTEs/actions/workflows/main.yml/badge.svg)](https://github.com/FirmwareHandoff/ProjectSpecificEntries/actions/workflows/main.yml) -[![Daily Status](https://github.com/FirmwareHandoff/ProjectTEs/actions/workflows/daily.yml/badge.svg)](https://github.com/FirmwareHandoff/ProjectSpecificEntries/actions/workflows/daily.yml) -[![Release Version](https://img.shields.io/github/v/release/FirmwareHandoff/ProjectTEs?label=release)](https://github.com/FirmwareHandoff/ProjectSpecificEntries/releases) +[![Build Status](https://github.com/FirmwareHandoff/ProjectTEs/actions/workflows/main.yml/badge.svg)](https://github.com/FirmwareHandoff/ProjectTEs/actions/workflows/main.yml) +[![Daily Status](https://github.com/FirmwareHandoff/ProjectTEs/actions/workflows/daily.yml/badge.svg)](https://github.com/FirmwareHandoff/ProjectTEs/actions/workflows/daily.yml) +[![Release Version](https://img.shields.io/github/v/release/FirmwareHandoff/ProjectTEs?label=release)](https://github.com/FirmwareHandoff/ProjectTEs/releases) This repository contains the Transfer Entry definitions that are project-specific. This is an auxiliary document to theFirmware Handoff specification, which defines a