-
Notifications
You must be signed in to change notification settings - Fork 0
55 lines (47 loc) · 1.38 KB
/
build.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
42
43
44
45
46
47
48
49
50
51
52
53
54
55
# This workflow will build PRs submitted to the main branch.
name: 🐳 Build
on:
push:
branches:
- main
paths:
- "src/**"
- "types/**"
workflow_dispatch:
jobs:
release:
name: 👷 Build
if: ${{ github.ref == 'refs/heads/main' }}
strategy:
matrix:
node-version: [ 12.x, 14.x, 16.x ]
os: [ ubuntu-latest, macOS-latest ]
runs-on: ${{ matrix.os }}
steps:
- name: ⬇️ Checkout
id: checkout
uses: actions/[email protected]
- name: 🟢 Setup node
id: setup-node
uses: actions/setup-node@v2
with:
node-version: ${{ matrix.node-version }}
- name: 🛠️ Bootstrap Dependencies
id: bootstrap-dependencies-with-cache
run: |
npm install -g yarn
yarn install --immutable --immutable-cache --check-cache --ignore-engines
- name: 🏗️ Build
id: build-the-lib
run: yarn build
- name: 🐱 Get yarn cache directory path
id: yarn-cache-dir-path
run: echo "::set-output name=dir::$(yarn cache dir)"
- name: 🔆 Cache Yarn Packages
uses: actions/cache@v3
id: yarn-cache
with:
path: ${{ steps.yarn-cache-dir-path.outputs.dir }}
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
restore-keys: |
${{ runner.os }}-yarn-