-
Notifications
You must be signed in to change notification settings - Fork 19
62 lines (50 loc) · 1.3 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
56
57
58
59
60
61
62
name: build
on: push
jobs:
build:
runs-on: >-
${{
(matrix.os == 'mac' && matrix.arch == 'arm64') &&
'macos-14' ||
(fromJson('{"linux":"ubuntu-22.04","mac":"macos-13","win":"windows-2022"}')[matrix.os])
}}
continue-on-error: false
strategy:
fail-fast: false
matrix:
os: [linux, mac]
arch: [x64]
include:
- os: mac
arch: arm64
steps:
- name: Install mac dependencies
if: matrix.os == 'mac' && matrix.arch == 'x64'
run: brew install openblas
- name: Checkout
uses: actions/checkout@v4
- name: Test
run: |
yarn
yarn prepack
publish:
if: startsWith(github.ref, 'refs/tags/')
needs: [build]
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Get tag
run: echo "VERSION=${GITHUB_REF#refs/*/}" >> $GITHUB_ENV
- name: Set package version
run: |
npm config set git-tag-version=false
npm version $VERSION
- name: Install deps
run: yarn
- name: Publish npm package
uses: JS-DevTools/npm-publish@v3
with:
token: ${{ secrets.NPM_TOKEN }}
access: public
ignore-scripts: false