Skip to content

Commit

Permalink
Release Test
Browse files Browse the repository at this point in the history
  • Loading branch information
Lypsilonx committed May 17, 2024
1 parent e2cdb9f commit 2bd727f
Show file tree
Hide file tree
Showing 4 changed files with 81 additions and 10 deletions.
75 changes: 67 additions & 8 deletions .github/workflows/main.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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 Double
uses: leana8959/typst-action@main
with:
source_file: |
cards.typ
cards_abstract.typ
options: |
--input=render_type="double"
- run: |
mkdir -p out/cards/double
mv cards.pdf out/cards/double/cards.pdf
mv cards_abstract.pdf out/cards/double/cards_abstract.pdf
- name: Render Double Foldable
uses: leana8959/typst-action@main
with:
source_file: |
cards.typ
cards_abstract.typ
options: |
--input=render_type="double_foldable"
- run: |
mkdir -p out/cards/double_foldable
mv cards.pdf out/cards/double_foldable/cards.pdf
mv cards_abstract.pdf out/cards/double_foldable/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/**"
2 changes: 1 addition & 1 deletion cards.typ
Original file line number Diff line number Diff line change
Expand Up @@ -303,4 +303,4 @@
}

// Render
#render_foldable(render_card, render_card_back)
#render(sys.inputs.render_type, render_card, render_card_back)
2 changes: 1 addition & 1 deletion cards_abstract.typ
Original file line number Diff line number Diff line change
Expand Up @@ -314,4 +314,4 @@
}

// Render
#render_foldable(render_card, render_card_back)
#render(sys.inputs.render_type, render_card, render_card_back)
12 changes: 12 additions & 0 deletions render.typ
Original file line number Diff line number Diff line change
Expand Up @@ -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)
}
}

0 comments on commit 2bd727f

Please sign in to comment.