-
Notifications
You must be signed in to change notification settings - Fork 88
41 lines (41 loc) · 1.16 KB
/
main.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
name: CI
on:
pull_request:
branches:
- master
push:
branches:
- master
jobs:
test:
name: Test on node ${{ matrix.node_version }}
runs-on: ubuntu-latest
strategy:
matrix:
node_version: [16, 18]
steps:
- uses: actions/checkout@master
- name: Use Node.js ${{ matrix.node_version }}
uses: actions/setup-node@master
with:
node-version: ${{ matrix.node_version }}
- name: Install
run: yarn --ignore-engines
- name: Build
run: yarn build
- name: Test
run: yarn test
- name: Bundle Size
run: yarn bundlesize
- name: Publish Canary
env: # Or as an environment variable
NODE_AUTH_TOKEN: ${{ secrets.NODE_AUTH_TOKEN }}
run: |
echo "Fork PR: ${{github.repository}}"
if [ "${{github.repository}}" == "Urigo/SOFA" ] && [ "${{ secrets.NODE_AUTH_TOKEN }}" != "" ]
then
echo "//registry.npmjs.org/:_authToken=${{ secrets.NODE_AUTH_TOKEN }}" > .npmrc
npm run release
else
echo "Skipping canary publish due to a fork/PR..."
fi