forked from foxglove/wasm-bz2
-
Notifications
You must be signed in to change notification settings - Fork 0
53 lines (44 loc) · 1.27 KB
/
ci.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
name: CI
on:
push:
branches: [main]
tags: ["v*"]
pull_request:
branches: ["*"]
jobs:
build:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
node-version:
- 16.x
- 18.x
steps:
- uses: actions/checkout@v2
with:
lfs: true
- uses: actions/setup-node@v2
with:
node-version: ${{ matrix.node-version }}
registry-url: https://registry.npmjs.org
- run: yarn install --immutable
- run: yarn run build:ts
- run: yarn run lint:ci
- name: Restore emscripten build cache
uses: actions/[email protected]
with:
path: |
.emscripten_cache
key: 1-emscripten-${{ hashFiles('build.sh') }}
restore-keys: |
1-emscripten-
- run: yarn run build:wasm
# Catch Node import failures that don't reproduce in Jest <https://github.com/foxglove/wasm-bz2/issues/4>
- run: node -e 'require("./dist/index.js").default.init()'
- run: yarn run test
- name: Publish to NPM
if: ${{ startsWith(github.ref, 'refs/tags/v') && matrix.node-version == '16.x' }}
run: npm publish --access public
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_PUBLISH_TOKEN }}