Skip to content

Commit

Permalink
chore: update to node v20 (#315)
Browse files Browse the repository at this point in the history
* feat: specify yarn and node version on the package.json

* chore: bump node version on .nvmrc to lts/Iron

* chore: makes sure the GitHub workflows use node version 20

* =chore: re-run github checks

---------

Co-authored-by: Chris Chinchilla <chris@kilt.io>
  • Loading branch information
kilted-andres and ChrisChinchilla authored Jun 19, 2024
1 parent 1b297b7 commit 1e66644
Show file tree
Hide file tree
Showing 5 changed files with 35 additions and 31 deletions.
8 changes: 4 additions & 4 deletions .github/workflows/deploy-docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@ name: deploy

on:
workflow_run:
workflows: [ "test-code-examples" ]
branches: [ master ]
workflows: ['test-code-examples']
branches: [master]
types:
- completed

Expand All @@ -12,8 +12,8 @@ jobs:
if: (github.event_name != 'pull_request' && github.event.workflow_run.conclusion == 'success')
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version-file: '.nvmrc'
cache: 'yarn'
Expand Down
36 changes: 18 additions & 18 deletions .github/workflows/sdk-update-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,16 @@ name: test-docs-examples-2

on:
repository_dispatch:
types: [ sdk-update ]
types: [sdk-update]

jobs:
code_examples:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- name: Setup Node.js
uses: actions/setup-node@v3
uses: actions/setup-node@v4
with:
node-version-file: '.nvmrc'
cache: 'yarn'
Expand All @@ -23,8 +23,8 @@ jobs:
with:
find: '@kiltprotocol/sdk-js": "${{ steps.kiltprotocol_sdk.outputs.current_tag }}'
replace: '@kiltprotocol/sdk-js": "${{ github.event.client_payload.latestTag }}'
include: "code_examples/**/*"
exclude: "**/*.lock"
include: 'code_examples/**/*'
exclude: '**/*.lock'
regex: false
- name: Install and dedupe
working-directory: code_examples/sdk_examples/
Expand All @@ -41,12 +41,12 @@ jobs:
create_pull_request:
runs-on: ubuntu-latest
needs: [ code_examples ]
needs: [code_examples]
if: success() && !contains(github.event.client_payload.latestTag, 'rc')
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- name: Setup Node.js
uses: actions/setup-node@v3
uses: actions/setup-node@v4
with:
node-version-file: '.nvmrc'
cache: 'yarn'
Expand All @@ -58,21 +58,21 @@ jobs:
with:
find: '${{ steps.kiltprotocol_sdk.outputs.current_tag }}'
replace: '${{ github.event.client_payload.latestTag }}'
include: "docs/**/*.md"
include: 'docs/**/*.md'
regex: false
- uses: jacobtomlinson/gha-find-replace@v3
with:
find: '@kiltprotocol/sdk-js": "${{ steps.kiltprotocol_sdk.outputs.current_tag }}'
replace: '@kiltprotocol/sdk-js": "${{ github.event.client_payload.latestTag }}'
include: "code_examples/**/*"
exclude: "**/*.lock"
include: 'code_examples/**/*'
exclude: '**/*.lock'
regex: false
- uses: jacobtomlinson/gha-find-replace@v3
with:
find: '@kiltprotocol/sdk-js": "${{ steps.kiltprotocol_sdk.outputs.current_tag }}'
replace: '@kiltprotocol/sdk-js": "${{ github.event.client_payload.latestTag }}'
include: "scripts/**"
exclude: "**/*.lock"
include: 'scripts/**'
exclude: '**/*.lock'
regex: false
- name: Regenerate yarn lock for SDK examples
working-directory: code_examples/sdk_examples
Expand Down Expand Up @@ -102,22 +102,22 @@ jobs:
create_issue:
runs-on: ubuntu-latest
needs: [ code_examples ]
needs: [code_examples]
if: failure()
steps:
- name: Checkout
uses: actions/checkout@v3
uses: actions/checkout@v4
- name: Generate issue body
run: |
echo "ISSUE_BODY=[At least one of the test workflows](${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}) using the latest released SDK ${{ github.event.client_payload.latestTag }} on docs has failed." >> $GITHUB_ENV
- name: Create issue
id: issue
uses: imjohnbo/issue-bot@v3
with:
title: "[AUTOMATIC] New SDK ${{ github.event.client_payload.latestTag }} is incompatible with deployed docs examples"
title: '[AUTOMATIC] New SDK ${{ github.event.client_payload.latestTag }} is incompatible with deployed docs examples'
body: |
## Incompatible SDK detected
${{ env.ISSUE_BODY }}
### Tasks
Expand All @@ -129,6 +129,6 @@ jobs:
🧰 sdk
🚚 high
column: 📥 Inbox
assignees: "ntn-x2, rflechtner"
assignees: 'ntn-x2, rflechtner'
token: ${{ secrets.REPO_ACCESS_TOKEN }}
project-v2-path: orgs/KILTprotocol/projects/24
16 changes: 8 additions & 8 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,30 +5,30 @@ on:
branches:
- master
tags:
- "*"
- '*'
pull_request:
branches:
- "*"
- '*'

jobs:
code_examples:
name: Test code snippets
runs-on: ubuntu-latest
strategy:
matrix:
test_case: ["dapp", "workshop", "core"]
test_case: ['dapp', 'workshop', 'core']
required: ['required']
include:
- test_case: "staking"
- test_case: 'staking'
required: 'optional'

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

steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4

- name: Setup Node.js
uses: actions/setup-node@v3
uses: actions/setup-node@v4
with:
node-version-file: '.nvmrc'
cache: 'yarn'
Expand All @@ -54,10 +54,10 @@ jobs:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4

- name: Setup Node.js
uses: actions/setup-node@v3
uses: actions/setup-node@v4
with:
node-version-file: '.nvmrc'
cache: 'yarn'
Expand Down
2 changes: 1 addition & 1 deletion .nvmrc
Original file line number Diff line number Diff line change
@@ -1 +1 @@
lts/Hydrogen
lts/Iron
4 changes: 4 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,10 @@
"name": "docs",
"version": "2.1.0",
"private": true,
"packageManager": "yarn@1.22.22",
"engines": {
"node": ">= 20.0"
},
"scripts": {
"build": "yarn check-ts && yarn check-links && yarn generate-examples && docusaurus build",
"check-links": "yarn markdown-link-check -c markdown-link-check.config.json -q $(find docs -name '*.md')",
Expand Down

0 comments on commit 1e66644

Please sign in to comment.