Skip to content

Update node version #80

Update node version

Update node version #80

Workflow file for this run

name: push-workflow
on: [push]
jobs:
build:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
node-version: [16.x, 18.x, 20.x]
steps:
- uses: actions/checkout@v1
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v1
with:
node-version: ${{ matrix.node-version }}
- name: Versions
run: |
node -v
npm -v
- name: Install
run: npm install
- name: Lint
run: npm run lint
- name: Build
run: npm run build
- name: Stash dist
uses: actions/upload-artifact@master
with:
name: dist ${{matrix.node-version}}
path: dist/
test:
runs-on: ubuntu-latest
needs: build
strategy:
fail-fast: false
matrix:
node-version: [16.x, 18.x, 20.x]
steps:
- uses: actions/checkout@v1
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v1
with:
node-version: ${{ matrix.node-version }}
- name: Unstash dist
uses: actions/download-artifact@master
with:
name: dist ${{matrix.node-version}}
path: 'dist/'
- name: Install
run: npm install
- name: Test
env:
CLOUDFLARE_EMAIL: ${{ secrets.TESTS__CLOUDFLARE_EMAIL }}
CLOUDFLARE_KEY: ${{ secrets.TESTS__CLOUDFLARE_KEY }}
CLOUDFLARE_DOMAIN: ${{ secrets.TESTS__CLOUDFLARE_DOMAIN }}
run: npm test -- --email=$CLOUDFLARE_EMAIL --key=$CLOUDFLARE_KEY --domain=$CLOUDFLARE_DOMAIN
- name: Check test coverage
run: npm run test:coverage
publish:
runs-on: ubuntu-latest
needs: test
if: github.ref == 'refs/heads/master'
steps:
- uses: actions/checkout@v1
- name: Use Node.js 20.x
uses: actions/setup-node@v1
with:
node-version: 20.x
registry-url: 'https://registry.npmjs.org'
- name: Unstash dist
uses: actions/download-artifact@master
with:
name: dist 20.x
path: 'dist/'
- name: Install
run: npm install
- name: Publish on NPM
run: npm publish
env:
NODE_AUTH_TOKEN: ${{secrets.NPM_TOKEN}}