name: nightly

on:
  workflow_dispatch:

jobs:
  build:

    runs-on: ubuntu-latest

    strategy:
      matrix:
        node-version: [14.18.3, 16.13.2, 18.19.1, 20.11.1 ]

    steps:
    - uses: actions/checkout@v4

    - name: Use Node.js ${{ matrix.node-version }}
      uses: actions/setup-node@v4
      with:
        node-version: ${{ matrix.node-version }}

    - run: npm ci
    - run: npm run build --if-present
    - run: npm test
    - run: npm pack

    - name: Upload artifact
      uses: actions/upload-artifact@v4
      with:
        path: uhppoted-0.8.8.tgz
        name: uhppoted-0.8.8-alpha-${{ matrix.node-version }}.tgz
