From 71c19843e8483ebb49a91a829fceed6bf3314bff Mon Sep 17 00:00:00 2001 From: Alexander Twrdik <6052859+DiCanio@users.noreply.github.com> Date: Wed, 28 Feb 2024 09:59:27 +0100 Subject: [PATCH 1/2] feat: update github actions Updates relevant GitHub actions to support Node.js 20+. --- .github/actions/build/action.yml | 32 +++++++++--------- .github/actions/install/action.yml | 52 +++++++++++++++--------------- 2 files changed, 42 insertions(+), 42 deletions(-) diff --git a/.github/actions/build/action.yml b/.github/actions/build/action.yml index 3e79502..87b39ef 100644 --- a/.github/actions/build/action.yml +++ b/.github/actions/build/action.yml @@ -1,20 +1,20 @@ -name: 'Build' -description: 'Prepares the repo for a job by running the build' +name: "Build" +description: "Prepares the repo for a job by running the build" runs: - using: 'composite' + using: "composite" steps: - - name: Use cache - id: 'cache' - uses: actions/cache@v3 - with: - path: | - **/dist/** - **/bin/** - key: ${{ runner.os }}-build-${{ github.sha }} + - name: Use cache + id: "cache" + uses: actions/cache@v4 + with: + path: | + **/dist/** + **/bin/** + key: ${{ runner.os }}-build-${{ github.sha }} - - name: Build - shell: bash - if: steps.cache.outputs.cache-hit != 'true' - run: | - npm run build + - name: Build + shell: bash + if: steps.cache.outputs.cache-hit != 'true' + run: | + npm run build diff --git a/.github/actions/install/action.yml b/.github/actions/install/action.yml index 21f4f15..711946c 100644 --- a/.github/actions/install/action.yml +++ b/.github/actions/install/action.yml @@ -1,37 +1,37 @@ -name: 'Install' -description: 'Prepares the repo for a job by checking out and installing dependencies' +name: "Install" +description: "Prepares the repo for a job by checking out and installing dependencies" inputs: node-version: - description: 'The node version to setup' + description: "The node version to setup" required: true registry-url: - description: 'Define registry-url' + description: "Define registry-url" required: false runs: - using: 'composite' + using: "composite" steps: - - name: echo github.ref - shell: bash - run: echo ${{ github.ref }} + - name: echo github.ref + shell: bash + run: echo ${{ github.ref }} - - name: Use Node.js ${{ inputs.node-version }} - uses: actions/setup-node@v3 - with: - node-version: ${{ inputs.node-version }} - registry-url: ${{ inputs.registry-url }} + - name: Use Node.js ${{ inputs.node-version }} + uses: actions/setup-node@v4 + with: + node-version: ${{ inputs.node-version }} + registry-url: ${{ inputs.registry-url }} - - name: Use cache - uses: actions/cache@v3 - with: - path: | - node_modules - */*/node_modules - key: ${{ runner.os }}-install-${{ hashFiles('**/package.json') }} - restore-keys: | - ${{ runner.os }}-install- + - name: Use cache + uses: actions/cache@v4 + with: + path: | + node_modules + */*/node_modules + key: ${{ runner.os }}-install-${{ hashFiles('**/package.json') }} + restore-keys: | + ${{ runner.os }}-install- - - name: Install - shell: bash - run: | - npm ci + - name: Install + shell: bash + run: | + npm ci From f7136af13179292c11b93fe1ca039c57df7de326 Mon Sep 17 00:00:00 2001 From: Alexander Twrdik <6052859+DiCanio@users.noreply.github.com> Date: Wed, 28 Feb 2024 10:04:46 +0100 Subject: [PATCH 2/2] feat: update to nodejs 20 Updates the project to Node.js 20 which is the current LTS version. Also aligns the GitHub actions with this new version. --- .github/workflows/main.yml | 94 +++++++++++++++++++------------------- package-lock.json | 2 +- package.json | 4 +- 3 files changed, 50 insertions(+), 50 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index a0e9dfd..5282728 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -13,7 +13,7 @@ permissions: pull-requests: write env: - PRIMARY_NODE_VERSION: 18 + PRIMARY_NODE_VERSION: 20 jobs: install: @@ -32,20 +32,20 @@ jobs: needs: [build] runs-on: ubuntu-latest steps: - - name: Checkout - uses: actions/checkout@v4 + - name: Checkout + uses: actions/checkout@v4 - - name: Install - uses: ./.github/actions/install - with: - node-version: ${{ env.PRIMARY_NODE_VERSION }} + - name: Install + uses: ./.github/actions/install + with: + node-version: ${{ env.PRIMARY_NODE_VERSION }} - - name: Build - uses: ./.github/actions/build + - name: Build + uses: ./.github/actions/build - - name: Lint - run: | - npm run lint + - name: Lint + run: | + npm run lint build: name: Build @@ -66,43 +66,43 @@ jobs: needs: [build] runs-on: ubuntu-latest steps: - - name: Checkout - uses: actions/checkout@v4 + - name: Checkout + uses: actions/checkout@v4 - - name: Install - uses: ./.github/actions/install - with: - node-version: ${{ env.PRIMARY_NODE_VERSION }} + - name: Install + uses: ./.github/actions/install + with: + node-version: ${{ env.PRIMARY_NODE_VERSION }} - - name: Build - uses: ./.github/actions/build + - name: Build + uses: ./.github/actions/build - - name: Run tests - run: | - npm run test + - name: Run tests + run: | + npm run test release: name: Release needs: [lint, tests] runs-on: ubuntu-latest steps: - - name: Checkout - uses: actions/checkout@v4 + - name: Checkout + uses: actions/checkout@v4 - - name: Install - uses: ./.github/actions/install - with: - node-version: ${{ env.PRIMARY_NODE_VERSION }} + - name: Install + uses: ./.github/actions/install + with: + node-version: ${{ env.PRIMARY_NODE_VERSION }} - - name: Build - uses: ./.github/actions/build + - name: Build + uses: ./.github/actions/build #- name: Release - #env: - # GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - # NPM_TOKEN: ${{ secrets.NPM_TOKEN }} - # - # run: npx semantic-release + #env: + # GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + # NPM_TOKEN: ${{ secrets.NPM_TOKEN }} + # + # run: npx semantic-release coverage: name: Coverage @@ -110,20 +110,20 @@ jobs: runs-on: ubuntu-latest if: ${{ github.ref_name == 'master' }} steps: - - name: Checkout - uses: actions/checkout@v4 + - name: Checkout + uses: actions/checkout@v4 - - name: Install - uses: ./.github/actions/install - with: - node-version: ${{ env.PRIMARY_NODE_VERSION }} + - name: Install + uses: ./.github/actions/install + with: + node-version: ${{ env.PRIMARY_NODE_VERSION }} - - name: Build - uses: ./.github/actions/build + - name: Build + uses: ./.github/actions/build - - name: Coverage - run: | - npm run test:coverage + - name: Coverage + run: | + npm run test:coverage #- name: Upload report # uses: codecov/codecov-action@v3.1.4 diff --git a/package-lock.json b/package-lock.json index bb199f3..8fceeed 100644 --- a/package-lock.json +++ b/package-lock.json @@ -50,7 +50,7 @@ "typescript": "^5.3.3" }, "engines": { - "node": ">=18.0.0" + "node": ">=20.0.0" } }, "node_modules/@aashutoshrathi/word-wrap": { diff --git a/package.json b/package.json index d3534c5..f828c84 100644 --- a/package.json +++ b/package.json @@ -25,7 +25,7 @@ "dist" ], "engines": { - "node": ">=18.0.0" + "node": ">=20.0.0" }, "scripts": { "build:types": "tsc --emitDeclarationOnly", @@ -89,4 +89,4 @@ ".js": "npm run lint:fix", "*.ts": "npm run lint:fix" } -} +} \ No newline at end of file