Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 15 additions & 9 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,21 +5,27 @@ name: Node.js CI

on:
push:
branches: [ master ]
tags: [v*]
branches:
- master
- release-*
tags:
- v*
pull_request:
branches: [ master ]
branches:
- master
- release-*

jobs:
build:
runs-on: ubuntu-latest

env:
NODE_VER: 10
steps:
- uses: actions/checkout@v2
- name: Use Node.js
uses: actions/setup-node@v1
with:
node-version: 10
node-version: ${{ env.NODE_VER }}

- run: npm ci
env:
Expand All @@ -31,16 +37,16 @@ jobs:

- name: Is Release?
if: startswith(github.ref, 'refs/tags/v')
run: echo "##[set-env name=DEPLOY_PACKAGE;]true"
run: echo "::set-env name=DEPLOY_PACKAGE::true"

- name: Publish to npm
if: env.DEPLOY_PACKAGE == 'true'
run: npm set registry https://registry.npmjs.org/ && npm publish
run: npm set registry https://registry.npmjs.org/ && npm publish --access public
env:
NODE_AUTH_TOKEN: ${{secrets.npm_token}}
NODE_AUTH_TOKEN: ${{secrets.NPM_TOKEN}}

- name: Publish to github
if: env.DEPLOY_PACKAGE == 'true'
run: npm set registry https://npm.pkg.github.com/ && npm publish
env:
NODE_AUTH_TOKEN: ${{secrets.GITHUB_TOKEN}}
NODE_AUTH_TOKEN: ${{secrets.GITHUB_TOKEN}}