From 16116f4cad088f637eac713c75f9256d8775b485 Mon Sep 17 00:00:00 2001 From: Popotojs Date: Tue, 24 May 2022 12:17:13 +0200 Subject: [PATCH 1/2] use github action for build and release npm audit fix --- .github/workflows/ci.yml | 29 +++++++++++++++++++++++++++++ .github/workflows/npm-publish.yml | 30 ++++++++++++++++++++++++++++++ README.md | 4 ++-- package-lock.json | 16 ++++++++-------- package.json | 2 +- 5 files changed, 70 insertions(+), 11 deletions(-) create mode 100644 .github/workflows/ci.yml create mode 100644 .github/workflows/npm-publish.yml diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 0000000..fbb51e3 --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,29 @@ +name: CI + +on: + push: + pull_request: + branches: + - develop + - main + +jobs: + popoto_tests: + name: Run all tests + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + - uses: actions/setup-node@v2 + with: + node-version: 16 + cache: "npm" + - name: Install npm dependencies + run: npm ci + - name: Build code + run: npm run build + - name: Run all the tests + run: npm test + - name: publish code coverage on CC + uses: paambaati/codeclimate-action@v3.0.0 + env: + CC_TEST_REPORTER_ID: ${{ secrets.CC_TEST_REPORTER_ID }} \ No newline at end of file diff --git a/.github/workflows/npm-publish.yml b/.github/workflows/npm-publish.yml new file mode 100644 index 0000000..f8e99ae --- /dev/null +++ b/.github/workflows/npm-publish.yml @@ -0,0 +1,30 @@ +name: Node.js Package + +on: + release: + types: [created] + +jobs: + build: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + - uses: actions/setup-node@v2 + with: + node-version: 16 + - run: npm ci + + publish-npm: + needs: build + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + - uses: actions/setup-node@v2 + with: + node-version: 16 + registry-url: https://registry.npmjs.org/ + - run: npm ci + - run: npm run build + - run: npm publish --access public + env: + NODE_AUTH_TOKEN: ${{secrets.NPM_PUBLISH_AUTOMATION}} diff --git a/README.md b/README.md index 9e1945a..a629fe2 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@ -

+

popoto logo

-[![Build Status](https://app.travis-ci.com/Nhogs/popoto.svg?branch=master)](https://app.travis-ci.com/Nhogs/popoto) +[![CI](https://github.com/nhogs/popoto/actions/workflows/ci.yml/badge.svg)](https://github.com/Nhogs/popoto/actions/workflows/ci.yml) [![npm version](https://img.shields.io/npm/v/popoto.svg)](https://www.npmjs.com/package/popoto) [![License: GPL v3](https://img.shields.io/badge/License-GPL%20v3-blue.svg)](https://www.gnu.org/licenses/gpl-3.0) [![Maintainability](https://api.codeclimate.com/v1/badges/d00736e10d4c630c2010/maintainability)](https://codeclimate.com/github/Nhogs/popoto/maintainability) diff --git a/package-lock.json b/package-lock.json index c18d818..d9ff878 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "popoto", - "version": "3.0.2", + "version": "3.0.3", "lockfileVersion": 2, "requires": true, "packages": { "": { "name": "popoto", - "version": "3.0.2", + "version": "3.0.3", "license": "GPL-3.0", "dependencies": { "d3": "^5.15.0" @@ -5532,9 +5532,9 @@ } }, "node_modules/minimist": { - "version": "1.2.5", - "resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.5.tgz", - "integrity": "sha512-FM9nNUYrRBAELZQT3xeZQ7fmMOBg6nWNmJKTcgsJeaLstP/UODVpGsr5OhXhhXg6f+qtJ8uiZ+PUxkDWcgIXLw==", + "version": "1.2.6", + "resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.6.tgz", + "integrity": "sha512-Jsjnk4bw3YJqYzbdyBiNsPWHPfO++UGG749Cxs6peCu5Xg4nrena6OVxOYxrQTqww0Jmwt+Ref8rggumkTLz9Q==", "dev": true }, "node_modules/mkdirp": { @@ -11024,9 +11024,9 @@ } }, "minimist": { - "version": "1.2.5", - "resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.5.tgz", - "integrity": "sha512-FM9nNUYrRBAELZQT3xeZQ7fmMOBg6nWNmJKTcgsJeaLstP/UODVpGsr5OhXhhXg6f+qtJ8uiZ+PUxkDWcgIXLw==", + "version": "1.2.6", + "resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.6.tgz", + "integrity": "sha512-Jsjnk4bw3YJqYzbdyBiNsPWHPfO++UGG749Cxs6peCu5Xg4nrena6OVxOYxrQTqww0Jmwt+Ref8rggumkTLz9Q==", "dev": true }, "mkdirp": { diff --git a/package.json b/package.json index decd3c6..944935a 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "popoto", - "version": "3.0.2", + "version": "3.0.3", "description": "Graph based search interface for Neo4j database.", "keywords": [ "popoto", From fb6f80cf1ebcdbe15bc9646340152fdd5690ffb5 Mon Sep 17 00:00:00 2001 From: Popotojs Date: Tue, 24 May 2022 12:19:44 +0200 Subject: [PATCH 2/2] use github action for build and release --- .github/workflows/ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index fbb51e3..4e2bad7 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -26,4 +26,4 @@ jobs: - name: publish code coverage on CC uses: paambaati/codeclimate-action@v3.0.0 env: - CC_TEST_REPORTER_ID: ${{ secrets.CC_TEST_REPORTER_ID }} \ No newline at end of file + CC_TEST_REPORTER_ID: ${{ secrets.CC_TEST_REPORTER_ID }}