.github/workflows/main.yml
name: CI
on:
push:
branches: [ master, dev ]
pull_request:
branches: [ master, dev ]
workflow_dispatch:
jobs:
build_and_test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
with:
submodules: recursive
- name: Build Web Library
working-directory: ./lib/web
run: |
npm install -g typescript
npm install
tsc
- name: Build Server Library
working-directory: ./lib/server/lib
run: |
npm install
tsc
- name: Build
run: |
npm install
npm run build
- name: Quality
run: |
npm run lint
- name: Publish Web Artifacts
uses: actions/upload-artifact@v2
with:
name: web
path: |
dist/web/*
!dist/web/*.txt
- name: Publish Documentation
uses: actions/upload-artifact@v2
with:
name: docs
path: |
docs/out/*
- name: Upload code coverage
uses: codecov/codecov-action@v2
with:
files: coverage/cobertura-coverage.xml
verbose: true
- name: Configure Publish
run: |
git config --global user.name 'CI'
git config --global user.email 'ci@openhps.org'
- name: Bump version development
if: github.ref == 'refs/heads/dev'
run: |
npm run bump:development
- name: Bump version release
if: github.ref == 'refs/heads/master'
run: |
npm run bump:release
- name: Publish to NPM
uses: JS-DevTools/npm-publish@v1
if: github.ref == 'refs/heads/master' || github.ref == 'refs/heads/dev'
with:
token: ${{ secrets.NPM_TOKEN }}
- name: Publish to GitHub
if: success()
run: |
git push