Skip to content

Commit

Permalink
Support node 20, drop node 16 (matrix-org#724)
Browse files Browse the repository at this point in the history
* Support node 20, drop node 16

* Update workflow versions

* Update backendmeta

* Use version file

* Update packages

* Yarn updates

* Changelog

* Fix glibc compatibility

* Target es2021

Without this, CI tests fail

* Drop unused metrics parameter

* Revert "Drop unused metrics parameter"

This reverts commit 4d87454.

* Make a note about broken support

---------

Co-authored-by: Andrew Ferrazzutti <[email protected]>
  • Loading branch information
Half-Shot and AndrewFerr authored Apr 27, 2023
1 parent 01159fa commit c864dc6
Show file tree
Hide file tree
Showing 13 changed files with 144 additions and 174 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/docker-hub-latest.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2
uses: actions/checkout@v3
- name: Set up QEMU
uses: docker/setup-qemu-action@v2
- name: Set up Docker Buildx
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/docker-hub-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2
uses: actions/checkout@v3
- name: Get release tag
run: echo "RELEASE_VERSION=${GITHUB_REF#refs/*/}" >> $GITHUB_ENV
- name: Set up QEMU
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/docs-latest.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,12 @@ jobs:
deploy:
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3

- name: Use Node.js
uses: actions/setup-node@v1
uses: actions/setup-node@v3
with:
node-version: 16
node-version-file: .node-version

# We want to install matrix-appservice-bridge, which we depend on.
- run: yarn --ignore-scripts
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/docs-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,12 @@ jobs:
deploy:
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3

- name: Use Node.js
uses: actions/setup-node@v1
uses: actions/setup-node@v3
with:
node-version: 16
node-version-file: .node-version

# We want to install matrix-appservice-bridge, which we depend on.
- run: yarn --ignore-scripts
Expand Down
29 changes: 15 additions & 14 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,18 +16,18 @@ jobs:
lint-node:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3
- name: Use Node.js
uses: actions/setup-node@v1
uses: actions/setup-node@v3
with:
node-version: 16
node-version-file: .node-version
- run: yarn --ignore-scripts
- run: yarn lint:js

lint-rust:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3
- uses: actions-rs/toolchain@v1
with:
toolchain: stable
Expand All @@ -38,34 +38,35 @@ jobs:
config:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3
- name: Use Node.js
uses: actions/setup-node@v1
uses: actions/setup-node@v3
with:
node-version: 16
node-version-file: .node-version
- run: yarn # Need to build scripts to get rust bindings
- run: yarn --silent ts-node src/Config/Defaults.ts --config | diff config.sample.yml -

metrics-docs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3
- name: Use Node.js
uses: actions/setup-node@v1
uses: actions/setup-node@v3
with:
node-version: 16
node-version-file: .node-version
- run: yarn # Need to build scripts to get rust bindings
- run: yarn --silent ts-node ./scripts/build-metrics-docs.ts | diff docs/metrics.md -

test:
runs-on: ubuntu-latest
# Test on LTS-1
runs-on: ubuntu-20.04
strategy:
matrix:
node_version: [16, 18]
node_version: [18, 20]
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3
- name: Use Node.js ${{ matrix.node_version }}
uses: actions/setup-node@v1
uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node_version }}
- uses: actions-rs/toolchain@v1
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/newsfile.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ jobs:
changelog:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3
with: # Needed for comparison
fetch-depth: 0
- uses: actions/setup-python@v1
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/sign-off.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,4 @@ on:

jobs:
signoff:
uses: matrix-org/backend-meta/.github/workflows/sign-off.yml@v1.4.0
uses: matrix-org/backend-meta/.github/workflows/sign-off.yml@v2
2 changes: 1 addition & 1 deletion .node-version
Original file line number Diff line number Diff line change
@@ -1 +1 @@
16
18
4 changes: 2 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# Stage 0: Build the thing
# Need debian based image to build the native rust module
# as musl doesn't support cdylib
FROM node:16 AS builder
FROM node:18 AS builder

# We need rustup so we have a sensible rust version, the version packed with bullsye is too old
RUN curl https://sh.rustup.rs -sSf | sh -s -- -y --profile minimal
Expand Down Expand Up @@ -30,7 +30,7 @@ RUN yarn build


# Stage 1: The actual container
FROM node:16-slim
FROM node:18

WORKDIR /bin/matrix-hookshot

Expand Down
1 change: 1 addition & 0 deletions changelog.d/724.removal
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Add support for Node 20, and drop support for Node 16.
14 changes: 7 additions & 7 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
"name": "matrix-hookshot-rs"
},
"engines": {
"node": ">=16"
"node": ">=18"
},
"scripts": {
"build:web": "vite build",
Expand Down Expand Up @@ -55,8 +55,8 @@
"ioredis": "^5.2.3",
"jira-client": "^8.0.0",
"markdown-it": "^12.3.2",
"matrix-appservice-bridge": "^6.0.0",
"matrix-bot-sdk": "npm:@vector-im/matrix-bot-sdk@^0.6.6-element.0",
"matrix-appservice-bridge": "^9.0.0",
"matrix-bot-sdk": "npm:@vector-im/matrix-bot-sdk@^0.6.6-element.1",
"matrix-widget-api": "^1.0.0",
"micromatch": "^4.0.4",
"mime": "^3.0.0",
Expand All @@ -77,7 +77,7 @@
"@codemirror/lang-javascript": "^6.0.2",
"@napi-rs/cli": "^2.2.0",
"@preact/preset-vite": "^2.2.0",
"@tsconfig/node16": "^1.0.3",
"@tsconfig/node18": "^2.0.0",
"@types/ajv": "^1.0.0",
"@types/chai": "^4.2.22",
"@types/cors": "^2.8.12",
Expand All @@ -87,10 +87,10 @@
"@types/micromatch": "^4.0.1",
"@types/mime": "^2.0.3",
"@types/mocha": "^9.0.0",
"@types/node": "^16",
"@types/node-emoji": "^1.8.1",
"@types/uuid": "^8.3.3",
"@types/xml2js": "^0.4.11",
"@types/node": "18",
"@typescript-eslint/eslint-plugin": "^5.4.0",
"@typescript-eslint/parser": "^5.4.0",
"@uiw/react-codemirror": "^4.12.3",
Expand All @@ -103,8 +103,8 @@
"preact": "^10.5.15",
"rimraf": "^3.0.2",
"sass": "^1.51.0",
"ts-node": "^10.4.0",
"typescript": "^4.5.2",
"ts-node": "^10.9.1",
"typescript": "^5.0.4",
"vite": "^4.1.4",
"vite-svg-loader": "^4.0.0"
}
Expand Down
4 changes: 3 additions & 1 deletion tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"extends": "@tsconfig/node16/tsconfig.json",
"extends": "@tsconfig/node18/tsconfig.json",
"compilerOptions": {
"incremental": true,
"declaration": false,
Expand All @@ -25,6 +25,8 @@
"emitDecoratorMetadata": true,
// TODO: Type errors
"useUnknownInCatchVariables": false,
// ES2022+ is currently broken https://github.com/matrix-org/matrix-hookshot/issues/729
"target": "es2021"
},
"include": [
"src/**/*"
Expand Down
Loading

0 comments on commit c864dc6

Please sign in to comment.