Skip to content

Commit

Permalink
Merge pull request #19 from chizmw/regenerate-png-examples-on-version…
Browse files Browse the repository at this point in the history
…-tag

Regenerate png examples on version tag
  • Loading branch information
chizmw authored Apr 17, 2023
2 parents 36cb045 + 76b4376 commit a6ff220
Show file tree
Hide file tree
Showing 8 changed files with 98 additions and 3 deletions.
5 changes: 5 additions & 0 deletions .changes/unreleased/Added-20230417-085011.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
kind: Added
body: showcase full-on jinx rendering
time: 2023-04-17T08:50:11.559488+01:00
custom:
GithubIssue: ""
72 changes: 72 additions & 0 deletions .github/workflows/generate-samples.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,72 @@
---
name: Generate PNG Samples

# yamllint disable rule:truthy
on:
push:
tags:
- '*'
workflow_dispatch:

jobs:
generate-samples:
runs-on: ubuntu-latest
steps:
- name: Setup Python
uses: actions/setup-python@v4
with:
python-version: '3.11'

- name: Setup Poetry
uses: abatilo/actions-poetry@v2
with:
poetry-version: 1.4.2

- name: Checkout
uses: actions/checkout@v3

- name: Get JSON
shell: bash
run: |
make grab-some-scripts
- name: Generate samples
shell: bash
env:
BOTC_PDF2IMAGE: yes-please
run: |
sudo apt-get install -y poppler-utils
make all-scripts
# and eventually we'll create a PR for this
# but we need to make sure we don't end up in a loop
# of generate -> new version -> generate -> new version ...

- name: Create Pull Request
id: cpr
uses: peter-evans/create-pull-request@v4
with:
title: Regenerate PNG sample images [auto-generated]
# add some labels
labels: automatic-pr, generate-pngs
# this is the name of the branch created to hold the changes for the
# PR
branch: generate-pngs/${{ github.sha }}
# just to be extra safe we specify that we want to merge into the
# default branch
base: ${{ github.event.repository.default_branch }}
# no need to keep the branch around after the PR is merged
delete-branch: true
# ignore any (accidental?) changes outside of the user_access/ dir
add-paths: |
generated/
# yamllint disable-line rule:line-length
# https://docs.github.com/en/actions/using-workflows/triggering-a-workflow#triggering-a-workflow-from-a-workflow
token: ${{ secrets.CHISEL_GITHUB_TOKEN }}

- name: Check outputs
if: ${{ steps.cpr.outputs.pull-request-number }}
# yamllint disable rule:line-length
run: |
echo "::notice::Pull Request Created - ${{ steps.cpr.outputs.pull-request-url }}"
# yamllint enable rule:line-length
22 changes: 20 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ These are just meant to be samples for easy viewing. For best results _generate

This shows how the official "starter" script looks.

<details open><summary>Trouble Brewing - Player Sheet</summary>
<details><summary>Trouble Brewing - Player Sheet</summary>
<a href="generated/Trouble Brewing/Trouble Brewing-p1.png"><img src="generated/Trouble Brewing/Trouble Brewing-p1.png" width="100%"></a>
</details>

Expand All @@ -89,7 +89,7 @@ This shows how the official "starter" script looks.

This was the script that made me aspire to better custom generated scripts.

<details open><summary>No Roles Barred - Player Sheet</summary>
<details><summary>No Roles Barred - Player Sheet</summary>
<a href="generated/No Roles Barred/No Roles Barred-p1.png"><img src="generated/No Roles Barred/No Roles Barred-p1.png" width="100%"></a>
</details>

Expand All @@ -101,6 +101,24 @@ This was the script that made me aspire to better custom generated scripts.
<a href="generated/No Roles Barred/No Roles Barred-p3.png"><img src="generated/No Roles Barred/No Roles Barred-p3.png" width="100%"></a>
</details>

#### Let's Test Some Jinxes

This script was generated purely to have something to test our output with
jinxes in a script. There are probably more than you'd really want, or have, in
a legit custom script so don't panic if it's slightly weird in places...

<details><summary>Let's Test Some Jinxes - Player Sheet</summary>
<a href="generated/Let's Test Some Jinxes/Let's Test Some Jinxes-p1.png"><img src="generated/Let's Test Some Jinxes/Let's Test Some Jinxes-p1.png" width="100%"></a>
</details>

<details><summary>Let's Test Some Jinxes - First Night</summary>
<a href="generated/Let's Test Some Jinxes/Let's Test Some Jinxes-p2.png"><img src="generated/Let's Test Some Jinxes/Let's Test Some Jinxes-p2.png" width="100%"></a>
</details>

<details><summary>Let's Test Some Jinxes - Other Nights</summary>
<a href="generated/Let's Test Some Jinxes/Let's Test Some Jinxes-p3.png"><img src="generated/Let's Test Some Jinxes/Let's Test Some Jinxes-p3.png" width="100%"></a>
</details>

#### Reptiles!

This is a custom script that I've played, and it turns out this is a good test of "cramming things into one page" and using Top Sekrit data from the generated script.
Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file not shown.
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[tool.poetry]
name = "botc-json2pdf"
version = "0.0.13"
version = "0.0.14a0"
description = ""
authors = ["Chisel <[email protected]>"]
readme = "README.md"
Expand Down

0 comments on commit a6ff220

Please sign in to comment.