Small tweaks #41
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Build game PDFs | |
on: | |
push: | |
branches: [ "main" ] | |
paths: | |
- 'games/*.yaml' | |
- '.github/workflows/update-release.yaml' | |
- 'src/*.rs' | |
workflow_dispatch: | |
env: | |
CARGO_TERM_COLOR: always | |
jobs: | |
build-calendars: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v3 | |
- name: Cache dependencies | |
uses: actions/cache@v3 | |
with: | |
path: | | |
~/.cargo/bin/ | |
~/.cargo/registry/index/ | |
~/.cargo/registry/cache/ | |
~/.cargo/git/db/ | |
/usr/bin/pdflatex | |
target/ | |
key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }} | |
- name: Install pdflatex | |
run: | | |
sudo apt-get install texlive-latex-recommended texlive-latex-extra | |
shell: sh | |
# - name: Setup tlmgr | |
# run: sudo tlmgr init-usertree | |
# shell: sh | |
# - name: Update tlmgr | |
# run: | | |
# export PATH=:$PATH/usr/local/texlive/2020/bin/x86_64-linux | |
# export MANPATH=/usr/local/texlive/2020/texmf-dist/doc/man | |
# export INFOPATH=/usr/local/texlive/2020/texmf-dist/doc/info | |
# curl -L https://mirror.ctan.org/systems/texlive/tlnet/update-tlmgr-latest.sh > update-tlmgr-latest.sh | |
# chmod +x update-tlmgr-latest.sh | |
# ./update-tlmgr-latest.sh -- --update | |
# shell: sh | |
# - name: Install tex packages | |
# run: | | |
# sudo tlmgr --usermode --verify-repo=none install geometry xcolor | |
# shell: sh | |
- name: Cargo build | |
uses: actions-rs/cargo@v1 | |
with: | |
command: build | |
args: --release | |
- name: Cargo run | |
run: cargo run --release games/*.yaml | |
shell: sh | |
- run: which pdflatex | |
shell: sh | |
- name: List all games to GH variable | |
run: echo "::set-output name=LS_GAMES::$(ls pdfs/* | xargs echo | sed 's/.pdf /.pdf, /g')" | |
id: LS-GAMES | |
- name: Check the listed games | |
run: echo ${{ steps.LS-GAMES.outputs.LS_GAMES }} | |
shell: sh | |
- name: Update latest release with new games | |
uses: beyarkay/update-existing-release@master | |
with: | |
token: ${{ github.token }} | |
release: Latest card game PDFs | |
updateTag: true | |
tag: latest | |
replace: true | |
files: ${{ steps.LS-GAMES.outputs.LS_GAMES }} | |
body: "This release contains the latest card games as PDF files" |