From 543f4e666a0ec58a55d74fa89519df108ecb2ece Mon Sep 17 00:00:00 2001 From: Ira Hopkinson Date: Tue, 12 Dec 2023 05:12:00 +1300 Subject: [PATCH] Limit the node version in GHA (#676) - fixes build error "TypeError [ERR_UNKNOWN_FILE_EXTENSION]: Unknown file extension ".ts" for /home/runner/work/paranext-core/paranext-core/lib/papi-dts/edit-papi-d-ts.ts" - read node version from `package.json` --- .github/workflows/package-main.yml | 13 +++++++++---- .github/workflows/publish-docs.yml | 8 +++++++- .github/workflows/publish.yml | 13 +++++++++---- .github/workflows/test.yml | 13 +++++++++---- 4 files changed, 34 insertions(+), 13 deletions(-) diff --git a/.github/workflows/package-main.yml b/.github/workflows/package-main.yml index 2ce6623a9b..f213e427e4 100644 --- a/.github/workflows/package-main.yml +++ b/.github/workflows/package-main.yml @@ -13,7 +13,7 @@ on: jobs: publish: - name: Main on ${{ matrix.os }}, .Net ${{ matrix.dotnet_version }}, node ${{ matrix.node_version }} + name: Main on ${{ matrix.os }}, .Net ${{ matrix.dotnet_version }} runs-on: ${{ matrix.os }} @@ -21,7 +21,6 @@ jobs: matrix: os: [windows-latest, macos-latest, ubuntu-latest] dotnet_version: [7.0.x] - node_version: [18.x] steps: - name: Checkout git repo @@ -30,12 +29,18 @@ jobs: - name: Install .NET uses: actions/setup-dotnet@v3 with: - dotnet-version: ${{matrix.dotnet_version}} + dotnet-version: ${{ matrix.dotnet_version }} + + - name: Read package.json + id: package_json + uses: zoexx/github-action-json-file-properties@release + with: + file_path: 'package.json' - name: Install Node and NPM uses: actions/setup-node@v3 with: - node-version: ${{ matrix.node_version }} + node-version: ${{ fromJson(steps.package_json.outputs.volta).node }} cache: npm - name: Install and build diff --git a/.github/workflows/publish-docs.yml b/.github/workflows/publish-docs.yml index f5b40658be..21c118ed4a 100644 --- a/.github/workflows/publish-docs.yml +++ b/.github/workflows/publish-docs.yml @@ -13,10 +13,16 @@ jobs: - name: Checkout git repo uses: actions/checkout@v3 + - name: Read package.json + id: package_json + uses: zoexx/github-action-json-file-properties@release + with: + file_path: 'package.json' + - name: Install Node and NPM uses: actions/setup-node@v3 with: - node-version: 18.x + node-version: ${{ fromJson(steps.package_json.outputs.volta).node }} cache: npm - name: Install and build diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index 07849f9ad4..0c33e10aa8 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -13,7 +13,7 @@ on: jobs: publish: - name: Release on ${{ matrix.os }}, .Net ${{ matrix.dotnet_version }}, node ${{ matrix.node_version }} + name: Release on ${{ matrix.os }}, .Net ${{ matrix.dotnet_version }} runs-on: ${{ matrix.os }} @@ -21,7 +21,6 @@ jobs: matrix: os: [windows-latest, macos-latest, ubuntu-latest] dotnet_version: [7.0.x] - node_version: [18.x] steps: - name: Checkout git repo @@ -30,12 +29,18 @@ jobs: - name: Install .NET uses: actions/setup-dotnet@v3 with: - dotnet-version: ${{matrix.dotnet_version}} + dotnet-version: ${{ matrix.dotnet_version }} + + - name: Read package.json + id: package_json + uses: zoexx/github-action-json-file-properties@release + with: + file_path: 'package.json' - name: Install Node and NPM uses: actions/setup-node@v3 with: - node-version: ${{ matrix.node_version }} + node-version: ${{ fromJson(steps.package_json.outputs.volta).node }} cache: npm - name: Install and build diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 073b9140b3..1093bff0b6 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -16,7 +16,7 @@ on: jobs: test: - name: Build on ${{ matrix.os }}, .Net ${{ matrix.dotnet_version }}, node ${{ matrix.node_version }} + name: Build on ${{ matrix.os }}, .Net ${{ matrix.dotnet_version }} runs-on: ${{ matrix.os }} @@ -24,7 +24,6 @@ jobs: matrix: os: [macos-latest, windows-latest, ubuntu-latest] dotnet_version: [7.0.x] - node_version: [18.x] steps: - name: Check out Git repository @@ -33,12 +32,18 @@ jobs: - name: Install .NET uses: actions/setup-dotnet@v3 with: - dotnet-version: ${{matrix.dotnet_version}} + dotnet-version: ${{ matrix.dotnet_version }} + + - name: Read package.json + id: package_json + uses: zoexx/github-action-json-file-properties@release + with: + file_path: 'package.json' - name: Install Node.js and NPM uses: actions/setup-node@v3 with: - node-version: ${{ matrix.node_version }} + node-version: ${{ fromJson(steps.package_json.outputs.volta).node }} cache: npm - name: npm install