fix: Update todos #5
This file contains hidden or 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: Create Planner | |
on: | |
push: | |
branches: [ "main" ] | |
pull_request: | |
branches: [ "main" ] | |
workflow_dispatch: | |
inputs: | |
year: | |
type: string | |
description: What year to generate the planner for | |
cfg: | |
type: string | |
description: Configuration string to build. See README for details. | |
env: | |
cfg: "cfg/base.yaml,cfg/template_breadcrumb.yaml,cfg/rmpp.base.yaml,cfg/rmpp.breadcrumb.default.dailycal.yaml" | |
year: 2024 | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Set planner year | |
run: |- | |
echo "PLANNER_YEAR=$( | |
if [ ! -z "${{ github.event.inputs.year }}" ]; then | |
echo "${{ github.event.inputs.year }}" | |
else | |
echo "${{ env.year }}" | |
fi | |
)" >> $GITHUB_ENV | |
- name: Set Config | |
run: |- | |
echo "CFG=$( | |
if [ ! -z "${{ github.event.inputs.cfg }}" ]; then | |
echo "${{ github.event.inputs.cfg }}" | |
else | |
echo "${{ env.cfg }}" | |
fi | |
)" >> $GITHUB_ENV | |
- name: Set up Go | |
uses: actions/setup-go@v4 | |
with: | |
go-version: '1.20' | |
- name: Build | |
run: go build -v ./... | |
- name: Test | |
run: go test -v ./... | |
- name: Create latex docs | |
run: go run ./cmd/plannergen/plannergen.go --config "${{env.CFG}}" | |
env: | |
PLANNER_YEAR: "${{env.PLANNER_YEAR}}" | |
- name: Get latex filename | |
run: echo "FILENAME=$(echo "${{env.CFG}}" | rev | cut -d, -f1 | cut -d'/' -f 1 | cut -d'.' -f 2-99 | rev)" >> $GITHUB_OUTPUT | |
id: filename | |
- name: Compile LaTeX document | |
uses: dante-ev/latex-action@latest | |
with: | |
working_directory: out | |
root_file: ${{ steps.filename.outputs.FILENAME }}.tex | |
args: -xelatex -latexoption=-file-line-error -latexoption=-interaction=nonstopmode | |
- name: Output PDFs | |
uses: actions/upload-artifact@v4 | |
with: | |
name: ${{ steps.filename.outputs.FILENAME }}.pdf | |
path: out/${{ steps.filename.outputs.FILENAME }}.pdf | |
if-no-files-found: error |