diff --git a/.github/workflows/compile-pdfs.yml b/.github/workflows/compile-pdfs.yml new file mode 100644 index 0000000..5f92df2 --- /dev/null +++ b/.github/workflows/compile-pdfs.yml @@ -0,0 +1,62 @@ +name: Compile PDFs +run-name: "Recompile after ${{ github.actor }}'s changes" +on: [push] + # push: + # branches: + # - main + +jobs: + compile-pdfs: + runs-on: ubuntu-latest + container: + image: texlive/texlive:latest + env: + TEXINPUTS: ".:..:" + steps: + - name: Install `gh` + run: | + (type -p wget >/dev/null || (apt update && apt-get install wget -y)) \ + && mkdir -p -m 755 /etc/apt/keyrings \ + && wget -qO- \ + https://cli.github.com/packages/githubcli-archive-keyring.gpg | \ + tee /etc/apt/keyrings/githubcli-archive-keyring.gpg > /dev/null \ + && chmod go+r /etc/apt/keyrings/githubcli-archive-keyring.gpg \ + && echo "deb [arch=$(dpkg --print-architecture) \ + signed-by=/etc/apt/keyrings/githubcli-archive-keyring.gpg] \ + https://cli.github.com/packages stable main" | \ + tee /etc/apt/sources.list.d/github-cli.list > /dev/null \ + && apt update \ + && apt install gh -y + - name: Check out document sources + uses: actions/checkout@v4 + - name: Create build directory + run: mkdir build + - name: list + run: ls + - name: Compile statutes + run: | + latexmk -outdir=../build -cd stadgar/stadgar.tex + - name: Compile regulations + run: | + latexmk -outdir=../build -cd reglemente/reglemente.tex + - name: Compile policies + run: | + for filename in policyer/*.tex; do + latexmk -outdir=../build -cd $filename + done + - name: Compile guidelines + run: | + for filename in riktlinjer/*.tex; do + latexmk -outdir=../build -cd $filename + done + - name: List outputs + run: ls build + - name: Create release + if: ${{ github.ref_name == 'main' }} + run: | + git config --global --add safe.directory \ + /__w/styrdokument/styrdokument + gh release delete latest -y + gh release create latest build/*.pdf + env: + GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} diff --git a/.latexmkrc b/.latexmkrc new file mode 100644 index 0000000..cc0d012 --- /dev/null +++ b/.latexmkrc @@ -0,0 +1,2 @@ +$pdf_mode = 1; +$pdflatex = 'lualatex -interaction=nonstopmode'; \ No newline at end of file diff --git a/policyer/.github/workflows/build.yml b/policyer/.github/workflows/build.yml deleted file mode 100644 index 0a0674a..0000000 --- a/policyer/.github/workflows/build.yml +++ /dev/null @@ -1,44 +0,0 @@ -name: Build LaTeX documents -on: - push: - branches: - - "main" -jobs: - build_latex: - runs-on: ubuntu-latest - steps: - - name: Set up Git repository - uses: actions/checkout@v2 - - - name: Show Working directory - run: ls - - - name: Setup dsek latex - uses: actions/checkout@v2 - with: - repository: Dsek-LTH/dsek-latex - path: TEX - - - name: Show Working directory - run: ls TEX - - - uses: xu-cheng/latex-action@v2 - with: - root_file: "*.tex" - glob_root_file: true - pre_compile: "cd TEX; for i in *.ins; do tex $i; done; cd .." - env: - TEXINPUTS: ".:./TEX//:" - - - uses: actions/upload-artifact@v2 - with: - name: PDF - path: "*.pdf" - - - uses: "marvinpinto/action-automatic-releases@latest" - with: - repo_token: "${{ secrets.GITHUB_TOKEN }}" - automatic_release_tag: "latest" - prerelease: false - files: | - *.pdf diff --git a/policyer/.github/workflows/pull_request.yml b/policyer/.github/workflows/pull_request.yml deleted file mode 100644 index cc2c14f..0000000 --- a/policyer/.github/workflows/pull_request.yml +++ /dev/null @@ -1,31 +0,0 @@ -name: Build LaTeX documents -on: - pull_request: - branches: - - "main" -jobs: - build_latex: - runs-on: ubuntu-latest - steps: - - name: Set up Git repository - uses: actions/checkout@v2 - - - name: Show Working directory - run: ls - - - name: Setup dsek latex - uses: actions/checkout@v2 - with: - repository: Dsek-LTH/dsek-latex - path: TEX - - - name: Show Working directory - run: ls TEX - - - uses: xu-cheng/latex-action@v2 - with: - root_file: "*.tex" - glob_root_file: true - pre_compile: "cd TEX; for i in *.ins; do tex $i; done; cd .." - env: - TEXINPUTS: ".:./TEX//:" diff --git a/reglemente/.github/workflows/pull_request.yml b/reglemente/.github/workflows/pull_request.yml deleted file mode 100644 index 6715b2a..0000000 --- a/reglemente/.github/workflows/pull_request.yml +++ /dev/null @@ -1,35 +0,0 @@ -name: Check build latex - -# Controls when the workflow will run -on: - pull_request: - branches: [ master ] - - # Allows you to run this workflow manually from the Actions tab - workflow_dispatch: - -jobs: - build_latex: - runs-on: ubuntu-latest - steps: - - name: Set up Git repository - uses: actions/checkout@v2 - - - name: Show Working directory - run: ls - - - name: Setup dsek latex - uses: actions/checkout@v2 - with: - repository: Dsek-LTH/dsek-latex - path: TEX - - - name: Show Working directory - run: ls TEX - - - uses: xu-cheng/latex-action@v2 - with: - root_file: "*.tex" - glob_root_file: true - env: - TEXINPUTS: ".:./TEX//:" diff --git a/reglemente/.github/workflows/push.yml b/reglemente/.github/workflows/push.yml deleted file mode 100644 index dd6dddf..0000000 --- a/reglemente/.github/workflows/push.yml +++ /dev/null @@ -1,48 +0,0 @@ -name: Build and publish latex - -# Controls when the workflow will run -on: - push: - branches: [ master ] - - # Allows you to run this workflow manually from the Actions tab - workflow_dispatch: - -jobs: - build_latex: - runs-on: ubuntu-latest - steps: - - name: Set up Git repository - uses: actions/checkout@v2 - - - name: Show Working directory - run: ls - - - name: Setup dsek latex - uses: actions/checkout@v2 - with: - repository: Dsek-LTH/dsek-latex - path: TEX - - - name: Show Working directory - run: ls TEX - - - uses: xu-cheng/latex-action@v2 - with: - root_file: "*.tex" - glob_root_file: true - env: - TEXINPUTS: ".:./TEX//:" - - - uses: actions/upload-artifact@v2 - with: - name: PDF - path: "*.pdf" - - - uses: "marvinpinto/action-automatic-releases@latest" - with: - repo_token: "${{ secrets.GITHUB_TOKEN }}" - automatic_release_tag: "latest" - prerelease: false - files: | - *.pdf diff --git a/riktlinjer/.github/workflows/build.yml b/riktlinjer/.github/workflows/build.yml deleted file mode 100644 index 0a0674a..0000000 --- a/riktlinjer/.github/workflows/build.yml +++ /dev/null @@ -1,44 +0,0 @@ -name: Build LaTeX documents -on: - push: - branches: - - "main" -jobs: - build_latex: - runs-on: ubuntu-latest - steps: - - name: Set up Git repository - uses: actions/checkout@v2 - - - name: Show Working directory - run: ls - - - name: Setup dsek latex - uses: actions/checkout@v2 - with: - repository: Dsek-LTH/dsek-latex - path: TEX - - - name: Show Working directory - run: ls TEX - - - uses: xu-cheng/latex-action@v2 - with: - root_file: "*.tex" - glob_root_file: true - pre_compile: "cd TEX; for i in *.ins; do tex $i; done; cd .." - env: - TEXINPUTS: ".:./TEX//:" - - - uses: actions/upload-artifact@v2 - with: - name: PDF - path: "*.pdf" - - - uses: "marvinpinto/action-automatic-releases@latest" - with: - repo_token: "${{ secrets.GITHUB_TOKEN }}" - automatic_release_tag: "latest" - prerelease: false - files: | - *.pdf diff --git a/riktlinjer/.github/workflows/pull_request.yml b/riktlinjer/.github/workflows/pull_request.yml deleted file mode 100644 index cc2c14f..0000000 --- a/riktlinjer/.github/workflows/pull_request.yml +++ /dev/null @@ -1,31 +0,0 @@ -name: Build LaTeX documents -on: - pull_request: - branches: - - "main" -jobs: - build_latex: - runs-on: ubuntu-latest - steps: - - name: Set up Git repository - uses: actions/checkout@v2 - - - name: Show Working directory - run: ls - - - name: Setup dsek latex - uses: actions/checkout@v2 - with: - repository: Dsek-LTH/dsek-latex - path: TEX - - - name: Show Working directory - run: ls TEX - - - uses: xu-cheng/latex-action@v2 - with: - root_file: "*.tex" - glob_root_file: true - pre_compile: "cd TEX; for i in *.ins; do tex $i; done; cd .." - env: - TEXINPUTS: ".:./TEX//:" diff --git a/stadgar/.github/workflows/build.yml b/stadgar/.github/workflows/build.yml deleted file mode 100644 index b9d08a3..0000000 --- a/stadgar/.github/workflows/build.yml +++ /dev/null @@ -1,43 +0,0 @@ -name: Build LaTeX documents -on: - push: - branches: - - "master" -jobs: - build_latex: - runs-on: ubuntu-latest - steps: - - name: Set up Git repository - uses: actions/checkout@v2 - - - name: Show Working directory - run: ls - - - name: Setup dsek latex - uses: actions/checkout@v2 - with: - repository: Dsek-LTH/dsek-latex - path: TEX - - - name: Show Working directory - run: ls TEX - - - uses: xu-cheng/latex-action@v2 - with: - root_file: "stadgar.tex" - glob_root_file: true - env: - TEXINPUTS: ".:./TEX//:" - - - uses: actions/upload-artifact@v2 - with: - name: PDF - path: "stadgar.pdf" - - - uses: "marvinpinto/action-automatic-releases@latest" - with: - repo_token: "${{ secrets.GITHUB_TOKEN }}" - automatic_release_tag: "latest" - prerelease: false - files: | - stadgar.pdf diff --git a/stadgar/.github/workflows/pull_request.yml b/stadgar/.github/workflows/pull_request.yml deleted file mode 100644 index fbcae89..0000000 --- a/stadgar/.github/workflows/pull_request.yml +++ /dev/null @@ -1,30 +0,0 @@ -name: Build LaTeX documents -on: - pull_request: - branches: - - "master" -jobs: - build_latex: - runs-on: ubuntu-latest - steps: - - name: Set up Git repository - uses: actions/checkout@v2 - - - name: Show Working directory - run: ls - - - name: Setup dsek latex - uses: actions/checkout@v2 - with: - repository: Dsek-LTH/dsek-latex - path: TEX - - - name: Show Working directory - run: ls TEX - - - uses: xu-cheng/latex-action@v2 - with: - root_file: "stadgar.tex" - glob_root_file: true - env: - TEXINPUTS: ".:./TEX//:" diff --git a/stadgar/.travis-backup.yml b/stadgar/.travis-backup.yml deleted file mode 100644 index f069e26..0000000 --- a/stadgar/.travis-backup.yml +++ /dev/null @@ -1,7 +0,0 @@ - -sudo: required -dist: trusty -before_install: -- sudo apt-get -qq update && sudo apt-get install -y --no-install-recommends texlive-full texlive-lang-swedish -script: -- pdflatex -interaction=nonstopmode -halt-on-error stadgar.tex \ No newline at end of file