39 lines
1.1 KiB
YAML
39 lines
1.1 KiB
YAML
name: publish npm package
|
|
|
|
on:
|
|
release:
|
|
types: [created]
|
|
workflow_dispatch:
|
|
|
|
jobs:
|
|
build:
|
|
runs-on: ubuntu-latest
|
|
strategy:
|
|
matrix:
|
|
node-version: [14.x]
|
|
emsdk-version: [3.1.21]
|
|
steps:
|
|
- uses: actions/checkout@v3
|
|
- name: build emulators
|
|
uses: actions/setup-node@v3
|
|
with:
|
|
node-version: ${{ matrix.node-version }}
|
|
cache: 'npm'
|
|
registry-url: https://registry.npmjs.org/
|
|
- run: npm install -g yarn
|
|
- run: yarn
|
|
- run: yarn run eslint src --ext ts,tsx --max-warnings 0
|
|
- run: yarn run eslint test --ext ts,tsx --max-warnings 0
|
|
- run: yarn run tsc --noEmit
|
|
- run: git clone https://github.com/emscripten-core/emsdk.git
|
|
- run: cd emsdk && ./emsdk install ${{ matrix.emsdk-version }} && ./emsdk activate ${{ matrix.emsdk-version }} && cd ..
|
|
- run: source ./emsdk/emsdk_env.sh && yarn run gulp
|
|
- run: npm publish
|
|
env:
|
|
NODE_AUTH_TOKEN: ${{secrets.NODE_AUTH_TOKEN}}
|
|
- name: upload
|
|
uses: actions/upload-artifact@v3.0.0
|
|
with:
|
|
name: 'dist'
|
|
path: 'dist'
|