Skip to content

Commit

Permalink
1.0.6
Browse files Browse the repository at this point in the history
* fixes #12
* fixes coapjs/node-coap#208
* fixes #2 (hopefully)
* fixes coapjs/node-coap#209 (hopefully)
* add github actions
* update deps
  • Loading branch information
Apollon77 committed Apr 13, 2020
1 parent 8734c1d commit 3d54ce2
Show file tree
Hide file tree
Showing 10 changed files with 1,585 additions and 9 deletions.
103 changes: 103 additions & 0 deletions .github/workflows/test-and-release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,103 @@
# This is a composition of lint and test scripts
# Make sure to update this file along with the others

name: Test and Release

# Run this job on all pushes and pull requests
# as well as tags with a semantic version
on:
push:
branches:
- '*'
tags:
- 'v?[0-9]+.[0-9]+.[0-9]+'
pull_request: {}

jobs:
# Performs quick checks before the expensive test runs
check-and-lint:
if: contains(github.event.head_commit.message, '[skip ci]') == false

runs-on: ubuntu-latest

strategy:
matrix:
node-version: [12.x]

steps:
- uses: actions/checkout@v1
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v1
with:
node-version: ${{ matrix.node-version }}


- name: Install Dependencies
run: npm ci

# Runs adapter tests on all supported node versions and OSes
lib-tests:
if: contains(github.event.head_commit.message, '[skip ci]') == false

needs: [check-and-lint]

runs-on: ${{ matrix.os }}
strategy:
matrix:
node-version: [8.x, 10.x, 12.x]
os: [ubuntu-latest, windows-latest, macos-latest]
exclude:
# Don't test Node.js 8 on Windows. npm is weird here
- os: windows-latest
node-version: 8.x

steps:
- uses: actions/checkout@v1
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v1
with:
node-version: ${{ matrix.node-version }}

- name: Install Dependencies
run: npm ci

- name: Run local tests
run: npm test

# Deploys the final package to NPM
deploy:
needs: [lib-tests]

# Trigger this step only when a commit on master is tagged with a version number
if: |
contains(github.event.head_commit.message, '[skip ci]') == false &&
github.event_name == 'push' &&
github.event.base_ref == 'refs/heads/master' &&
startsWith(github.ref, 'refs/tags/')
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [12.x]

steps:
- uses: actions/checkout@v1
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v1
with:
node-version: ${{ matrix.node-version }}

- name: Install Dependencies
run: npm ci

- name: Publish package to npm
run: |
npm config set //registry.npmjs.org/:_authToken=${{ secrets.NPM_TOKEN }}
npm whoami
npm publish
# Dummy job for skipped builds - without this, github reports the build as failed
skip-ci:
if: contains(github.event.head_commit.message, '[skip ci]')
runs-on: ubuntu-latest
steps:
- name: Skip build
run: echo "Build skipped!"
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,4 @@ src/old.cc
node_modules
*.build
npm-debug.log
.idea
3 changes: 3 additions & 0 deletions .npmignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
test
.travis.yml
appveyor.yml
.idea
node_modules
package-lock.json
4 changes: 2 additions & 2 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,10 @@ os:
- windows
language: node_js
node_js:
- '4'
- '6'
- '8'
- '10'
- '12'
- 'node'
before_install:
- 'if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then curl -L https://codeclimate.com/downloads/test-reporter/test-reporter-latest-linux-amd64 > ./cc-test-reporter; fi'
- 'if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then chmod +x ./cc-test-reporter; fi'
Expand Down
2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
MIT License

Copyright (c) 2018 Ingo Fischer
Copyright (c) 2018-2020 Ingo Fischer

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
Expand Down
4 changes: 4 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,10 @@ The library also offers a index-dummy.js which offers the same interface then th

## Changelog

### v1.0.6 (2020.04.13)
* subscribe to error and timeout event and forward as error to the library caller
* Add option to set a specific multicast interface for COAP-server (thanks tol @SamLowrie)

### v1.0.5 (2020.01.25)
* bugfixing a npm publish error

Expand Down
3 changes: 1 addition & 2 deletions appveyor.yml
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@
version: 'test-{build}'
environment:
matrix:
- nodejs_version: '4'
- nodejs_version: '6'
- nodejs_version: '8'
- nodejs_version: '10'
- nodejs_version: '12'
platform:
- x86
- x64
Expand Down
8 changes: 8 additions & 0 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -191,6 +191,14 @@ class ShellyIot extends EventEmitter {
}
});

this.coapServer.on('error', (err) => {
this.emit('error', error);
});

this.coapServer.on('timeout', (err) => {
this.emit('error', error);
});

// the default CoAP port is 5683
this.coapServer.listen(5683, () => {
callback && callback();
Expand Down

0 comments on commit 3d54ce2

Please sign in to comment.