Skip to content

Commit

Permalink
Merge pull request #3 from kollegorna/feat/add-npm-publish
Browse files Browse the repository at this point in the history
Add action for npm publish
  • Loading branch information
Joakim Nylén authored Feb 3, 2020
2 parents 569204e + 1b7e28c commit 9f4ae42
Show file tree
Hide file tree
Showing 4 changed files with 34 additions and 4 deletions.
30 changes: 30 additions & 0 deletions .github/workflows/npmpublish.yml
Original file line number Diff line number Diff line change
@@ -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/[email protected]
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}}
1 change: 1 addition & 0 deletions .tool-versions
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
nodejs 12.9.0
5 changes: 2 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,19 +2,18 @@

A vanilla JS replacement for (Rails) [Cocoon](https://github.com/nathanvda/cocoon)'s jQuery script


## Usage

Replace `<commit>` with the corresponding values:

```
yarn add git+https://github.com/kollegorna/cocoon-vanilla-js.git#<commit>
yarn add @kollegorna/cocoon-vanilla-js
```

Import as ES6 module:

```js
import 'cocoon-vanilla-js'
import "cocoon-vanilla-js";
```

## Notes
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -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",
Expand Down

0 comments on commit 9f4ae42

Please sign in to comment.