kong-sdk
Version:
The open source Kong SDK built by VEED
102 lines (97 loc) • 2.79 kB
YAML
name: Node.js Package
on:
push:
branches:
- '*'
release:
types: [created]
jobs:
install:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v2
with:
node-version: '15.x'
- run: npm install
- name: Cache Gradle packages
uses: actions/cache@v2
with:
key: node_modules-${{ hashFiles('package-lock.json') }}
path: |
./node_modules
./dist
restore-keys: node_modules-${{ hashFiles('package-lock.json') }}
lint:
needs: [install]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v2
with:
node-version: '15.x'
- name: Cache Gradle packages
uses: actions/cache@v2
with:
key: node_modules-${{ hashFiles('package-lock.json') }}
path: |
./node_modules
./dist
restore-keys: node_modules-${{ hashFiles('package-lock.json') }}
- run: npm run lint
compile:
needs: [lint]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v2
with:
node-version: '15.x'
- name: Cache Gradle packages
uses: actions/cache@v2
with:
key: node_modules-${{ hashFiles('package-lock.json') }}
path: |
./node_modules
./dist
restore-keys: node_modules-${{ hashFiles('package-lock.json') }}
- run: npm run build
test:
needs: [compile]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v2
with:
node-version: '15.x'
- name: Cache Gradle packages
uses: actions/cache@v2
with:
key: node_modules-${{ hashFiles('package-lock.json') }}
path: |
./node_modules
./dist
restore-keys: node_modules-${{ hashFiles('package-lock.json') }}
- run: npm run test
publish:
needs: [test]
runs-on: ubuntu-latest
if: github.event_name == 'release' && github.event.action == 'created'
steps:
- uses: actions/checkout@v2
# Setup .npmrc file to publish to npm
- uses: actions/setup-node@v2
with:
node-version: '15.x'
registry-url: 'https://registry.npmjs.org'
- name: Cache Gradle packages
uses: actions/cache@v2
with:
key: node_modules-${{ hashFiles('package-lock.json') }}
path: |
./node_modules
./dist
restore-keys: node_modules-${{ hashFiles('package-lock.json') }}
- run: npm publish
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}