Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
171 commits
Select commit Hold shift + click to select a range
2125ad0
docs(readme): add SteveProxy to projects list (#948)
egorprnn Jan 20, 2022
3a1561b
explicit 1.18.1 support
rom1504 Jan 22, 2022
c22682b
bump mcdata to include a fix for 1.18.1
rom1504 Jan 22, 2022
ffeb751
require node 14 (#955)
U5B Jan 28, 2022
4691abd
Wrong type definition for beforePing (#957)
RichardDorian Feb 1, 2022
9e94d9d
1.18.2 (#967)
rom1504 Mar 1, 2022
ef7d033
Release 1.31.0 (#968)
rom1504 Mar 1, 2022
f7ef27d
add protocolValidation field to server and client options (#964)
RichardDorian Mar 8, 2022
e93d9de
fix plugin channel registration (#965)
RichardDorian Mar 8, 2022
bcfeb71
allows false value for profilesFolder (#961)
Robbilie Mar 8, 2022
f1f9f5c
Release 1.32.0 (#971)
rom1504 Mar 11, 2022
11ad713
Make `validateChannelProtocol` optional (#972)
IceTank Mar 17, 2022
9cff34e
Release 1.32.1 (#973)
rob9315 Mar 20, 2022
68e6400
fix: cross version ping (#976)
jojomatik Apr 10, 2022
5e3196b
Add basic deserializer and serializer typings (#975)
IceTank Apr 10, 2022
3bb93b6
Release 1.32.2 (#979)
rom1504 Apr 10, 2022
6efbbcf
Bump minecraft-data from 2.221.0 to 3.0.0 (#980)
dependabot[bot] Apr 11, 2022
2f27ad4
Release 1.33.0 (#981)
rom1504 Apr 11, 2022
aac5494
Fix missing readable-stream types (#982)
IceTank Apr 12, 2022
ffe912b
Export defaultVersion (#984)
matthi4s Apr 13, 2022
d641634
Release 1.34.0 (#988)
jojomatik Apr 17, 2022
30053a4
Bump mocha from 9.2.2 to 10.0.0 (#995)
dependabot[bot] May 10, 2022
74e2ba8
Bump standard from 16.0.4 to 17.0.0 (#990)
dependabot[bot] May 10, 2022
a9cc6ce
Add motdMsg to createServer (#996)
IceTank May 13, 2022
7a1d857
Fallback version for dynamic versions (#983)
matthi4s May 14, 2022
83f1e85
allow false as beforePing callback result to ignore pings and termina…
matthi4s May 14, 2022
9cb16b8
Update doc add `listening` and `close` events (#1003)
IceTank Jun 6, 2022
836675b
Release 1.35.0
IceTank Jun 6, 2022
6cc3cfc
add custom minecraft type `varlong` which aliases to varint (#1018)
rob9315 Jul 19, 2022
50de598
Bump @types/node from 17.0.45 to 18.0.6 (#1017)
dependabot[bot] Jul 19, 2022
446d1d9
Bump readable-stream from 3.6.0 to 4.1.0 (#1014)
dependabot[bot] Jul 19, 2022
92fd00d
add type values to packetTest (#1023)
rob9315 Jul 21, 2022
e4c797d
Release 1.35.1 (#1024)
rom1504 Jul 22, 2022
e079e9b
Use offline mode as default authentication, fallback to offline mode …
kashalls Jul 29, 2022
60379eb
Provide interface for using not at all supported alternative accounts…
kashalls Jul 29, 2022
d7c5053
1.19.0 support (#1027)
extremeheat Aug 15, 2022
79afd27
Fix unhandled promise rejection on ms auth (#1022)
IceTank Aug 15, 2022
af31ece
Release 1.36.0
rom1504 Aug 15, 2022
6cbdbb8
Fix type definition breaking typescript projects (#1033)
IceTank Aug 21, 2022
1f4eb86
Release 1.36.1 (#1036)
IceTank Aug 22, 2022
00949a0
Update README.md (#1034)
SpencerBurgess Sep 30, 2022
cbf663a
Fix connect event typo (#1035)
IceTank Sep 30, 2022
4ca8523
Update microsoftAuth to set default flow option (#1041)
extremeheat Nov 11, 2022
85264bc
Make "fakeHost" option working (#1040)
makindotcc Nov 11, 2022
061176d
run standard
rom1504 Nov 11, 2022
7fb293f
Throw error on minecraft-data protocol version mismatch (#1044)
extremeheat Nov 20, 2022
1efbde1
Release 1.36.2 (#1045)
extremeheat Nov 29, 2022
367c015
Initial 1.19.1/2 signed chat support (#1050)
extremeheat Jan 14, 2023
ca654c1
update version support in readme
rom1504 Jan 14, 2023
6aaef7b
Release 1.37.0 (#1051)
rom1504 Jan 14, 2023
38eecb5
Fixes type mismatch (#1052)
frej4189 Jan 14, 2023
2fc4b91
fix(types): complete type definitions (#1053)
jojomatik Jan 15, 2023
0526edf
Update convenience chat events so higher-level clients can properly p…
frej4189 Jan 15, 2023
28093fb
Realm Joining (#1056)
LucienHH Jan 15, 2023
2a5ec37
Fix chat previews not working (#1054)
frej4189 Jan 15, 2023
4f9341e
Release 1.38.0 (#1058)
rom1504 Jan 15, 2023
f2875a5
Update chat example for 1.19 (#1059)
frej4189 Jan 16, 2023
4201b94
Fix chat not working on offline servers (#1060)
frej4189 Jan 16, 2023
14b138c
Release 1.38.1 (#1063)
extremeheat Jan 17, 2023
5e52e78
Mark message as insecure if unsigned content is present (#1065)
frej4189 Jan 18, 2023
2164732
Use non-zero salt (#1064)
frej4189 Jan 18, 2023
c9e900d
Release 1.39.0 (#1066)
rom1504 Jan 19, 2023
92a5219
Add more fields to playerChat event (#1068)
frej4189 Jan 20, 2023
cf1f671
Update to 1.19.3 (#1069)
frej4189 Jan 21, 2023
995797f
Release 1.40.0 (#1070)
rom1504 Jan 21, 2023
046e342
Add 1.19.3 in list of versions in readme
rom1504 Jan 22, 2023
da85ee3
Fix offline mode (#1071)
frej4189 Jan 22, 2023
b72cb89
Release 1.40.1 (#1072)
frej4189 Jan 22, 2023
d55c498
Small chat.js fix (#1074)
Prosciuttino Jan 23, 2023
84bd97c
Release 1.40.2 (#1075)
rom1504 Jan 23, 2023
e3e2075
Use consistent parameter naming for systemChat event (#1076)
frej4189 Jan 27, 2023
a8caf83
Release 1.40.3 (#1077)
rom1504 Jan 27, 2023
c0877b0
Catch errors in custom payloads (#1078)
frej4189 Feb 8, 2023
45ea82a
Fix client sending session packet when server is in offline mode (#1080)
frej4189 Feb 18, 2023
90d4143
Fix client sending chat_session packet before server state transition…
frej4189 Feb 19, 2023
3974c50
Release 1.41.0 (#1082)
rom1504 Feb 19, 2023
7a9cfdb
Revert "Fix client sending chat_session packet before server state tr…
extremeheat Feb 27, 2023
49d218b
Release 1.41.1 (#1088)
extremeheat Feb 27, 2023
266a865
Fix client sending session packet while server is in login state (#1089)
frej4189 Mar 2, 2023
9c767a0
Fix client attempting to sign messages on offline servers (#1090)
frej4189 Mar 6, 2023
f52ab55
Release 1.41.2 (#1091)
frej4189 Mar 24, 2023
70aee3d
1.19.3 chat fixes (#1093)
frej4189 Mar 24, 2023
6f57eb9
Delete CNAME
rom1504 Apr 5, 2023
0625b29
Bump @types/node from 18.16.13 to 20.2.1 (#1203)
dependabot[bot] May 20, 2023
0134f15
Fix plugin channels support (#1096)
turikhay May 20, 2023
ab9aaac
Update _sidebar.md (#1103)
hvlxh May 20, 2023
d6b18b1
Typo in "cypher" property check. Fixes #1106 (#1107)
XHawk87 May 20, 2023
d9e37e3
Add ipc connection option for servers (#1113)
IceTank May 20, 2023
d643d40
reapply on master (#1067)
extremeheat May 28, 2023
a32a1cf
Improve code style of examples in README.md (#1227)
Jun 3, 2023
2718bc6
1.19.4 (#1226)
extremeheat Jun 3, 2023
2f4485d
Release 1.42.0
rom1504 Jun 3, 2023
1af5a36
Release 1.42.0
rom1504 Jun 3, 2023
1376cf6
chore(runtime): use LTS V18 (#1224)
AugustinMauroy Jun 3, 2023
6579b0b
Add 1.19.4 to readme
rom1504 Jun 4, 2023
38e7914
Fix test for entityMetadata on 1.19.4 (#1231)
extremeheat Jun 23, 2023
960df17
1.20 (#1232)
PondWader Jun 24, 2023
f404b8d
Release 1.43.0 (#1234)
rom1504 Jun 24, 2023
fa01163
Temporarily make node 18 not required in package.json
rom1504 Jun 27, 2023
05e5a70
Release 1.43.1 (#1235)
rom1504 Jun 27, 2023
5a64f14
Fix client sending chat_session_update when local UUID does not match…
frej4189 Jul 14, 2023
2e45c7f
Release 1.43.2 (#1239)
frej4189 Jul 16, 2023
1a4cfa7
Add command gh workflow allowing to use release command in comments (…
rom1504 Jul 22, 2023
cc9aa94
fix broken link (#1243)
FurriousFox Jul 22, 2023
94b9c22
Bump @types/readable-stream from 2.3.15 to 4.0.0 (#1247)
dependabot[bot] Jul 29, 2023
35b2aa5
Fix end bundle bundle_delimiter packet not being emitted (#1248)
PondWader Jul 29, 2023
41f9e4a
Send chat commands as chat commands instead of chat messages for 1.19…
lkwilson Aug 5, 2023
827b6cd
Release 1.44.0 (#1250)
rom1504bot Aug 5, 2023
0ac8c08
chat: Only sign command args when profile keys defined (#1257)
evan-goode Dec 17, 2023
788bff2
Add chat typing to client (#1260)
IceTank Dec 17, 2023
066a2b3
Fixed 'unsignedContent' field using nonexistent 'packet.unsignedConte…
Ynfuien Dec 27, 2023
9e99109
Allow to create custom client & communication between clients (#1254)
zardoy Dec 27, 2023
1740124
Improve CI setup for per version tests (#1267)
rom1504 Dec 27, 2023
112926d
Pc1.20.2 (#1265)
extremeheat Dec 27, 2023
eaf4c2e
Release 1.45.0 (#1270)
rom1504bot Dec 27, 2023
ccaf538
Align supported versions with mineflayer (#1272)
rom1504 Dec 29, 2023
614be91
Print if there is a diff in packets in the cycle packet test (#1273)
rom1504 Dec 29, 2023
80d038b
Add test to make sure version that are tested are mentioned in the RE…
rom1504 Dec 30, 2023
21240f8
Allow commands not to be signed (#1277)
forester302 Jan 1, 2024
092e10c
Acknowledge returning to configuration state if in play state. (#1284)
wgaylord Feb 3, 2024
85a26a5
Ensure `onReady` in client is called once (#1287)
extremeheat Feb 11, 2024
f97a236
Release 1.46.0 (#1285)
rom1504bot Feb 11, 2024
1d9a382
1.20.3 / 1.20.4 support (#1275)
wgaylord Feb 26, 2024
e50b604
Release 1.47.0 (#1288)
rom1504bot Feb 26, 2024
ccab9fb
Fix handling of disconnect in versionChecking on 1.20.3+. (#1291)
wgaylord Mar 17, 2024
495eed5
Update doc (#1300)
extremeheat May 22, 2024
7057ad9
Fix realms loading issue due to createClient plugin init order (#1303)
extremeheat Jul 13, 2024
9b029e8
1.20.5 (#1309)
extremeheat Oct 12, 2024
81d7c71
Release 1.48.0 (#1336)
rom1504bot Oct 12, 2024
0b0012d
support 1.20.6 (#1338)
rom1504 Oct 12, 2024
11e8594
Release 1.49.0 (#1339)
rom1504bot Oct 12, 2024
5bebac3
1.21 Support (#1342)
GroobleDierne Oct 26, 2024
89de052
Release 1.50.0 (#1346)
rom1504bot Oct 26, 2024
590dc33
Bump @types/node from 20.16.15 to 22.7.9 (#1345)
dependabot[bot] Oct 27, 2024
2224d82
support 1.21.3 (#1347)
rom1504 Dec 4, 2024
d6b4e82
Add type to serverKey in server (#1349)
u9g Dec 4, 2024
f258c76
Release 1.51.0 (#1354)
rom1504bot Dec 4, 2024
8e131c3
Fix server_data payload for 1.19+, fix kicks messages on 1.20.3+ (#1364)
extremeheat Jan 6, 2025
d38f24a
Release 1.52.0 (#1365)
rom1504bot Jan 6, 2025
502513b
Bump mocha from 10.8.2 to 11.0.1 (#1352)
dependabot[bot] Jan 6, 2025
e74d11f
1.21.4 (#1366)
extremeheat Jan 8, 2025
556b9dd
Release 1.53.0 (#1367)
rom1504bot Jan 8, 2025
c879d0e
fix: use node-rsa for decryption for higher node compatibility (#1319)
jacobk999 Jan 19, 2025
1d7c2a8
Release 1.54.0 (#1368)
rom1504bot Jan 19, 2025
c9cf363
Add `npm update` to version error message
extremeheat Jan 22, 2025
080aa52
Add npm update to version error message
extremeheat Jan 22, 2025
e9eb551
Update to node 22 (#1371)
rom1504 Jan 26, 2025
5ec3dd4
Fix #1369 online-mode error 1.20.5-1.21.4 (#1375)
h5mcbox Feb 22, 2025
3bd4dc1
Fix `client.end()` (#1376)
h5mcbox Mar 17, 2025
9c6a4b2
Release 1.55.0 (#1382)
rom1504bot Mar 23, 2025
6a44531
Update serializer.js to remove usage of lodash.get (#1390)
rom1504 Apr 6, 2025
90de8b0
Release 1.56.0 (#1391)
rom1504bot Apr 6, 2025
031f13f
Update package.json to remove lodash.get
rom1504 Apr 6, 2025
9e116c3
Release 1.57.0 (#1392)
rom1504bot Apr 6, 2025
1e38d8f
Bump @types/node from 22.15.33 to 24.0.4 (#1405)
dependabot[bot] Jun 29, 2025
7207b61
Fixes to protocol Holder implementation (#1355)
extremeheat Jul 1, 2025
6c2204a
Release 1.58.0 (#1407)
rom1504bot Jul 1, 2025
0f6da56
fix: Wrap base64-encoded PEM with 64-char line boundary (#1292)
littledivy Jul 27, 2025
3918d74
Release 1.59.0 (#1414)
rom1504bot Aug 2, 2025
2467716
1.21.5 (#1408)
extremeheat Aug 2, 2025
ca5af63
Release 1.60.0 (#1415)
rom1504bot Aug 2, 2025
74aea5a
fix leak on entering config state twice (#1381)
zardoy Aug 3, 2025
5242498
types: add missing config state (#1397)
notsapinho Aug 3, 2025
2119b04
Fix undefined chat message signatures causing crash (#1413)
PiotrW01 Aug 3, 2025
b404bca
Release 1.60.1 (#1418)
rom1504bot Aug 5, 2025
0bfd970
1.21.6 (#1416)
extremeheat Aug 17, 2025
c561917
Release 1.61.0 (#1422)
rom1504bot Aug 17, 2025
8a99613
Add support for Minecraft 1.21.8 (#1427)
rom1504 Sep 7, 2025
ad1f4ca
Update update-from-minecraft-data.yml workflow (#1426)
extremeheat Sep 7, 2025
efee28e
Release 1.62.0 (#1428)
rom1504bot Sep 7, 2025
bf89f7e
fix emitting playerJoin too early (#1424)
zardoy Sep 7, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
96 changes: 96 additions & 0 deletions .github/CROSS_REPO_TRIGGER.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,96 @@
# Cross-Repository Workflow Trigger Setup

This document explains how to set up cross-repository workflow triggering between the minecraft-data repository and this repository.

## Overview

The workflow `update-from-minecraft-data.yml` can be triggered from the minecraft-data repository in two ways:

1. **Manual Workflow Dispatch** - Triggered manually or programmatically
2. **Repository Dispatch** - Triggered via webhook/API call

## Setup in minecraft-data repository

### Method 1: Workflow Dispatch (Recommended)

Add this step to a workflow in the minecraft-data repository:

```yaml
- name: Trigger update in node-minecraft-protocol
uses: actions/github-script@v7
with:
github-token: ${{ secrets.CROSS_REPO_TOKEN }}
script: |
await github.rest.actions.createWorkflowDispatch({
owner: 'extremeheat',
repo: 'node-minecraft-protocol',
workflow_id: 'update-from-minecraft-data.yml',
ref: 'master', // or the target branch
inputs: {
trigger_source: 'minecraft-data',
trigger_reason: 'data_update',
data_version: '${{ steps.get_version.outputs.version }}' // or your version variable
}
});
```

### Method 2: Repository Dispatch

```yaml
- name: Trigger update in node-minecraft-protocol
uses: actions/github-script@v7
with:
github-token: ${{ secrets.CROSS_REPO_TOKEN }}
script: |
await github.rest.repos.createDispatchEvent({
owner: 'extremeheat',
repo: 'node-minecraft-protocol',
event_type: 'minecraft-data-update',
client_payload: {
repository: 'minecraft-data',
reason: 'data_update',
version: '${{ steps.get_version.outputs.version }}'
}
});
```

## Required Secrets

You need to create a Personal Access Token (PAT) with the following permissions:
- `repo` scope (for private repositories)
- `public_repo` scope (for public repositories)
- `actions:write` permission

Add this token as a secret named `CROSS_REPO_TOKEN` in the minecraft-data repository.

## Token Setup Steps

1. Go to GitHub Settings > Developer settings > Personal access tokens > Tokens (classic)
2. Generate a new token with appropriate permissions
3. Add the token as `CROSS_REPO_TOKEN` secret in minecraft-data repository settings

## Customizing the Updator Script

The updator script (`.github/helper/updator.js`) can be customized to:

- Download and process minecraft-data updates
- Update protocol definitions
- Run tests to verify compatibility
- Create pull requests for review
- Send notifications

## Testing

You can test the workflow manually by:

1. Going to the Actions tab in this repository
2. Selecting "Update from minecraft-data" workflow
3. Clicking "Run workflow"
4. Providing test inputs

## Security Considerations

- Use repository secrets for sensitive tokens
- Limit token permissions to minimum required
- Consider using short-lived tokens or GitHub Apps for enhanced security
- Review and approve automatic commits/PRs if needed
5 changes: 5 additions & 0 deletions .github/helper/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"dependencies": {
"gh-helpers": "^1.0.0"
}
}
100 changes: 100 additions & 0 deletions .github/helper/updator.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,100 @@
#!/usr/bin/env node
/**
* Updator script triggered from minecraft-data repository to auto generate PR
*/
const fs = require('fs')
const cp = require('child_process')
const assert = require('assert')
const github = require('gh-helpers')()
const { join } = require('path')
const exec = (cmd) => github.mock ? console.log('> ', cmd) : (console.log('> ', cmd), cp.execSync(cmd, { stdio: 'inherit' }))

console.log('Starting update process...')
// Sanitize and validate environment variables all non alpha numeric / underscore / dot
const newVersion = process.env.NEW_MC_VERSION?.replace(/[^a-zA-Z0-9_.]/g, '_')
const triggerBranch = process.env.MCDATA_BRANCH?.replace(/[^a-zA-Z0-9_.]/g, '_')
const mcdataPrURL = process.env.MCDATA_PR_URL
console.log({ newVersion, triggerBranch, mcdataPrURL })

assert(newVersion)
assert(triggerBranch)

async function main () {
const currentSupportedPath = require.resolve('../../src/version.js')
const readmePath = join(__dirname, '../../docs/README.md')
const ciPath = join(__dirname, '../../.github/workflows/ci.yml')

// Update the version.js
const currentSupportedVersion = require('../../src/version.js')
const currentContents = fs.readFileSync(currentSupportedPath, 'utf8')
console.log('Current supported version:', currentContents)
const newContents = currentContents.includes(newVersion)
? currentContents
: currentContents
.replace(`: '${currentSupportedVersion.defaultVersion}'`, `: '${newVersion}'`)
.replace(`, '${currentSupportedVersion.defaultVersion}'`, `, '${currentSupportedVersion.defaultVersion}', '${newVersion}'`)

// Update the README.md
const currentContentsReadme = fs.readFileSync(readmePath, 'utf8')
if (!currentContentsReadme.includes(newVersion)) {
const newReadmeContents = currentContentsReadme.replace('\n<!--add_next_version_above-->', `, ${newVersion}\n<!--add_next_version_above-->`)
fs.writeFileSync(readmePath, newReadmeContents)
console.log('Updated README with new version:', newVersion)
}
fs.writeFileSync(currentSupportedPath, newContents)

// Update the CI workflow
const currentContentsCI = fs.readFileSync(ciPath, 'utf8')
if (!currentContentsCI.includes(newVersion)) {
const newCIContents = currentContentsCI.replace(
'run: npm install', `run: npm install
- run: cd node_modules && cd minecraft-data && mv minecraft-data minecraft-data-old && git clone -b ${triggerBranch} https://github.com/PrismarineJS/minecraft-data --depth 1 && node bin/generate_data.js
- run: curl -o node_modules/protodef/src/serializer.js https://raw.githubusercontent.com/extremeheat/node-protodef/refs/heads/dlog/src/serializer.js && curl -o node_modules/protodef/src/compiler.js https://raw.githubusercontent.com/extremeheat/node-protodef/refs/heads/dlog/src/compiler.js
`)
fs.writeFileSync(ciPath, newCIContents)
console.log('Updated CI workflow with new version:', newVersion)
}

const branchName = 'pc' + newVersion.replace(/[^a-zA-Z0-9_]/g, '_')
exec(`git checkout -b ${branchName}`)
exec('git config user.name "github-actions[bot]"')
exec('git config user.email "41898282+github-actions[bot]@users.noreply.github.com"')
exec('git add --all')
exec(`git commit -m "Update to version ${newVersion}"`)
exec(`git push origin ${branchName} --force`)
// createPullRequest(title: string, body: string, fromBranch: string, intoBranch?: string): Promise<{ number: number, url: string }>;
const pr = await github.createPullRequest(
`🎈 ${newVersion}`,
`This automated PR sets up the relevant boilerplate for Minecraft version ${newVersion}.

Ref: ${mcdataPrURL}

* You can help contribute to this PR by opening a PR against this <code branch>${branchName}</code> branch instead of <code>master</code>.
`,
branchName,
'master'
)
console.log(`Pull request created`, pr)

// Ask mineflayer to handle new update
const nodeDispatchPayload = {
owner: 'PrismarineJS',
repo: 'mineflayer',
workflow: 'handle-update.yml',
branch: 'master',
inputs: {
new_mc_version: newVersion,
mcdata_branch: triggerBranch,
mcdata_pr_url: mcdataPrURL,
nmp_branch: branchName,
nmp_pr_url: pr.url
}
}
console.log('Sending workflow dispatch', nodeDispatchPayload)
await github.sendWorkflowDispatch(nodeDispatchPayload)
}

main().catch(err => {
console.error('Error during update process:', err)
process.exit(1)
})
53 changes: 33 additions & 20 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,39 +9,52 @@ on:
- master

jobs:
test:
Lint:
runs-on: ubuntu-latest
strategy:
matrix:
mcVersion: ['1.7', '1.8', '1.9', '1.10', '1.11.2', '1.12.2', '1.13.2', '1.14.4', '1.15.2', '1.16.5', '1.17', '1.17.1', '1.18']

steps:
- uses: actions/checkout@v2
- name: Use Node.js 14.x
uses: actions/setup-node@v1
- name: Use Node.js 22.x
uses: actions/setup-node@v1.4.4
with:
node-version: 14.x
- name: Setup Java JDK
uses: actions/[email protected]
node-version: 22.x
- run: npm i && npm run lint
PrepareSupportedVersions:
runs-on: ubuntu-latest
outputs:
matrix: ${{ steps.set-matrix.outputs.matrix }}

steps:
- uses: actions/checkout@v2
- name: Use Node.js 22.x
uses: actions/[email protected]
with:
java-version: '17'
distribution: 'adopt'
- name: Install dependencies
run: npm install
- name: Run tests
run: npm test -- -g ${{ matrix.mcVersion }}
packet-cycle-test:
node-version: 22.x
- id: set-matrix
run: |
node -e "
const supportedVersions = require('./src/version').supportedVersions;
console.log('matrix='+JSON.stringify({'include': supportedVersions.map(mcVersion => ({mcVersion}))}))
" >> $GITHUB_OUTPUT
test:
needs: PrepareSupportedVersions
runs-on: ubuntu-latest
strategy:
matrix: ${{fromJson(needs.PrepareSupportedVersions.outputs.matrix)}}
fail-fast: false

steps:
- uses: actions/checkout@v2
- name: Use Node.js 14.x
- name: Use Node.js 22.x
uses: actions/setup-node@v1
with:
node-version: 14.x
node-version: 22.x
- name: Setup Java JDK
uses: actions/[email protected]
with:
java-version: '16'
java-version: '21'
distribution: 'adopt'
- run: npm install && npm run test-non-par
- name: Install dependencies
run: npm install
- name: Run tests
run: npm run mochaTest -- -g ${{ matrix.mcVersion }}v
24 changes: 24 additions & 0 deletions .github/workflows/commands.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
name: Repo Commands

on:
issue_comment: # Handle comment commands
types: [created]
pull_request: # Handle renamed PRs
types: [edited]
permissions:
contents: write

jobs:
comment-trigger:
runs-on: ubuntu-latest
steps:
- name: Check out repository
uses: actions/checkout@v3
- name: Run command handlers
uses: PrismarineJS/prismarine-repo-actions@master
with:
# NOTE: You must specify a Personal Access Token (PAT) with repo access here. While you can use the default GITHUB_TOKEN, actions taken with it will not trigger other actions, so if you have a CI workflow, commits created by this action will not trigger it.
token: ${{ secrets.PAT_PASSWORD }}
# See `Options` section below for more info on these options
install-command: npm install
/fixlint.fix-command: npm run fix
27 changes: 17 additions & 10 deletions .github/workflows/npm-publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,13 +13,20 @@ jobs:
- name: Set up Node.js
uses: actions/setup-node@master
with:
node-version: 10.0.0
- name: Publish if version has been updated
uses: pascalgn/npm-publish-action@4f4bf159e299f65d21cd1cbd96fc5d53228036df
with: # All of theses inputs are optional
tag_name: "%s"
tag_message: "%s"
commit_pattern: "^Release (\\S+)"
env: # More info about the environment variables in the README
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # Leave this as is, it's automatically generated
NPM_AUTH_TOKEN: ${{ secrets.NPM_AUTH_TOKEN }} # You need to set this in your repo settings
node-version: 22.0.0
- id: publish
uses: JS-DevTools/npm-publish@v1
with:
token: ${{ secrets.NPM_AUTH_TOKEN }}
- name: Create Release
if: steps.publish.outputs.type != 'none'
id: create_release
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: ${{ steps.publish.outputs.version }}
release_name: Release ${{ steps.publish.outputs.version }}
body: ${{ steps.publish.outputs.version }}
draft: false
prerelease: false
36 changes: 36 additions & 0 deletions .github/workflows/update-from-minecraft-data.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
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

jobs:
update:
runs-on: ubuntu-latest

steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
token: ${{ secrets.PAT_PASSWORD }}

- name: Run updator script
run: cd .github/helper && npm install && node updator.js
env:
GITHUB_TOKEN: ${{ secrets.PAT_PASSWORD }}
MCDATA_BRANCH: ${{ github.event.inputs.mcdata_branch }}
MCDATA_PR_URL: ${{ github.event.inputs.mcdata_pr_url }}
NEW_MC_VERSION: ${{ github.event.inputs.new_mc_version }}
5 changes: 3 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
node_modules
test/npm-debug.log
test/server*
test/server_*
package-lock.json
versions/
src/client/*.json
src/client/*.json
test_*
2 changes: 1 addition & 1 deletion .gitpod.yml
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
tasks:
- command: npm install
- command: npm install && sdk install java
Loading