Skip to content

Commit f79fa0b

Browse files
authored
chore: update to node v20 (#871)
## fixes part of KILTProtocol/ticket#3081 - Makes sure the `package.json` specifies `yarn` version. - Upgrades the used **node version** on the `.nvmrc` to `lts/Iron`. - Makes sure the **GitHub workflows** uses node version 20. For this following must be set: - `actions/checkout@v4` - `actions/setup-node@v4` **with:** _either_ - **node-version-file:** '`package.json`' or '`.nvmrc`' - **node-version:** `'`<Node.js version using [SemVer](https://semver.org/) or [aliases](https://github.com/nodejs/Release?tab=readme-ov-file#release-schedule) > `'` - `actions/download-artifact@v4` - _optional, but done:_ `actions/cache@v4` - `aws-actions/configure-aws-credentials@v4` - `aws-actions/amazon-ecr-login@v2` - Makes sure the **Dockerfiles** also use the node version 20. This means that the following must be set: - `FROM node:20-alpine as builder`
1 parent 2ea03c9 commit f79fa0b

File tree

8 files changed

+68
-66
lines changed

8 files changed

+68
-66
lines changed

.github/actions/cached-image-pull/action.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ runs:
2727
2828
- name: check image cache
2929
id: image-cache
30-
uses: actions/cache@v3
30+
uses: actions/cache@v4
3131
with:
3232
path: ${{ steps.image-file.outputs.path }}
3333
key: image-cache-${{ inputs.image }}

.github/workflows/devpackpublish.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,12 +6,12 @@ jobs:
66
runs-on: ubuntu-latest
77
if: "! startsWith(github.event.head_commit.message, '[CI Skip]') && github.repository == 'kiltprotocol/sdk-js'"
88
steps:
9-
- uses: actions/checkout@v3
9+
- uses: actions/checkout@v4
1010
with:
1111
# fetch-depth 0 and token needed to push changes on the package.json files back.
1212
fetch-depth: 0
1313
token: ${{ secrets.REPO_ACCESS_TOKEN }}
14-
- uses: actions/setup-node@v3
14+
- uses: actions/setup-node@v4
1515
with:
1616
node-version-file: '.nvmrc'
1717
cache: 'yarn'

.github/workflows/docpublish.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ jobs:
1010
runs-on: ubuntu-latest
1111
steps:
1212
- name: Checkout
13-
uses: actions/checkout@v3
13+
uses: actions/checkout@v4
1414

1515
- name: Install and Build
1616
run: |

.github/workflows/npmpublish-rc.yml

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,8 @@ jobs:
1818
build:
1919
runs-on: ubuntu-latest
2020
steps:
21-
- uses: actions/checkout@v3
22-
- uses: actions/setup-node@v3
21+
- uses: actions/checkout@v4
22+
- uses: actions/setup-node@v4
2323
with:
2424
node-version-file: '.nvmrc'
2525
cache: 'yarn'
@@ -31,8 +31,8 @@ jobs:
3131
needs: build
3232
runs-on: ubuntu-latest
3333
steps:
34-
- uses: actions/checkout@v3
35-
- uses: actions/setup-node@v3
34+
- uses: actions/checkout@v4
35+
- uses: actions/setup-node@v4
3636
with:
3737
node-version-file: '.nvmrc'
3838
cache: 'yarn'
@@ -44,9 +44,9 @@ jobs:
4444
run: yarn run bundle
4545
- name: Get current package version
4646
id: package_version
47-
run: echo "package_version=$(node -pe "require('./package.json').version")" >> $GITHUB_OUTPUT
47+
run: echo "package_version=$(node -pe "require('./package.json').version")" >> $GITHUB_OUTPUT
4848
- name: Publish to NPM
49-
run: yarn run publish --tag ${{ inputs.npm_tag }}
49+
run: yarn run publish --tag ${{ inputs.npm_tag }}
5050
env:
5151
YARN_NPM_AUTH_TOKEN: ${{secrets.npm_token}}
5252
- name: Repository Dispatch
@@ -55,4 +55,4 @@ jobs:
5555
token: ${{ secrets.REPO_ACCESS_TOKEN }}
5656
repository: KILTProtocol/docs
5757
event-type: sdk-update
58-
client-payload: '{"latestTag": "${{ steps.package_version.outputs.package_version }}"}'
58+
client-payload: '{"latestTag": "${{ steps.package_version.outputs.package_version }}"}'

.github/workflows/npmpublish.yml

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,8 @@ jobs:
66
build:
77
runs-on: ubuntu-latest
88
steps:
9-
- uses: actions/checkout@v3
10-
- uses: actions/setup-node@v3
9+
- uses: actions/checkout@v4
10+
- uses: actions/setup-node@v4
1111
with:
1212
node-version-file: '.nvmrc'
1313
cache: 'yarn'
@@ -19,8 +19,8 @@ jobs:
1919
needs: build
2020
runs-on: ubuntu-latest
2121
steps:
22-
- uses: actions/checkout@v3
23-
- uses: actions/setup-node@v3
22+
- uses: actions/checkout@v4
23+
- uses: actions/setup-node@v4
2424
with:
2525
node-version-file: '.nvmrc'
2626
cache: 'yarn'
@@ -32,7 +32,7 @@ jobs:
3232
run: yarn run bundle
3333
- name: Get current package version
3434
id: package_version
35-
run: echo "package_version=$(node -pe "require('./package.json').version")" >> $GITHUB_OUTPUT
35+
run: echo "package_version=$(node -pe "require('./package.json').version")" >> $GITHUB_OUTPUT
3636
- name: Publish to NPM
3737
run: yarn run publish --tag latest
3838
env:
@@ -43,4 +43,4 @@ jobs:
4343
token: ${{ secrets.REPO_ACCESS_TOKEN }}
4444
repository: KILTProtocol/docs
4545
event-type: sdk-update
46-
client-payload: '{"latestTag": "${{ steps.package_version.outputs.package_version }}"}'
46+
client-payload: '{"latestTag": "${{ steps.package_version.outputs.package_version }}"}'

.github/workflows/test-node-candidate.yml

Lines changed: 16 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -12,14 +12,13 @@ env:
1212
TESTCONTAINERS_WATCHER_IMG: testcontainers/ryuk:0.3.2
1313

1414
jobs:
15-
1615
build:
1716
runs-on: ubuntu-latest
1817

1918
steps:
20-
- uses: actions/checkout@v3
19+
- uses: actions/checkout@v4
2120
- name: Setup Node.js
22-
uses: actions/setup-node@v3
21+
uses: actions/setup-node@v4
2322
with:
2423
node-version-file: '.nvmrc'
2524
cache: 'yarn'
@@ -30,7 +29,7 @@ jobs:
3029
- name: zip build
3130
run: zip -r build.zip .
3231
- name: upload build
33-
uses: actions/upload-artifact@v3
32+
uses: actions/upload-artifact@v4
3433
with:
3534
name: build
3635
path: build.zip
@@ -39,7 +38,7 @@ jobs:
3938
runs-on: ubuntu-latest
4039
needs: build
4140
steps:
42-
- uses: actions/checkout@v3
41+
- uses: actions/checkout@v4
4342
- name: make sure testcontainers image is in cache
4443
uses: ./.github/actions/cached-image-pull
4544
with:
@@ -51,28 +50,28 @@ jobs:
5150
needs: cache_imgs
5251

5352
steps:
54-
- uses: actions/download-artifact@v3
53+
- uses: actions/download-artifact@v4
5554
with:
5655
name: build
5756
- name: unzip
5857
run: unzip build.zip -d .
5958
- name: Setup Node.js
60-
uses: actions/setup-node@v3
59+
uses: actions/setup-node@v4
6160
with:
6261
node-version-file: '.nvmrc'
6362
- name: Log out node version
6463
run: node --version
6564

6665
- name: Configure AWS credentials
67-
uses: aws-actions/configure-aws-credentials@v2
66+
uses: aws-actions/configure-aws-credentials@v4
6867
with:
6968
aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }}
7069
aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
7170
aws-region: eu-central-1
7271

7372
- name: Login to Amazon ECR
7473
id: login-ecr
75-
uses: aws-actions/amazon-ecr-login@v1
74+
uses: aws-actions/amazon-ecr-login@v2
7675

7776
- name: pull image
7877
env:
@@ -97,19 +96,19 @@ jobs:
9796
needs: build
9897

9998
steps:
100-
- uses: actions/download-artifact@v3
99+
- uses: actions/download-artifact@v4
101100
with:
102101
name: build
103102
- name: unzip
104103
run: unzip build.zip -d .
105104
- name: Setup Node.js
106-
uses: actions/setup-node@v3
105+
uses: actions/setup-node@v4
107106
with:
108107
node-version-file: '.nvmrc'
109108
- name: yarn bundle
110109
run: yarn bundle
111110
- name: upload bundle artifact
112-
uses: actions/upload-artifact@v3
111+
uses: actions/upload-artifact@v4
113112
with:
114113
name: checked-nonmin-bundle
115114
path: packages/sdk-js/dist/sdk-js.umd.js
@@ -120,29 +119,29 @@ jobs:
120119
needs: [cache_imgs, bundle_cache]
121120

122121
steps:
123-
- uses: actions/download-artifact@v3
122+
- uses: actions/download-artifact@v4
124123
with:
125124
name: build
126125
- name: unzip
127126
run: unzip build.zip -d .
128-
- uses: actions/download-artifact@v3
127+
- uses: actions/download-artifact@v4
129128
with:
130129
name: checked-nonmin-bundle
131130
path: packages/sdk-js/dist
132-
- uses: actions/setup-node@v3
131+
- uses: actions/setup-node@v4
133132
with:
134133
node-version-file: '.nvmrc'
135134
- run: basename /packages/sdk-js/dist/
136135
- name: Configure AWS credentials
137-
uses: aws-actions/configure-aws-credentials@v2
136+
uses: aws-actions/configure-aws-credentials@v4
138137
with:
139138
aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }}
140139
aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
141140
aws-region: eu-central-1
142141

143142
- name: Login to Amazon ECR
144143
id: login-ecr
145-
uses: aws-actions/amazon-ecr-login@v1
144+
uses: aws-actions/amazon-ecr-login@v2
146145
- name: pull node image
147146
env:
148147
ECR_REGISTRY: ${{ steps.login-ecr.outputs.registry }}

.github/workflows/tests-polkadot-deps.yml

Lines changed: 12 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -13,14 +13,14 @@ jobs:
1313

1414
strategy:
1515
matrix:
16-
node-version: [18.x, 20.x]
16+
node-version: [18.x, 20.x, 22.x]
1717

1818
steps:
19-
- uses: actions/checkout@v3
19+
- uses: actions/checkout@v4
2020
with:
2121
ref: master
2222
- name: Use Node.js ${{ matrix.node-version }}
23-
uses: actions/setup-node@v3
23+
uses: actions/setup-node@v4
2424
with:
2525
node-version: ${{ matrix.node-version }}
2626
cache: 'yarn'
@@ -35,7 +35,7 @@ jobs:
3535
- name: list dependencies
3636
run: echo "$(yarn info -A --name-only --json)" > locked_dependencies.txt
3737
- name: upload dependencies list
38-
uses: actions/upload-artifact@v3
38+
uses: actions/upload-artifact@v4
3939
with:
4040
name: deps-${{ matrix.node-version }}
4141
path: |
@@ -47,7 +47,7 @@ jobs:
4747
- name: zip build
4848
run: zip -r build.zip .
4949
- name: upload build
50-
uses: actions/upload-artifact@v3
50+
uses: actions/upload-artifact@v4
5151
with:
5252
name: build-${{ matrix.node-version }}
5353
path: build.zip
@@ -63,11 +63,13 @@ jobs:
6363
include:
6464
- node-version: 16.x
6565
required: 'optional'
66+
- node-version: 22.x
67+
required: 'optional'
6668

6769
continue-on-error: ${{ matrix.required == 'optional' }}
6870

6971
steps:
70-
- uses: actions/download-artifact@v3
72+
- uses: actions/download-artifact@v4
7173
with:
7274
name: build-${{ matrix.node-version }}
7375
- name: unzip
@@ -91,7 +93,7 @@ jobs:
9193
continue-on-error: ${{ matrix.required == 'optional' }}
9294

9395
steps:
94-
- uses: actions/download-artifact@v3
96+
- uses: actions/download-artifact@v4
9597
with:
9698
name: build-20.x
9799
- name: unzip
@@ -106,9 +108,9 @@ jobs:
106108

107109
- name: Login to Amazon ECR
108110
id: login-ecr
109-
uses: aws-actions/amazon-ecr-login@v1
111+
uses: aws-actions/amazon-ecr-login@v2
110112

111-
- name: pull image
113+
- name: pull node image
112114
env:
113115
ECR_REGISTRY: ${{ steps.login-ecr.outputs.registry }}
114116
ECR_REPOSITORY: kilt/prototype-chain
@@ -135,7 +137,7 @@ jobs:
135137
needs: [test, integration_test]
136138
if: failure()
137139
steps:
138-
- uses: actions/download-artifact@v3
140+
- uses: actions/download-artifact@v4
139141
with:
140142
name: deps-20.x
141143
- name: set dependencies env

0 commit comments

Comments
 (0)