From 292203ea9089c9f6efe09a6907c5b9945299a7ef Mon Sep 17 00:00:00 2001 From: jalensailin Date: Thu, 28 Aug 2025 18:40:30 -0400 Subject: [PATCH 1/6] add 2 new issue templates --- .github/ISSUE_TEMPLATE/request-for-comment.md | 24 +++++++++++++++++++ .github/ISSUE_TEMPLATE/tech-debt.md | 24 +++++++++++++++++++ 2 files changed, 48 insertions(+) create mode 100644 .github/ISSUE_TEMPLATE/request-for-comment.md create mode 100644 .github/ISSUE_TEMPLATE/tech-debt.md diff --git a/.github/ISSUE_TEMPLATE/request-for-comment.md b/.github/ISSUE_TEMPLATE/request-for-comment.md new file mode 100644 index 0000000..ffb56f3 --- /dev/null +++ b/.github/ISSUE_TEMPLATE/request-for-comment.md @@ -0,0 +1,24 @@ +--- +name: RFC (Request for comment) +about: Propose a larger-scope change for discussion and approval +title: "RFC: Short & descriptive title" +labels: request for comment +assignees: "" +--- + +## Summary + + + +## Motivation + + + +## Proposed solution + + + +## Impact + +- [ ] Would include breaking changes +- Affected areas: diff --git a/.github/ISSUE_TEMPLATE/tech-debt.md b/.github/ISSUE_TEMPLATE/tech-debt.md new file mode 100644 index 0000000..ec29d2e --- /dev/null +++ b/.github/ISSUE_TEMPLATE/tech-debt.md @@ -0,0 +1,24 @@ +--- +name: Tech debt +about: Track refactors or maintenance tasks. Typically for devs only. +title: Short & descriptive title +labels: tech debt +assignees: "" +--- + +## What is the debt? + + + +## Why fix it? + + + +## Proposed change + + + +## Checklist + +- [ ] No unexpected user-visible changes (or note them) +- [ ] Tests/docs updated if needed From 0092de6ebf3b70f252c08d3829fc7200de9fe374 Mon Sep 17 00:00:00 2001 From: jalensailin Date: Thu, 28 Aug 2025 18:41:29 -0400 Subject: [PATCH 2/6] rename templates with leading numerals for order --- .github/ISSUE_TEMPLATE/{bug-report.md => 01-bug-report.md} | 0 .../ISSUE_TEMPLATE/{feature_request.md => 02-feature-request.md} | 0 .../{request-for-comment.md => 03-request-for-comment.md} | 0 .github/ISSUE_TEMPLATE/{tech-debt.md => 04-tech-debt.md} | 0 4 files changed, 0 insertions(+), 0 deletions(-) rename .github/ISSUE_TEMPLATE/{bug-report.md => 01-bug-report.md} (100%) rename .github/ISSUE_TEMPLATE/{feature_request.md => 02-feature-request.md} (100%) rename .github/ISSUE_TEMPLATE/{request-for-comment.md => 03-request-for-comment.md} (100%) rename .github/ISSUE_TEMPLATE/{tech-debt.md => 04-tech-debt.md} (100%) diff --git a/.github/ISSUE_TEMPLATE/bug-report.md b/.github/ISSUE_TEMPLATE/01-bug-report.md similarity index 100% rename from .github/ISSUE_TEMPLATE/bug-report.md rename to .github/ISSUE_TEMPLATE/01-bug-report.md diff --git a/.github/ISSUE_TEMPLATE/feature_request.md b/.github/ISSUE_TEMPLATE/02-feature-request.md similarity index 100% rename from .github/ISSUE_TEMPLATE/feature_request.md rename to .github/ISSUE_TEMPLATE/02-feature-request.md diff --git a/.github/ISSUE_TEMPLATE/request-for-comment.md b/.github/ISSUE_TEMPLATE/03-request-for-comment.md similarity index 100% rename from .github/ISSUE_TEMPLATE/request-for-comment.md rename to .github/ISSUE_TEMPLATE/03-request-for-comment.md diff --git a/.github/ISSUE_TEMPLATE/tech-debt.md b/.github/ISSUE_TEMPLATE/04-tech-debt.md similarity index 100% rename from .github/ISSUE_TEMPLATE/tech-debt.md rename to .github/ISSUE_TEMPLATE/04-tech-debt.md From d1abf55df46a06d0ac3fb840ae43048fccbe4210 Mon Sep 17 00:00:00 2001 From: jalensailin Date: Thu, 28 Aug 2025 23:19:42 -0400 Subject: [PATCH 3/6] Rename buildPacks.yml to prep for generalizing --- .github/workflows/{buildPacks.yml => publish-prod-release.yml} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename .github/workflows/{buildPacks.yml => publish-prod-release.yml} (100%) diff --git a/.github/workflows/buildPacks.yml b/.github/workflows/publish-prod-release.yml similarity index 100% rename from .github/workflows/buildPacks.yml rename to .github/workflows/publish-prod-release.yml From 53c4c669588fe9f0f3c8eba881ea4a92326e345f Mon Sep 17 00:00:00 2001 From: jalensailin Date: Fri, 29 Aug 2025 00:09:58 -0400 Subject: [PATCH 4/6] Generalize buildPacks for reusability --- .github/actions/build-packs/action.yml | 11 +++++ .github/workflows/publish-prod-release.yml | 55 ++++++++++------------ build/build-packs.sh | 10 ++++ 3 files changed, 47 insertions(+), 29 deletions(-) create mode 100644 .github/actions/build-packs/action.yml create mode 100755 build/build-packs.sh diff --git a/.github/actions/build-packs/action.yml b/.github/actions/build-packs/action.yml new file mode 100644 index 0000000..ec50a58 --- /dev/null +++ b/.github/actions/build-packs/action.yml @@ -0,0 +1,11 @@ +name: "Build Compendium Packs" +description: "Builds the compendium pack binaries from source JSON files" +runs: + using: "composite" + steps: + - name: Node Setup + uses: ./.github/actions/setup-node + + - name: Build Compendium Packs + run: ./build/build-packs.sh + shell: bash diff --git a/.github/workflows/publish-prod-release.yml b/.github/workflows/publish-prod-release.yml index 783d113..1bb64bc 100644 --- a/.github/workflows/publish-prod-release.yml +++ b/.github/workflows/publish-prod-release.yml @@ -1,59 +1,52 @@ # This is a basic workflow that is manually triggered -name: Build Packs +name: Release # Controls when the action will run. Workflow runs when release is published. on: release: types: [published] +# Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages +permissions: + contents: write + # A workflow run is made up of one or more jobs that can run sequentially or in parallel jobs: # This workflow contains a single job called buildPacks - buildPacks: + release: # The type of runner that the job will run on. This must be ubuntu for the zip command to work. runs-on: ubuntu-latest - # Steps represent a sequence of tasks that will be executed as part of the job steps: - # Each step runs a single command using the runners shell. - # 1. Checkout our repository so we can do things on it. - name: Checkout uses: actions/checkout@v4 - # 2. Make sure node is set up. This may be an unecessary step. - - name: Node Setup - uses: actions/setup-node@v3 - with: - node-version: 18 - # 3. Install the FoundryVTT CLI. - - run: npm install -g @foundryvtt/foundryvtt-cli - # 4. Configure the datapath as the github workspace variable. - - run: fvtt configure set "dataPath" ${GITHUB_WORKSPACE} - # 5. Tell the FVTT CLI that we are working on a "system" package. - - run: fvtt package workon fvtt package workon "deltagreen" --type "System" - # 6-11. Package each folder of source json files into the appropriate LevelDB pack. - - run: fvtt package pack "armor" --in "packs/source/armor" --out "packs" - - run: fvtt package pack "firearms" --in "packs/source/firearms" --out "packs" - - run: fvtt package pack "hand-to-hand-weapons" --in "packs/source/hand-to-hand-weapons" --out "packs" - - run: fvtt package pack "operation-code-name-generator" --in "packs/source/operation-code-name-generator" --out "packs" - - run: fvtt package pack "operation-code-name-generator-macro" --in "packs/source/operation-code-name-generator-macro" --out "packs" - - run: fvtt package pack "pregens" --in "packs/source/pregens" --out "packs" - # 12. Get the version number without the leading -v. + + - name: Build Packs + uses: ./.github/actions/build-packs + - name: Get Version id: get_version uses: dhkatz/get-version-action@v3.0.0 - # 13. Substitute the Manifest and Download URLs in the system.json + - name: Substitute Manifest, Download Links For Versioned Ones uses: TomaszKandula/variable-substitution@v1.0.1 with: files: "system.json" env: + flags: "" version: ${{steps.get_version.outputs.version-without-v}} download: https://github.com/${{github.repository}}/releases/download/${{github.event.release.tag_name}}/deltagreen.zip - # 14. Zip up the branch with the LevelDB packs. + - name: Zip - # Exclude the source json files from the final package, as well as any git folders. - run: zip -r deltagreen.zip . --exclude="*packs/source/*" --exclude=".*" --exclude="package-lock.json" --exclude="package.json" - # 15. Updates the release with the newly zipped branch. See documentation of this action for details. + run: | + zip -r deltagreen.zip . \ + -x "packs/source/*" \ + -x "build/*" \ + -x ".*" \ + -x "package.json" \ + -x "package-lock.json" \ + -x "node_modules/*" + - name: Update Release with Artifacts uses: ncipollo/release-action@v1.13.0 with: @@ -63,3 +56,7 @@ jobs: body: ${{ github.event.release.body }} artifacts: "./deltagreen.zip, ./system.json" token: ${{ secrets.GITHUB_TOKEN }} + +defaults: + run: + shell: bash diff --git a/build/build-packs.sh b/build/build-packs.sh new file mode 100755 index 0000000..3bd8ef8 --- /dev/null +++ b/build/build-packs.sh @@ -0,0 +1,10 @@ +#!/usr/bin/env bash +set -euo pipefail +IFS=$'\n\t' + +npx --no-install fvtt package workon "deltagreen" --type "System" + +for folder in packs/source/*; do + name=$(basename $folder) + npx --no-install fvtt package pack "$name" --in "$folder" --out "packs" +done From f2461609b69a16d3b7e0a0e9f184355c6bd24007 Mon Sep 17 00:00:00 2001 From: jalensailin Date: Fri, 29 Aug 2025 00:13:44 -0400 Subject: [PATCH 5/6] Add `publish-dev-release` workflow --- .github/workflows/publish-dev-release.yml | 55 +++++++++++++++++++++++ 1 file changed, 55 insertions(+) create mode 100644 .github/workflows/publish-dev-release.yml diff --git a/.github/workflows/publish-dev-release.yml b/.github/workflows/publish-dev-release.yml new file mode 100644 index 0000000..2e6caf5 --- /dev/null +++ b/.github/workflows/publish-dev-release.yml @@ -0,0 +1,55 @@ +name: Dev Build (GitHub Pages) + +on: + push: + branches: [$default-branch] + workflow_dispatch: + +# Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages +permissions: + contents: read + pages: write + id-token: write + +# Allow only one concurrent deployment, skipping runs queued between the run in-progress and latest queued. +# However, do NOT cancel in-progress runs as we want to allow these production deployments to complete. +concurrency: + group: "pages" + cancel-in-progress: false + +jobs: + deploy: + runs-on: ubuntu-latest + + steps: + - name: Checkout + uses: actions/checkout@v4 + + - name: Build Packs + uses: ./.github/actions/build-packs + + - name: Substitute Download Link + uses: TomaszKandula/variable-substitution@v1.0.1 + with: + files: "system.json" + env: + download: https://${{ github.repository_owner }}.github.io/${{ github.event.repository.name }}/dev/deltagreen.zip + + - name: Copy system.json + run: mkdir dist && cp system.json dist/dev-system.json + + - name: Zip + run: zip -r dist/deltagreen.zip . -x "packs/source/*" -x "build/*" -x ".*" -x "package.json" -x "package-lock.json" + + # Deploy to GitHub Pages (see https://github.com/actions/starter-workflows/blob/main/pages/static.yml) + - name: Setup Pages + uses: actions/configure-pages@v5 + + - name: Upload artifact + uses: actions/upload-pages-artifact@v3 + with: + path: "dist" + + - name: Deploy to GitHub Pages + id: deployment + uses: actions/deploy-pages@v4 From 1f2a9034329766958ccd83ea63987e4338e49f99 Mon Sep 17 00:00:00 2001 From: jalensailin Date: Fri, 29 Aug 2025 00:26:26 -0400 Subject: [PATCH 6/6] Update dev release workflow --- .github/workflows/publish-dev-release.yml | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/.github/workflows/publish-dev-release.yml b/.github/workflows/publish-dev-release.yml index 2e6caf5..6d4ad43 100644 --- a/.github/workflows/publish-dev-release.yml +++ b/.github/workflows/publish-dev-release.yml @@ -39,7 +39,14 @@ jobs: run: mkdir dist && cp system.json dist/dev-system.json - name: Zip - run: zip -r dist/deltagreen.zip . -x "packs/source/*" -x "build/*" -x ".*" -x "package.json" -x "package-lock.json" + run: | + zip -r dist/deltagreen.zip . \ + -x "packs/source/*" \ + -x "build/*" \ + -x ".*" \ + -x "package.json" \ + -x "package-lock.json" \ + -x "node_modules/*" # Deploy to GitHub Pages (see https://github.com/actions/starter-workflows/blob/main/pages/static.yml) - name: Setup Pages