Skip to content

chore: Refactor main workflow #1

chore: Refactor main workflow

chore: Refactor main workflow #1

Workflow file for this run

name: CI
on:
push:
branches:
- main
tags:
- v*.*.*
jobs:
job_lint:
name: Lint
runs-on: ubuntu-latest
steps:
- name: Checkout, Setup Node.js v${{ env.NODE_VERSION }} and Install dependencies
uses: manferlo81/action-checkout-node-install@v0
with:
node-version: ${{ env.NODE_VERSION }}
env:
NODE_VERSION: 20.x
- name: Lint
run: npm run lint
job_test_and_build:
strategy:
matrix:
os:
- name: Ubuntu
image: ubuntu-latest
node-version:
- 18.x
- 20.x
name: Test and Build ( ${{ matrix.os.name }}, Node.js v${{ matrix.node-version }} )
runs-on: ${{ matrix.os.image }}
needs: job_lint
steps:
- name: Checkout, Setup Node.js v${{ matrix.node-version }} and Install dependencies
uses: manferlo81/action-checkout-node-install@v0
with:
node-version: ${{ matrix.node-version }}
- name: Test
run: npm test
env:
SKIP_COVERAGE: true
- name: Build
run: npm run build
job_upload_coverage:
name: Upload Coverage
runs-on: ubuntu-latest
if: github.event_name == 'push' && github.ref_type == 'branch'
needs: job_test_and_build
steps:
- run: echo "not implemented yet..."
job_create_release:
name: Create GitHub Release
runs-on: ubuntu-latest
if: github.ref_type == 'tag'
needs: job_test_and_build
permissions:
contents: write
steps:
- name: Checkout, Setup Node.js v20.x and Install dependencies
uses: manferlo81/action-checkout-node-install@v0
with:
node-version: 20.x
- name: Build
run: npm run build
- name: Create Tarball
run: npm pack
- name: Create release
uses: manferlo81/action-auto-release@v0
with:
files: map-number-*.tgz
job_publish_to_npm:
name: Publish Package to npm Registry
runs-on: ubuntu-latest
if: github.ref_type == 'tag'
needs: job_test_and_build
steps:
- run: echo "not implemented yet..."