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

Feature - Add github workflows for wiki generation #6188

Merged
merged 83 commits into from
May 20, 2024

Conversation

relent0r
Copy link
Contributor

@relent0r relent0r commented May 15, 2024

Description of the proposed changes

This PR adds workflows for the generation of wiki content.

At a high level it does the following.

  • Checks out the following repositories
    The-Balthazar/BrewWikiGen
    FAForever/fa - Sparse checkout
    FAForever/fa.wiki
  • Installs the ImageMagick software
  • Performs an image conversion of unit/stragetic icons from .dds to .png
  • Copies the wiki Run.lua to replace the Brewlan one
  • Performs the brewlan wiki generation via Run.lua
  • Pushes the generated content to the wiki repostiory

It is currently in draft pending functional testing and some more inline documentation. Requires changing repository references to official ones for production implementation.

Testing done on the proposed changes

Testing without production impact requires updating the repositories used to forked variants

Additional context

Checklist

  • Changes are annotated, including comments where useful
  • Changes are documented in the changelog for the next game version

@relent0r
Copy link
Contributor Author

And on a different note to make testing easier: you can output the entire wiki as an artifact when the job is done. See also the non-wiki changelog generation script that adds the changelog as an artifact. That way you can download and verify the output.

Thats good to know thanks.

I've done updates based on the above feedback.

Outstanding is the question about how to get the current version and how I could put this into the commit message for the wiki.

I've tested up to this point with the updates and it 'seems' good. I just need to update the triggers and repo references once we are happy to move forward.

if [ -d "wiki/generated" ]; then
if [ -d "wiki/generated/strategicicons" ]; then
rm -rf "wiki/generated/strategicicons"
# Process named arguments
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The changes to this and wiki/icons-convert-unit.sh should be reverted. They expect the repository as their working directory, which you can define in the script as a property.

Then the script by default populates the wiki/generated folder which is intentional. It's not the correct position; but that's not the goal of the script. The goal of the script is to create/convert the assets. You can then use additional, separate shell commands to move those assets to where you need them to be. This approach allows you to re-use the script over different workflows. In this workflow we use it to populate the wiki, in the next workflow we may use it to populate the client (hint, hint to Sheikah if you happen to read this).

Note that the generated folder is also included in the gitignore and therefore you can even run the scripts local on your computer.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah ok I didn't realize you could do that. I've reverted the argument code.

Based on testing I still need to make changes to these scripts though.

  1. The version of magick that is installed in linux doesn't have a magick executable. Just a convert and mogrify one.
  2. If the read command is at the end of the script it will fail the pipeline.


- name: Execute lua run
run: |
lua brew-wiki-gen/Run.lua --OutputDirectory="fa.wiki/" --WikiGeneratorDirectory="brew-wiki-gen/" --FADirectory="fa/"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How would you do this? The changes to the script don't have any impact if running locally since it will just use the defaults if the arguments are not specified. But given there are 3 separate locations that are being used (compared to the other where it is only interested in the current directory) I'm unsure how to avoid it without statically setting folder names in the script.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You're right; it may be better to just use the inputs here.

@relent0r
Copy link
Contributor Author

Moving out of draft as this is at a v1 point.

@relent0r relent0r marked this pull request as ready for review May 19, 2024 20:20
@Garanas Garanas merged commit acb7c3a into FAForever:deploy/fafdevelop May 20, 2024
5 checks passed
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.

None yet

3 participants