Skip to content

Commit

Permalink
Merge pull request #56 from LCMApps/add-github-action-for-npm-releases
Browse files Browse the repository at this point in the history
Add GitHub action for NPM releases
  • Loading branch information
oleh-poberezhets committed Jan 23, 2020
2 parents e1b9dd2 + cab4c45 commit b6edbd8
Show file tree
Hide file tree
Showing 4 changed files with 72 additions and 2 deletions.
54 changes: 54 additions & 0 deletions .github/workflows/npm_publish.yml
@@ -0,0 +1,54 @@
name: NPM Release

on:
release:
types: [published, edited]

jobs:
check:
name: Check version and tag
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v1
- name: Get package version
shell: bash
id: package_version
run: |
ver=$(jq .version package.json | sed -e "s/^\"//" -e "s/\"//")
echo "::set-output name=version::$ver"
- name: Compare package version and release tag
if: steps.package_version.outputs.version != github.event.release.tag_name
env:
TAG: "${{ github.event.release.tag_name }}"
PKG_VER: ${{ steps.package_version.outputs.version }}
run: |
echo "Mismatch NPM version $PKG_VER and git tag $TAG"
exit 1
build:
name: Lint and test
needs: check
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v1
- uses: actions/setup-node@v1
with:
node-version: 12
- run: yarn install --frozen-lock-file
- run: yarn lint
- run: yarn test

publish-npm:
name: Publish to NPM
needs: [check, build]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v1
- uses: actions/setup-node@v1
with:
node-version: 12
registry-url: https://registry.npmjs.org/
- run: yarn install --frozen-lock-file
- run: yarn publish
env:
NODE_AUTH_TOKEN: ${{secrets.NPM_TOKEN}}
5 changes: 5 additions & 0 deletions CHANGELOG.md
@@ -1,6 +1,11 @@
## Changelog

### 1.2.1

- Dependencies was bumped

### 1.2.0

- Algorithm of calculation free memory was tuned and now it considers `SReclaimable` as a memory that may be freed (`free` in the output).
- Minor bug with timers in tests was fixed.
- Versions of devDependencies were bumped.
Expand Down
1 change: 1 addition & 0 deletions README.md
@@ -1,6 +1,7 @@
# System Health Monitor for node

[![NPM version](https://img.shields.io/npm/v/system-health-monitor.svg)](https://www.npmjs.com/package/system-health-monitor)
[![Release Status](https://github.com/LCMApps/system-health-monitor/workflows/NPM%20Release/badge.svg)](https://github.com/LCMApps/system-health-monitor/releases)
[![Build Status](https://travis-ci.org/LCMApps/system-health-monitor.svg?branch=master)](https://travis-ci.org/LCMApps/system-health-monitor)
[![Coverage Status](https://coveralls.io/repos/github/LCMApps/system-health-monitor/badge.svg?branch=master)](https://coveralls.io/github/LCMApps/system-health-monitor?branch=master)

Expand Down
14 changes: 12 additions & 2 deletions package.json
@@ -1,6 +1,6 @@
{
"name": "system-health-monitor",
"version": "1.2.0",
"version": "1.2.1",
"description": "This module implements service that check RAM and CPU characteristics and decides according to passed config that instance is overloaded",
"main": "index.js",
"scripts": {
Expand All @@ -13,7 +13,17 @@
"type": "git",
"url": "https://github.com/LCMApps/system-health-monitor.git"
},
"keywords": ["health", "status", "monitor", "healthcheck", "cpu", "mem", "usage", "memory", "utilization"],
"keywords": [
"health",
"status",
"monitor",
"healthcheck",
"cpu",
"mem",
"usage",
"memory",
"utilization"
],
"license": "MIT",
"engines": {
"node": ">=8.1"
Expand Down

0 comments on commit b6edbd8

Please sign in to comment.