From 9aed96a313ad19f40e6cdac9a7dc8f021914ba47 Mon Sep 17 00:00:00 2001 From: Isuru Liyanage Date: Fri, 29 Oct 2021 17:34:40 +0530 Subject: [PATCH 1/2] npm_publish_workflow Workflow to publish to npm on release --- npm-publish.yml | 50 +++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 50 insertions(+) create mode 100644 npm-publish.yml diff --git a/npm-publish.yml b/npm-publish.yml new file mode 100644 index 0000000..c47499e --- /dev/null +++ b/npm-publish.yml @@ -0,0 +1,50 @@ +# This workflow will run tests using node and then publish a package to GitHub Packages when a release is created +# For more information see: https://help.github.com/actions/language-and-framework-guides/publishing-nodejs-packages + +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: 14 + - run: npm ci + - run: npm test + + publish-npm: + needs: build + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + - uses: actions/setup-node@v2 + with: + node-version: 14 + registry-url: https://registry.npmjs.org/ + - run: npm ci + - run: npm publish --access public + env: + NODE_AUTH_TOKEN: ${{secrets.npm_token}} + + publish-gpr: + needs: build + runs-on: ubuntu-latest + permissions: + contents: read + packages: write + steps: + - uses: actions/checkout@v2 + - uses: actions/setup-node@v2 + with: + node-version: 14 + registry-url: https://npm.pkg.github.com/ + - run: npm ci + - run: npm publish + env: + NODE_AUTH_TOKEN: ${{secrets.GITHUB_TOKEN}} From 675b7353f25a047e41c1c9f5fca7f03ee5117d75 Mon Sep 17 00:00:00 2001 From: Isuru Liyanage Date: Fri, 29 Oct 2021 13:12:09 +0100 Subject: [PATCH 2/2] npm publish script, add ebi-ait scope --- npm-publish.yml | 19 +------------------ package-lock.json | 4 ++-- package.json | 4 ++-- 3 files changed, 5 insertions(+), 22 deletions(-) diff --git a/npm-publish.yml b/npm-publish.yml index c47499e..9938f6a 100644 --- a/npm-publish.yml +++ b/npm-publish.yml @@ -30,21 +30,4 @@ jobs: - run: npm ci - run: npm publish --access public env: - NODE_AUTH_TOKEN: ${{secrets.npm_token}} - - publish-gpr: - needs: build - runs-on: ubuntu-latest - permissions: - contents: read - packages: write - steps: - - uses: actions/checkout@v2 - - uses: actions/setup-node@v2 - with: - node-version: 14 - registry-url: https://npm.pkg.github.com/ - - run: npm ci - - run: npm publish - env: - NODE_AUTH_TOKEN: ${{secrets.GITHUB_TOKEN}} + NODE_AUTH_TOKEN: ${{secrets.NPM_TOKEN}} diff --git a/package-lock.json b/package-lock.json index a3db8fd..b5a30d6 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,6 +1,6 @@ { - "name": "biovalidator", - "version": "1.9.0", + "name": "@ebi-ait/biovalidator", + "version": "1.10.1", "lockfileVersion": 1, "requires": true, "dependencies": { diff --git a/package.json b/package.json index c6a603d..082e442 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { - "name": "biovalidator", - "version": "1.9.1", + "name": "@ebi-ait/biovalidator", + "version": "1.10.1", "description": "A nodejs JSON schema validator service. Extended from Ajv to include ontology validation.", "main": "src/server.js", "repository": "https://github.com/elixir-europe/biovalidator.git",