Skip to content

Commit

Permalink
Prepare to publish on npm on release
Browse files Browse the repository at this point in the history
Related to #23
  • Loading branch information
alagane committed Mar 24, 2022
1 parent 1441491 commit bc9131a
Show file tree
Hide file tree
Showing 2 changed files with 34 additions and 1 deletion.
33 changes: 33 additions & 0 deletions .github/workflows/npm-publish.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
# This workflow will run tests using node and then publish a package to npm repository 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: 16
- run: npm install
- run: npm test

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 install
- run: npm publish
env:
NODE_AUTH_TOKEN: ${{secrets.npm_token}}
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"name": "jmap-client-ts",
"version": "1.0.0",
"description": "Jmap Library in Typescript",
"main": "jmap-client-ts.js",
"main": "lib/index.js",
"scripts": {
"build": "tsc",
"lint": "eslint 'src/**/*.ts' 'tests/**/*.ts'",
Expand Down

0 comments on commit bc9131a

Please sign in to comment.