Build Main #288
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 }} |