# Build script that builds and configures a LaTeX document
# Can be extended to build other formats, such as odt or gmi files, and
# will create a new release, with the generated files as target.
#
# Variables
# - MAJOR: The major version number for the release version scheme
# - MINOR: The minor version number for the release version scheme`

name: Build LaTex Document
run-name: ${{ gitea-actor }} is building LaTeX documents
on:
  push:
    branches:
      - 'main'

jobs:
  Build:
    runs-on: latex-project-amd64
    steps:
      - name: Checking out the repository
        uses: actions/checkout@v6
      - name: Building the PDF document
        run: |
          waf distclean
          waf configure
          waf build
      - name: Release
        uses: akkuman/gitea-release-action@v1
        with:
          files: |-
            build/*.pdf
            build/*.epub
          name: Release ${{ vars.MAJOR }}.${{ vars.MINOR }}.${{ gitea.run_number }}.${{ gitea.run_attempt }}
          tag_name: Release_${{ vars.MAJOR }}.${{ vars.MINOR }}.${{ gitea.run_number }}.${{ gitea.run_attempt }}

