Skip to content

fix(ts): emit types as well #2

fix(ts): emit types as well

fix(ts): emit types as well #2

Workflow file for this run

name: validate
on:
push:
branches:
- '+([0-9])?(.{+([0-9]),x}).x'
- 'main'
- 'next'
- 'next-major'
- 'beta'
- 'alpha'
- '!all-contributors/**'
pull_request: {}
jobs:
prepare:
name: 🎫 Prepare
runs-on: ubuntu-latest
steps:
- name: ⬇️ Checkout repo
uses: actions/checkout@v3
- name: βŽ” Setup node
uses: actions/setup-node@v3
with:
node-version: 18
- name: πŸ’Ύ Cache Node Modules
id: node-cache
uses: actions/cache@v3
with:
path: node_modules
key: node-modules-${{ hashFiles('package-lock.json') }}
- name: πŸ“₯ Download deps
if: steps.node-cache.outputs.cache-hit != 'true'
run: npm install
lint:
name: 🧼 ESLint
runs-on: ubuntu-latest
needs: prepare
steps:
- name: ⬇️ Checkout repo
uses: actions/checkout@v3
- name: βŽ” Setup node
uses: actions/setup-node@v3
with:
node-version: 18
- name: πŸ’Ύ Cache Node Modules
id: node-cache
uses: actions/cache@v3
with:
path: node_modules
key: node-modules-${{ hashFiles('package-lock.json') }}
- name: 🧼 Lint
run: npm run lint
typescript:
name: πŸ— TypeScript
runs-on: ubuntu-latest
needs: prepare
steps:
- name: ⬇️ Checkout repo
uses: actions/checkout@v3
- name: βŽ” Setup node
uses: actions/setup-node@v3
with:
node-version: 18
- name: πŸ’Ύ Cache Node Modules
id: node-cache
uses: actions/cache@v3
with:
path: node_modules
key: node-modules-${{ hashFiles('package-lock.json') }}
- name: πŸ’Ύ Cache Build
id: lib-cache
uses: actions/cache@v3
with:
path: lib
key: lib-${{github.sha}}
- name: πŸ— TypeScript
run: npm run build
test:
# ignore all-contributors PRs
if: ${{ !contains(github.head_ref, 'all-contributors') }}
strategy:
matrix:
node: [16, 18, 19]
runs-on: ubuntu-latest
needs: prepare
name: πŸ§ͺ Test
steps:
- name: πŸ›‘ Cancel Previous Runs
uses: styfle/cancel-workflow-action@0.11.0
with:
access_token: ${{ secrets.GITHUB_TOKEN }}
- name: ⬇️ Checkout repo
uses: actions/checkout@v3
- name: βŽ” Setup node
uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node }}
- name: πŸ’Ύ Cache Node Modules
id: node-cache
uses: actions/cache@v3
with:
path: node_modules
key: node-modules-${{ hashFiles('package-lock.json') }}
- name: πŸ§ͺ Test
run: npm test
- name: ⬆️ Upload coverage report
uses: codecov/codecov-action@v3
release:
name: πŸš€ Release
if:
${{ github.repository == 'arcath/cancant' &&
contains('refs/heads/main,refs/heads/beta,refs/heads/next,refs/heads/alpha',
github.ref) && github.event_name == 'push' }}
runs-on: ubuntu-latest
needs: [typescript, lint, test]
steps:
- name: ⬇️ Checkout repo
uses: actions/checkout@v3
- name: πŸ’Ύ Cache Build
id: lib-cache
uses: actions/cache@v3
with:
path: lib
key: lib-${{github.sha}}
- name: πŸ” Inspect Lib
run: ls -R lib/
- name: 🚒 Release
uses: cycjimmy/semantic-release-action@v3
with:
semantic_version: 17
branches: |
[
'+([0-9])?(.{+([0-9]),x}).x',
'main',
'next',
'next-major',
{name: 'beta', prerelease: true},
{name: 'alpha', prerelease: true}
]
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}