Skip to content

Commit

Permalink
Limit the node version in GHA (#676)
Browse files Browse the repository at this point in the history
- 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`
  • Loading branch information
irahopkinson authored Dec 11, 2023
1 parent 4696ab6 commit 543f4e6
Show file tree
Hide file tree
Showing 4 changed files with 34 additions and 13 deletions.
13 changes: 9 additions & 4 deletions .github/workflows/package-main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,15 +13,14 @@ 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 }}

strategy:
matrix:
os: [windows-latest, macos-latest, ubuntu-latest]
dotnet_version: [7.0.x]
node_version: [18.x]

steps:
- name: Checkout git repo
Expand All @@ -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
Expand Down
8 changes: 7 additions & 1 deletion .github/workflows/publish-docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
13 changes: 9 additions & 4 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,15 +13,14 @@ 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 }}

strategy:
matrix:
os: [windows-latest, macos-latest, ubuntu-latest]
dotnet_version: [7.0.x]
node_version: [18.x]

steps:
- name: Checkout git repo
Expand All @@ -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
Expand Down
13 changes: 9 additions & 4 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,15 +16,14 @@ 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 }}

strategy:
matrix:
os: [macos-latest, windows-latest, ubuntu-latest]
dotnet_version: [7.0.x]
node_version: [18.x]

steps:
- name: Check out Git repository
Expand All @@ -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
Expand Down

0 comments on commit 543f4e6

Please sign in to comment.