TheLastScrub / delta-green-foundry-vtt-system

A Foundry VTT game system for Delta Green: The RPG! This is a fan made work that is unaffiliated with Shane Ivey or Arc Dream Publishing, published under the Delta Green Community license. http://www.delta-green.com https://foundryvtt.com/
MIT License
25 stars 23 forks source link

Build packs on release #83

Closed jalensailin closed 1 year ago

jalensailin commented 1 year ago

Special thanks to @aMediocreDad for the help on this issue.

Some users had noticed issues regarding The Forge (See #82). This seems to be related to the fact that we do not include the v11 packs with the system. Instead we just provide the v10 packs and let foundry do the rest. This seems to be fine with no user-facing issues on self-hosted instances, but errored on The Forge, requiring a workaround.

The actual solution is to provide the v11 packs with the system. However, these are binary files and Foundry constantly makes changes to them. Thus when Foundry is open and we are doing development work, all the changes to these files clog up git.

So, the actual actual solution is to use Foundry's CLI to extract these packs into human readable json files, and then package them back up into their binary form when we do a release. After much trial and error, this PR does exactly that, utilizing Github Actions.

Not only does this solve the above issue, but it also allows us to edit the packs directly in the code, without having to work with hard-to-read .db files. Note, you will not see changes appear automatically in-game when editing the .jsons. You will first have to package them using the Foundry CLI. Look at .github/workflows/buildPacks.yml to see the commands for packaging compendia. Future work should involve writing a shell script that packages all the compendia at once.

To Test:

  1. Create a release off of this branch and choose the new tag: "v1.2.6"
  2. Make sure to mark this release as "Pre-release"
  3. Publish the release.
  4. Navigate to the Actions tab in the repo, and see that a job is running.
  5. Wait for the job to succeed and finish.
  6. Go back to the release that you just cut.
  7. See that a deltagreen.zip was added to the release.
  8. Download this zip file and inspect it. It should contain no folders/files starting with .git, nor should it contain packs/source, nor should it contain any v10 .db files. It should be about 7.8mb large.
  9. Go to a non-development instance of Foundry. Delete any current Delta Green system.
  10. Install via this branch's manifest link: https://raw.githubusercontent.com/TheLastScrub/delta-green-foundry-vtt-system-unofficial/jalenml/build-compendia/system.json
  11. Open a world in the system that just downloaded. Check compendia packs and ensure they are there / function as expected.
  12. Delete the release you just made.
  13. Delete the tag you just made.

IMPORTANT! Do steps 12 and 13 before merging, because we want to use the v1.2.6 tag for the next release but we want to make sure it is made off of the master branch. We will repeat step 1 once this is merged.