43 lines (43 loc) · 1.21 KB
/
publish.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
name: npm publish
on:
push:
branches:
- master
jobs:
publish:
runs-on: self-hosted
steps:
- name: checkout
uses: actions/checkout@v2
- name: node v12
uses: actions/setup-node@v1
with:
node-version: 12
- name: npm install, build, and test
run: |
npm install
npm run build --if-present
npm test
env:
CI: true
- name: ensure universal binary (arm64/x86_64)
run: |
file fsevents.node
file fsevents.node | grep -q arm64 || (echo "arm64 binary not built"; exit 1)
file fsevents.node | grep -q x86_64 || (echo "x86_64 binary not built"; exit 1)
- id: publish
name: npm publish
uses: JS-DevTools/npm-publish@v1
with:
token: ${{ secrets.NPM_TOKEN }}
- if: steps.publish.outputs.type != 'none'
name: github release
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: v${{ steps.publish.outputs.version }}
release_name: Release v${{ steps.publish.outputs.version }}
body: Released to npm as v${{ steps.publish.outputs.version }}
draft: false
prerelease: false