From a8ed157f872a3f3b604d6a5f90e1d22fc92a1c15 Mon Sep 17 00:00:00 2001 From: weiyang Date: Tue, 14 Jul 2020 21:03:24 +0800 Subject: [PATCH] add github workflow for publish --- .github/workflows/publish.yml | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) create mode 100644 .github/workflows/publish.yml diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml new file mode 100644 index 0000000..8c34b29 --- /dev/null +++ b/.github/workflows/publish.yml @@ -0,0 +1,29 @@ +# This is a basic workflow to help you get started with Actions + +name: Publish + +# Controls when the action will run. Triggers the workflow on push or pull request +# events but only for the master branch +on: + release: + types: [published] + +# A workflow run is made up of one or more jobs that can run sequentially or in parallel +jobs: + # This workflow contains a single job called "build" + build: + # The type of runner that the job will run on + runs-on: ubuntu-latest + + # Steps represent a sequence of tasks that will be executed as part of the job + steps: + - uses: actions/checkout@v1 + - uses: actions/setup-node@v1 + with: + node-version: 8 + registry-url: https://registry.npmjs.org/ + + - run: yarn install + - run: npm publish + env: + NODE_AUTH_TOKEN: ${{secrets.NPM_TOKEN}}