Skip to content

Commit

Permalink
internal: Nix Support + CI Rewrite (#85)
Browse files Browse the repository at this point in the history
  • Loading branch information
kai-tub authored Jul 1, 2024
1 parent cad0255 commit 10b2a93
Show file tree
Hide file tree
Showing 18 changed files with 496 additions and 482 deletions.
1 change: 1 addition & 0 deletions .envrc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
use flake .#
113 changes: 33 additions & 80 deletions .github/workflows/build_and_release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,92 +3,45 @@ name: Build and Release
# Controls when the action will run. Triggers the workflow on push or pull request
# events but only for the master branch
on:
push:
paths:
- "**.tex"
- "**.yml"
- "**.sty"
branches: [ master ]
pull_request:
paths:
- "**.tex"
- "**.yml"
- "**.sty"
branches: [ master ]
- push
- pull_request

# A workflow run is made up of one or more jobs that can run sequentially or in parallel
jobs:
build:
name: Build all files
runs-on: ubuntu-latest
container:
image: ghcr.io/xu-cheng/texlive-small:latest
defaults:
run:
shell: sh
steps:
- name: Set up repo
uses: actions/checkout@v2
- name: Install missing packages
run: |
tlmgr update --self && tlmgr install --force --reinstall silence appendixnumberbeamer fira fontaxes mwe noto csquotes fontspec babel luatexja haranoaji haranoaji-extra --repository http://ftp.fau.de/ctan/systems/texlive/tlnet/
- name: Build minimal examples with pdfLaTeX
working-directory: minimal_examples/
run: |
ln -sf ../*.sty ./
ln -sf ../logos ./
latexmk -pdf -file-line-error -interaction=nonstopmode *.tex
- name: Remove pdfLaTeX results if compilation succeeds
working-directory: minimal_examples/
run: rm *.pdf
- name: Build minimal examples with LuaLaTeX
working-directory: minimal_examples/
run: |
ln -sf ../*.sty ./
ln -sf ../logos ./
latexmk -lualatex -file-line-error -interaction=nonstopmode *.tex
- name: Build multi-language examples with LuaLaTeX
working-directory: multi_lang_examples/
run: |
ln -sf ../*.sty ./
ln -sf ../logos ./
latexmk -lualatex -file-line-error -interaction=nonstopmode *.tex
- name: Build compare examples
working-directory: compare_examples/
run: |
ln -sf ../*.sty ./
ln -sf ../logos ./
latexmk -pdf -file-line-error -interaction=nonstopmode *example*.tex
- name: Build demo document
run: |
latexmk -pdf -file-line-error -interaction=nonstopmode beamertheme-pure-minimalistic-demo.tex
- name: PDFs to PNGs
uses: docker://frapsoft/fish:latest
with:
args: fish ./.github/workflows/convert_pdf_to_png.fish
if: github.event_name == 'push'
- name: Sync docs
uses: kai-tub/external-repo-sync-action@v1
with:
source-directory: "./"
include-patterns: "beamertheme-pure-minimalistic-demo.pdf *.png"
exclude-patterns: "*.tmp.png logos"
commit-message: "Updating LaTeX documentation files"
env:
GH_ACCESS_TOKEN: ${{ secrets.GH_ACCESS_TOKEN }}
if: github.event_name == 'push'
release:
name: Release new version
runs-on: ubuntu-latest
- uses: actions/checkout@v4
- uses: DeterminateSystems/nix-installer-action@main
- uses: DeterminateSystems/magic-nix-cache-action@main
- name: Run tests
run: nix flake check -L
publish:
name: Publish
needs: build
if: github.event_name == 'push'
runs-on: ubuntu-latest
permissions:
contents: write
if: startsWith(github.ref, 'refs/tags/')
steps:
- name: Set up Git
uses: actions/checkout@v2
- name: Prepare repository
run: git fetch --unshallow --tags
- name: Run release script
run: bash auto_scripts/run_auto.sh
env:
# To be able to trigger next event
GITHUB_TOKEN: ${{ secrets.GH_ACCESS_TOKEN }}
# only execute if a new release is created
- uses: actions/checkout@v4
- uses: DeterminateSystems/nix-installer-action@main
- uses: DeterminateSystems/magic-nix-cache-action@main
- run: nix build .#documentation-artifacts
- uses: actions/checkout@v4
with:
repository: kai-tub/latex-beamer-pure-minimalistic.wiki.git
path: wiki
- run: |
echo "Copy documentation results to wiki"
cp -r ./result wiki/
cd wiki
git config user.name "github-actions[bot]"
git config user.email "41898282+github-actions[bot]@users.noreply.github.com"
git add .
git commit -m "update wiki"
echo "annotate release if release triggered the workflow"
git tag --annotate --message "Release" ${{ github.ref_name }}
git push
52 changes: 0 additions & 52 deletions .github/workflows/convert_pdf_to_png.fish

This file was deleted.

2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
# cannot link to sty for windows support
result
.direnv
minimal_examples/*.sty
minimal_examples/*.pdf
minimal_examples/logos
Expand Down
22 changes: 0 additions & 22 deletions auto_scripts/README.md

This file was deleted.

6 changes: 0 additions & 6 deletions auto_scripts/run_auto.sh

This file was deleted.

Loading

0 comments on commit 10b2a93

Please sign in to comment.