Update from minecraft-data workflow (PrismarineJS/mineflayer)
The Update from minecraft-data workflow from PrismarineJS/mineflayer, explained and optimized by Latchkey.
CI health: C - fair
Point runs-on at Latchkey and get caching, job timeouts, self-healing for flaky steps, and up to 58% lower cost, applied automatically.
What it does
This is the Update from minecraft-data workflow from the PrismarineJS/mineflayer repository, a real project running GitHub Actions. It is shown here with attribution under its MIT license.
Below, Latchkey shows a faster, safer version produced by its optimization engine.
The workflow
name: Update from minecraft-data
on:
workflow_dispatch:
inputs:
new_mc_version:
description: New minecraft version number
required: true
type: string
mcdata_branch:
description: minecraft-data branch for this version
required: true
type: string
mcdata_pr_url:
description: minecraft-data PR number to open a PR here against
required: false
default: ''
type: string
nmp_branch:
description: minecraft-protocol branch for this version
required: true
type: string
nmp_pr_url:
description: minecraft-protocol PR number to open a PR here against
required: false
default: ''
type: string
jobs:
update:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
token: ${{ secrets.PAT_PASSWORD }}
- name: Use Node.js 22.x
uses: actions/setup-node@v1.4.4
with:
node-version: 22.x
- run: npm install PrismarineJS/node-minecraft-protocol#${{ github.event.inputs.nmp_branch }}
- name: Run updator script
run: cd .github/helper && npm install && node updator.js
env:
GITHUB_TOKEN: ${{ secrets.PAT_PASSWORD }}
NEW_MC_VERSION: ${{ github.event.inputs.new_mc_version }}
MCDATA_BRANCH: ${{ github.event.inputs.mcdata_branch }}
MCDATA_PR_URL: ${{ github.event.inputs.mcdata_pr_url }}
NMP_BRANCH: ${{ github.event.inputs.nmp_branch }}
NMP_PR_URL: ${{ github.event.inputs.nmp_pr_url }}
The same workflow, on Latchkey
Estimated ~20% faster on cache hits, plus fewer wasted runs and a safer supply chain. Added and changed lines are highlighted.
name: Update from minecraft-data on: workflow_dispatch: inputs: new_mc_version: description: New minecraft version number required: true type: string mcdata_branch: description: minecraft-data branch for this version required: true type: string mcdata_pr_url: description: minecraft-data PR number to open a PR here against required: false default: '' type: string nmp_branch: description: minecraft-protocol branch for this version required: true type: string nmp_pr_url: description: minecraft-protocol PR number to open a PR here against required: false default: '' type: string jobs: update: timeout-minutes: 30 runs-on: latchkey-small steps: - name: Checkout repository uses: actions/checkout@v4 with: token: ${{ secrets.PAT_PASSWORD }} - name: Use Node.js 22.x uses: actions/setup-node@v1.4.4 with: cache: 'npm' node-version: 22.x - run: npm install PrismarineJS/node-minecraft-protocol#${{ github.event.inputs.nmp_branch }} - name: Run updator script run: cd .github/helper && npm install && node updator.js env: GITHUB_TOKEN: ${{ secrets.PAT_PASSWORD }} NEW_MC_VERSION: ${{ github.event.inputs.new_mc_version }} MCDATA_BRANCH: ${{ github.event.inputs.mcdata_branch }} MCDATA_PR_URL: ${{ github.event.inputs.mcdata_pr_url }} NMP_BRANCH: ${{ github.event.inputs.nmp_branch }} NMP_PR_URL: ${{ github.event.inputs.nmp_pr_url }}
What changed
- Run on Latchkey managed runners with one line (
runs-on), which apply the fixes below automatically and self-heal transient failures. This example useslatchkey-small; pick the runner size that fits the job. - Cache dependency installs on the setup step so they are served from cache.
- Add a job timeout so a hung step cannot burn hours of runner time.
What Latchkey heals here
This workflow has steps that commonly fail on transient issues (network, registries, flaky browsers). On Latchkey managed runners they are detected, retried, and self-healed instead of failing your build:
- Dependency installs
This workflow runs 1 job per trigger. On Latchkey the same minutes cost up to 58% less than GitHub-hosted, with zero queue time.