Skip to content

Build Main

Build Main #281

Workflow file for this run

name: Build Main
on:
push:
branches:
- main
schedule:
# <minute [0,59]> <hour [0,23]> <day of the month [1,31]> <month of the year [1,12]> <day of the week [0,6]>
# https://pubs.opengroup.org/onlinepubs/9699919799/utilities/crontab.html#tag_20_25_07
# Run every Monday at 18:00:00 UTC (Monday at 10:00:00 PST)
- cron: '0 18 * * 1'
jobs:
test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v1
- name: Setup Node
uses: actions/setup-node@v1
with:
node-version: '16.x'
- name: Install Dependencies
run: |
npm i
- name: Run Tests
run: |
CI=true npm run test
lint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v1
- name: Setup Node
uses: actions/setup-node@v1
with:
node-version: '16.x'
- name: Install Dependencies
run: |
npm i
- name: Run Lint
run: |
npm run lint
- name: Run Format Check
run: |
npm run checkFormat
publish:
needs: [test, lint]
if: github.event_name == 'push' && contains(github.event.head_commit.message, 'Bump version')
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v1
- name: Setup Node
uses: actions/setup-node@v1
with:
node-version: '16.x'
registry-url: 'https://registry.npmjs.org'
- name: Install Dependencies
run: |
npm i
- name: Run Build
run: |
npm run build
- name: Publish to npm
run: npm publish
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}