From 99725b8e267004878f5286bf2ac87902a3ace1fd Mon Sep 17 00:00:00 2001 From: Dandaedre Date: Thu, 20 Aug 2026 22:19:34 +0200 Subject: [PATCH] CI --- Jenkinsfile | 49 +++++++++++++++++++++++++++++++------------------ Readme.md | 2 ++ 2 files changed, 33 insertions(+), 18 deletions(-) diff --git a/Jenkinsfile b/Jenkinsfile index 386b229..0e08f36 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -8,6 +8,9 @@ pipeline { SOURCE_FILE = "main.typ" OUTPUT_FILE = "Ravenous_build.pdf" PUBLISHED_FILE = "Ravenous.pdf" + BALANCE_SOURCE_FILE = "balance_report.typ" + BALANCE_OUTPUT_FILE = "Ravenous_balance_report_build.pdf" + BALANCE_PUBLISHED_FILE = "Ravenous_balance_report.pdf" // Important: published books live under /mnt/books DEPLOY_DIR = "/mnt/books/Ravenous" @@ -50,7 +53,7 @@ pipeline { } } - stage('Build Book') { + stage('Build PDFs') { steps { sh ''' set -e @@ -61,24 +64,28 @@ pipeline { echo "Building ${SOURCE_FILE} -> ${OUTPUT_FILE}" typst compile "${SOURCE_FILE}" "${OUTPUT_FILE}" - test -f "${OUTPUT_FILE}" + echo "Building ${BALANCE_SOURCE_FILE} -> ${BALANCE_OUTPUT_FILE}" + typst compile "${BALANCE_SOURCE_FILE}" "${BALANCE_OUTPUT_FILE}" - echo "Build complete:" - ls -lh "${OUTPUT_FILE}" + test -f "${OUTPUT_FILE}" + test -f "${BALANCE_OUTPUT_FILE}" + + echo "Builds complete:" + ls -lh "${OUTPUT_FILE}" "${BALANCE_OUTPUT_FILE}" ''' } } - stage('Archive Book') { + stage('Archive PDFs') { steps { archiveArtifacts( - artifacts: "${OUTPUT_FILE}", + artifacts: "${OUTPUT_FILE},${BALANCE_OUTPUT_FILE}", fingerprint: true ) } } - stage('Deploy Book') { + stage('Deploy PDFs') { steps { script { def reviewBranches = [ @@ -120,24 +127,24 @@ pipeline { publishChecks( conclusion: 'SUCCESS', name: 'Build Successful', - summary: 'The Ravenous rulebook was built successfully.', - text: 'Typst compilation and publication succeeded.', + summary: 'The Ravenous rulebook and balance report were built successfully.', + text: 'The rulebook and balance report were compiled and published successfully.', title: 'Build Successful' ) - echo '✅ Ravenous book built and published!' + echo '✅ Ravenous book and balance report built and published!' } failure { publishChecks( conclusion: 'FAILURE', name: 'Build Failed', - summary: 'The Ravenous rulebook build failed.', - text: 'Typst compilation or publication failed.', + summary: 'A Ravenous PDF build or deployment failed.', + text: 'Rulebook or balance-report compilation/publication failed.', title: 'Build Failed' ) - echo '❌ Ravenous book failed to build or publish.' + echo '❌ A Ravenous PDF failed to build or publish.' } unstable { @@ -156,10 +163,10 @@ pipeline { /** - * Publish the generated Ravenous PDF. + * Publish the generated Ravenous PDFs. * - * The build artifact remains named Ravenous_build.pdf in Jenkins, - * while the published copy always has the stable Ravenous.pdf name. + * Build artifacts retain explicit CI names in Jenkins, while published copies + * use stable rulebook and balance-report names. * * @param targetDir Directory receiving the compiled book. */ @@ -167,7 +174,7 @@ def deployTo(String targetDir) { sh """ set -e - echo "Publishing Ravenous to ${targetDir}" + echo "Publishing Ravenous and its balance report to ${targetDir}" mkdir -p "${targetDir}" @@ -175,7 +182,13 @@ def deployTo(String targetDir) { "${env.OUTPUT_FILE}" \ "${targetDir}/${env.PUBLISHED_FILE}" + rsync -a \ + "${env.BALANCE_OUTPUT_FILE}" \ + "${targetDir}/${env.BALANCE_PUBLISHED_FILE}" + echo "Published:" - ls -lh "${targetDir}/${env.PUBLISHED_FILE}" + ls -lh \ + "${targetDir}/${env.PUBLISHED_FILE}" \ + "${targetDir}/${env.BALANCE_PUBLISHED_FILE}" """ } diff --git a/Readme.md b/Readme.md index 229f0e4..9c89241 100644 --- a/Readme.md +++ b/Readme.md @@ -10,6 +10,7 @@ Install [Typst](https://typst.app/docs/reference/), clone the repository with it git clone --recurse-submodules cd ravenous_typst typst compile main.typ main.pdf +typst compile balance_report.typ balance_report.pdf ``` For live rebuilding while editing, use: @@ -28,6 +29,7 @@ typst compile main.typ main.pdf ## Project layout - `main.typ` is the rulebook entry point. +- `balance_report.typ` is the automatically generated balance-analysis report. - `chapters/` contains the book's content. - `setup/` contains shared styles, models, and macros. - `images/` and `data/` contain supporting assets and game data.