diff --git a/.github/workflows/main.yaml b/.github/workflows/main.yaml index 87a23e9..745e138 100644 --- a/.github/workflows/main.yaml +++ b/.github/workflows/main.yaml @@ -6,30 +6,89 @@ permissions: jobs: build: + env: + TYPST_FONT_PATHS: ./fonts runs-on: ubuntu-latest steps: - name: Checkout uses: actions/checkout@v4 - - name: Typst - uses: lvignoli/typst-action@main - env: - TYPST_FONT_PATHS: ./fonts + - name: Render Rules + uses: leana8959/typst-action@main + with: + source_file: | + Game of Intrigue.typ + options: | + --input=render_type=single + - run: | + mkdir -p out + mv Game\ of\ Intrigue.pdf out/Game\ of\ Intrigue.pdf + + - name: Render Single + uses: leana8959/typst-action@main with: source_file: | cards.typ cards_abstract.typ - Game of Intrigue.typ + options: | + --input=render_type=single + + - run: | + mkdir -p out/cards/single + mv cards.pdf out/cards/single/cards.pdf + mv cards_abstract.pdf out/cards/single/cards_abstract.pdf + + - name: Render Single Foldable + uses: leana8959/typst-action@main + with: + source_file: | + cards.typ + cards_abstract.typ + options: | + --input=render_type=single_foldable + + - run: | + mkdir -p out/cards/single_foldable + mv cards.pdf out/cards/single_foldable/cards.pdf + mv cards_abstract.pdf out/cards/single_foldable/cards_abstract.pdf + + - name: Render Foldable + uses: leana8959/typst-action@main + with: + source_file: | + cards.typ + cards_abstract.typ + options: | + --input=render_type=foldable + + - run: | + mkdir -p out/cards/foldable + mv cards.pdf out/cards/foldable/cards.pdf + mv cards_abstract.pdf out/cards/foldable/cards_abstract.pdf + + - name: Render Double Sided + uses: leana8959/typst-action@main + with: + source_file: | + cards.typ + cards_abstract.typ + options: | + --input=render_type=double_sided + + - run: | + mkdir -p out/cards/double_sided + mv cards.pdf out/cards/double_sided/cards.pdf + mv cards_abstract.pdf out/cards/double_sided/cards_abstract.pdf - - name: Upload PDF file + - name: Upload Files uses: actions/upload-artifact@v4 with: name: Game of Intrigue - path: "*.pdf" + path: "out/**" - name: Release uses: softprops/action-gh-release@v2 if: github.ref_type == 'tag' with: name: "${{ github.ref_name }}" - files: "*.pdf" + files: "out/**" diff --git a/cards.typ b/cards.typ index 9dfe3a6..32209b9 100644 --- a/cards.typ +++ b/cards.typ @@ -303,4 +303,4 @@ } // Render -#render_foldable(render_card, render_card_back) \ No newline at end of file +#render(sys.inputs.render_type, render_card, render_card_back) \ No newline at end of file diff --git a/cards_abstract.typ b/cards_abstract.typ index 04a73e3..e96540c 100644 --- a/cards_abstract.typ +++ b/cards_abstract.typ @@ -4,7 +4,7 @@ #let render_card(type, value: none, illegal: false, color: none, cut_guide: true, supertitle: none) = { let has_supertitle = supertitle != none and display_supertitle let is_role = supertitle == "Role" - set text(font: "Proxima Nova", weight: "medium") + set text(font: "Inter Tight", weight: "medium") box( width: card_width, height: card_height, @@ -223,7 +223,7 @@ } #let render_card_back(value: none, illegal: false, cut_guide: true, role: false) = { - set text(font: "Proxima Nova", weight: "medium") + set text(font: "Inter Tight", weight: "medium") box( width: card_width, height: card_height, @@ -314,4 +314,4 @@ } // Render -#render_foldable(render_card, render_card_back) \ No newline at end of file +#render(sys.inputs.render_type, render_card, render_card_back) \ No newline at end of file diff --git a/render.typ b/render.typ index dcd9627..0e002d2 100644 --- a/render.typ +++ b/render.typ @@ -294,4 +294,16 @@ } } ).flatten()) +} + +#let render(render_type, render_card, render_card_back) = { + if render_type == "single" { + render_single(render_card, render_card_back) + } else if render_type == "single_foldable" { + render_single_foldable(render_card, render_card_back) + } else if render_type == "foldable" { + render_foldable(render_card, render_card_back) + } else if render_type == "double_sided" { + render_double_sided(render_card, render_card_back) + } } \ No newline at end of file