From 0f6e91693d92f41bf56bc54f42947643e1c12c0e Mon Sep 17 00:00:00 2001 From: jnylen Date: Mon, 3 Feb 2020 16:00:27 +0100 Subject: [PATCH 1/3] Add action to auto publish to npmjs on releases --- .github/workflows/npmpublish.yml | 30 ++++++++++++++++++++++++++++++ package.json | 2 +- 2 files changed, 31 insertions(+), 1 deletion(-) create mode 100644 .github/workflows/npmpublish.yml diff --git a/.github/workflows/npmpublish.yml b/.github/workflows/npmpublish.yml new file mode 100644 index 0000000..e7cae6d --- /dev/null +++ b/.github/workflows/npmpublish.yml @@ -0,0 +1,30 @@ +name: Node.js Package + +on: + release: + types: [created] + +jobs: + build: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + + - name: Install nodejs dependencies + run: sudo apt-get install gpg dirmngr + + - name: Install nodejs + uses: asdf-vm/actions/install@v1.0.0 + with: + before_install: bash ~/.asdf/plugins/nodejs/bin/import-release-team-keyring + + - name: Install dependencies + run: yarn install + + - name: Publish the package to npmjs + run: | + npm config set //registry.npmjs.org/:_authToken=$NODE_AUTH_TOKEN + npm config set scope "@kollegorna" + npm publish --access public + env: + NODE_AUTH_TOKEN: ${{secrets.NPM_AUTH_TOKEN}} diff --git a/package.json b/package.json index c194e66..4913010 100644 --- a/package.json +++ b/package.json @@ -1,5 +1,5 @@ { - "name": "cocoon-vanilla-js", + "name": "@kollegorna/cocoon-vanilla-js", "version": "1.0.2", "description": "A vanilla JS replacement for (Rails) Cocoon's jQuery script", "main": "index.js", From 14bdc0b6b8f1ddfdf0b59b43cb169b70e2ec7407 Mon Sep 17 00:00:00 2001 From: jnylen Date: Mon, 3 Feb 2020 16:00:53 +0100 Subject: [PATCH 2/3] Update readme for the npmjs release --- README.md | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 2eb0d1c..7638961 100644 --- a/README.md +++ b/README.md @@ -2,19 +2,18 @@ A vanilla JS replacement for (Rails) [Cocoon](https://github.com/nathanvda/cocoon)'s jQuery script - ## Usage Replace `` with the corresponding values: ``` -yarn add git+https://github.com/kollegorna/cocoon-vanilla-js.git# +yarn add @kollegorna/cocoon-vanilla-js ``` Import as ES6 module: ```js -import 'cocoon-vanilla-js' +import "cocoon-vanilla-js"; ``` ## Notes From 1b7e28c82b7eb610b911c375a75f67e06983afdc Mon Sep 17 00:00:00 2001 From: jnylen Date: Mon, 3 Feb 2020 16:01:05 +0100 Subject: [PATCH 3/3] Add asdf .tool-versions --- .tool-versions | 1 + 1 file changed, 1 insertion(+) create mode 100644 .tool-versions diff --git a/.tool-versions b/.tool-versions new file mode 100644 index 0000000..b1d3983 --- /dev/null +++ b/.tool-versions @@ -0,0 +1 @@ +nodejs 12.9.0