/nodejs-versions

The current Node.js LTS versions for use in automation scripts

Primary LanguageJavaScriptGNU General Public License v3.0GPL-3.0

nodejs-versions

Update versions

The current major Node.js versions for use in automation scripts.

At the moment the list is maintained by hand.

My packages are always tested against the officialy supported LTS (active) versions.

Files

file stages
current.json Only current
lts.json Only active LTS
lts-current.json LTS + current

Data source

Github action

Here the lts.json is retrieved and made available in needs.lts_versions.outputs.matrix. Then in the build you convert the JSON array to a matrix.

jobs:
  lts_versions:
    name: "Get versions"
    runs-on: ubuntu-latest
    steps:
      - id: set-matrix
        run: echo "matrix=$(curl -s https://raw.githubusercontent.com/fvdm/nodejs-versions/main/lts.json)" >> $GITHUB_OUTPUT
    outputs:
      matrix: ${{ steps.set-matrix.outputs.matrix }}

  build:
    name: "Node"
    needs: lts_versions
    runs-on: ubuntu-latest
    strategy:
      matrix:
        node-version: ${{ fromJson(needs.lts_versions.outputs.matrix) }}
    steps:
    - uses: actions/checkout@v2
    - name: Test on Node.js ${{ matrix.node-version }}
      uses: actions/setup-node@v2
      with:
        node-version: ${{ matrix.node-version }}
    - run: npm install
    - run: npm test