Note: this doc is intended for maintainers. If you're a player, you don't need to read and understand this.
There are a few scenarios this repository covers:
- Player modifies
heroes.json, runs the build locally to verify the change.- Run
./gradlew run, the files are generated at./build.
- Run
- Player modifies
heroes.json, then creates PR.rememeber-brave-peopleGitHub workflow is triggered.- This is executed in Docker container to make it super fast.
- If there are any changes other than
heroes.json, fail. - Checks the changes are legitimate, for example, you can't overwrite other people's tile.
- Generate new data based on existing
brave-people.png/brave-people-info.json. - Commit and push new data to
brave-people.png/brave-people-info.json.
- When the workflow starts, ByteLegend webhook is triggered to display animation in the game page.
- If the workflow fails, display failure animation.
- Otherwise,
ByteLegendBotmerges the PR, says congratulations to the player.
- A daily trigger refreshes
brave-people.png/brave-people-info.jsonand upload them to GitHub (we usedatabranch as the storage). - Player helps improve the code, makes changes other than
heroes.json, then creates PR.checkGitHub workflow is triggered../gradlew checkis executed to make sure nothing breaks.- Wait for the administrator approve and merge manually.
- Update the docker image manually after changes to production code.
- TODO: this is triggered manually now. We can make
ByteLegendBotdo this. - TODO: we should update the data after changes to production code.
- TODO: this is triggered manually now. We can make
remember-brave-people: triggered upon PR with changes onheroes.json.- If there are changes other than
heroes.json, cancel the workflow. - Otherwise, do
sanityCheck, make sure the player only change allowed part. - Generate the new image and JSON at
build/brave-people.png/build/brave-people-output.json - Move
build/brave-people.pngto root directory, commit and push. - Push
build/brave-people.png/build/brave-people-output.jsonto CDN so the player can see it in the game. - Merge current branch to
main.
- If there are changes other than
check: triggered upon PR with changes other thanheroes.json.- Run
testto make sure nothing is broken. - Wait for administrator review and merge the PR.
- Run
refresh-data-daily: for better performance,remember-brave-peopleonly writes the modified tile, not all. This job runs per day to refresh the data.