Skip to content

DROP - release 4.1.7-beta.4 #43

DROP - release 4.1.7-beta.4

DROP - release 4.1.7-beta.4 #43

Workflow file for this run

name: ci
on:
push:
branches:
- master
tags:
- v*
pull_request:
jobs:
build-and-lint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
# Cache packages when the branch is not update-dependencies or dependabot/*
- name: Resolve caching
id: cache
if: ${{ github.ref_name != 'update-dependencies' && !startsWith(github.ref_name, 'dependabot/') }}
run: echo "PACKAGE=npm" >> $GITHUB_OUTPUT
- name: Use Node.js
uses: actions/[email protected]
with:
node-version-file: ".nvmrc"
cache: ${{ steps.cache.outputs.PACKAGE }}
cache-key: ${{ runner.os }}-node-${matrix.version}-${{ hashFiles('**/package-lock.json') }}
- name: Install dependencies
run: npm ci
- name: Build
run: npm run build
- name: Lint
run: npm run lint
- name: Upload dist files
uses: actions/upload-artifact@v3
with:
name: dist-files
retention-days: 1
path: |
lib/**/*
test:
needs:
- build-and-lint
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
version: [20, 18, 16, 14]
steps:
- uses: actions/checkout@v3
# Cache packages when the branch is not update-dependencies or dependabot/*
- name: Resolve caching
id: cache
if: ${{ github.ref_name != 'update-dependencies' && !startsWith(github.ref_name, 'dependabot/') }}
run: echo "PACKAGE=npm" >> $GITHUB_OUTPUT
- name: Use Node.js
uses: actions/[email protected]
with:
node-version: ${{ matrix.version }}
cache: ${{ steps.cache.outputs.PACKAGE }}
cache-key: ${{ runner.os }}-node-${matrix.version}-${{ hashFiles('**/package-lock.json') }}
- name: Install dependencies
run: npm ci
- name: Download dist files
uses: actions/download-artifact@v3
with:
name: dist-files
- name: Test
run: npm run test
publish:
# Run only for version tags
if: contains(github.ref, 'refs/tags/v')
needs:
- test
runs-on: ubuntu-latest
permissions:
id-token: write
steps:
- uses: actions/checkout@v3
# Cache packages when the branch is not update-dependencies or dependabot/*
- name: Resolve caching
id: cache
if: ${{ github.ref_name != 'update-dependencies' && !startsWith(github.ref_name, 'dependabot/') }}
run: echo "PACKAGE=npm" >> $GITHUB_OUTPUT
- name: Use Node.js
uses: actions/[email protected]
with:
node-version-file: ".nvmrc"
cache: ${{ steps.cache.outputs.PACKAGE }}
cache-key: ${{ runner.os }}-node-${matrix.version}-${{ hashFiles('**/package-lock.json') }}
- name: Install dependencies
run: npm ci
- name: Download dist files
uses: actions/download-artifact@v3
with:
name: dist-files
- name: Publish
run: npm run release
env:
NPM_CONFIG_PROVENANCE: true
NODE_AUTH_TOKEN: ${{secrets.NPM_TOKEN}}
GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}}