ci(workflows): ✨ added Minecraft screenshot example workflow#810
ci(workflows): ✨ added Minecraft screenshot example workflow#810
Conversation
Co-authored-by: caunt <5324218+caunt@users.noreply.github.com>
|
@copilot add "on pull_request:" temporary trigger |
…orkflow Co-authored-by: caunt <5324218+caunt@users.noreply.github.com>
Added |
There was a problem hiding this comment.
Pull request overview
This PR adds a new GitHub Actions example workflow (.github/workflows/minecraft-screenshot.yaml) that boots a vanilla Minecraft instance inside a headless virtual desktop (Xvfb + xfwm4) on an ubuntu-latest runner, waits 10 seconds, captures a screenshot with scrot, and uploads it as an artifact. The launcher is portablemc-cli, installed via cargo install with a cargo registry cache.
Changes:
- New workflow file that installs system dependencies (xfce4, xvfb, scrot, openjdk-21), Rust, and portablemc-cli.
- Launches Minecraft in a virtual display and captures a screenshot after a fixed sleep.
- Uploads the screenshot PNG as a workflow artifact.
…king Replace unsupported --daemon flag on xfwm4 with background (&) execution. Capture Minecraft process PID via $! and verify it is still alive before taking the screenshot, failing the workflow if the process has exited. Co-authored-by: caunt <5324218+caunt@users.noreply.github.com>
|
@copilot Run portablemc --main-dir "$HOME/.portablemc" start --jvm "$(which java)" -- latest & 158.5 kB/s 100.0% (0/1) Should be not "latest" but "release" Also do not install java and do not pass it to portablemc. It will install required java itself. |
…va install Changed version alias from "latest" to "release" so portablemc resolves the latest stable Minecraft release correctly. Removed openjdk-21-jre-headless from system dependencies and dropped the --jvm flag since portablemc downloads and manages its own JRE automatically. Co-authored-by: caunt <5324218+caunt@users.noreply.github.com>
Fixed in commit
|
|
@copilot update all actions to latest major tag version. Increase the wait timer to 30. |
…ed wait timer Updated actions/cache from v4 to v5, actions/upload-artifact from v4 to v7. Increased the game initialisation wait from 10s to 30s to give Minecraft more time to download assets and reach the main menu on first run. Co-authored-by: caunt <5324218+caunt@users.noreply.github.com>
Done in commit |
|
@copilot also install tesseract and do OCR before screenshot |
Added tesseract-ocr to apt dependencies and a new "OCR screenshot" step that runs tesseract on the captured PNG, prints the recognised text to the workflow log, and uploads the .txt alongside the image as an artifact. Co-authored-by: caunt <5324218+caunt@users.noreply.github.com>
Done in commit |
.github/workflows/minecraft-screenshot.yamlthat triggers onworkflow_dispatchandpull_requestportablemc-clivia cargo (with caching viaactions/cache@v5)xfwm4 --daemon(unsupported flag) — now usesxfwm4 &start -- release(portablemc installs required JRE itself)$!and verifies it is still alive before taking screenshotactions/upload-artifact@v7permissions: {}for least-privilege securityOriginal prompt
✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.