Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ci: create build action for push/prs #129

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

PythiaUF
Copy link

@PythiaUF PythiaUF commented Oct 3, 2024

This PR creates a build action for any pushes or PRs done to the repository, packaging up the game so that testing the final result is as simple as downloading the right file for your platform (and doing some extracting steps).

For the End User

  • For commits and PRs, users will be able to go to the "Actions" tab of this repo and see builds for each commit. You can get a little peak of that on the forked repo - essentially, they can click on the title, can download the artifact for their system, and they are all set.
  • For commits, a green check will appear next to commits on the main and commits page, which if they press on, click "Details", then click on "Summary", they'll also be able to download the artifacts from there.
  • For PRs, a similar process can be done: click on the green checkmark that will appear next to them on the Pull Requests page and go through the same process. I don't have an example for this for this project, but I can point you to the Sodium for MC repo as an example.

Technical Details

  • Most of this is done through the Ren'Py CLI, which allows us to make distributions for platforms using it. We do have to set up the CLI using commands, as can be seen, but it's relatively easy to use after that.
    • The version is currently hardcoded into the Action file. This is probably not an issue for now, but may be in the future.
  • I likely could have made a small shell script to do what process.py does - it goes through the files generated from the CLI and renames/extracts them to make it easier to upload them to GitHub. That being said, I wanted the script to be dynamic and handle any number of inputs, and that didn't sound pleasant with Bash. GitHub doesn't care how long Actions run for public repos anyways, we should be good :P.
  • For Mac and Linux, the artifacts are a little... weird. They are zip files that contain another archive within them, which is likely to be annoying at best. However, when uploading files to be used as artifacts, GitHub strips permission data from files, which causes the game not to run. Doing this weird solution allows permissions to be kept during the upload.
    • Windows does not have proper file permissions (not any that would affect this), and so the archive can be (and is) a lot more normal. Yay for Windows?

Note

  • I haven't tested the resulting files on a Mac, though I did test the Windows and Linux files.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant