commit 526e823e3eedffb6bf050d52650ecddf31ce7c90
parent f7b85d1c6982e14d6b30b90b7539282659ee77cc
Author: finwo <finwo@pm.me>
Date: Mon, 11 May 2020 09:53:53 +0200
Updated workflows to not publish on pull request
Diffstat:
3 files changed, 50 insertions(+), 46 deletions(-)
diff --git a/.github/workflows/nodejs.yml b/.github/workflows/nodejs.yml
@@ -1,46 +0,0 @@
-# This workflow will do a clean install of node dependencies, build the source code and run tests across different versions of node
-# For more information see: https://help.github.com/actions/language-and-framework-guides/using-nodejs-with-github-actions
-
-name: Node.js CI
-
-on:
- push:
- branches: [ master ]
- pull_request:
- branches: [ master ]
-
-jobs:
- build:
-
- runs-on: ubuntu-latest
-
- strategy:
- matrix:
- node-version: [10.x, 12.x]
-
- steps:
- - uses: actions/checkout@v2
- - name: Use Node.js ${{ matrix.node-version }}
- uses: actions/setup-node@v1
- with:
- node-version: ${{ matrix.node-version }}
- - run: npm ci
- - run: npm run build --if-present
- - run: npm test
- env:
- CI: true
-
- publish:
- needs: build
- runs-on: ubuntu-latest
- steps:
- - uses: actions/checkout@v2
- - uses: actions/setup-node@v1
- with:
- node-version: 12
- registry-url: https://registry.npmjs.org/
- - run: npm ci
- - run: npm build
- - run: if [ $(npm view $(node -p "require('./package.json').name") version) != $(node -p "require('./package.json').version") ]; then npm publish ; fi
- env:
- NODE_AUTH_TOKEN: ${{secrets.npm_token}}
diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml
@@ -0,0 +1,23 @@
+name: Test and publish
+
+on:
+ push:
+ branches:
+ - master
+
+jobs:
+
+ publish:
+ needs: build
+ runs-on: ubuntu-latest
+ steps:
+ - uses: actions/checkout@v2
+ - uses: actions/setup-node@v1
+ with:
+ node-version: 12
+ registry-url: https://registry.npmjs.org/
+ - run: npm ci
+ - run: npm build
+ - run: if [ $(npm view $(node -p "require('./package.json').name") version) != $(node -p "require('./package.json').version") ]; then npm publish ; fi
+ env:
+ NODE_AUTH_TOKEN: ${{secrets.npm_token}}
diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml
@@ -0,0 +1,27 @@
+name: Test and publish
+
+on:
+ push:
+ branches-ignore:
+ - master
+
+jobs:
+ build:
+
+ runs-on: ubuntu-latest
+
+ strategy:
+ matrix:
+ node-version: [10.x, 12.x]
+
+ steps:
+ - uses: actions/checkout@v2
+ - name: Use Node.js ${{ matrix.node-version }}
+ uses: actions/setup-node@v1
+ with:
+ node-version: ${{ matrix.node-version }}
+ - run: npm ci
+ - run: npm run build --if-present
+ - run: npm test
+ env:
+ CI: true