iobroker.ring 1.2.4-0 → 2.0.0-beta.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.eslintignore +4 -4
- package/.eslintrc.js +39 -39
- package/.github/ISSUE_TEMPLATE/bug_report.md +33 -33
- package/.github/dependabot.yml +8 -8
- package/.github/tsconfig.check.json +15 -15
- package/.github/tsconfig.json +38 -38
- package/.github/workflows/test-and-release.yml +143 -143
- package/.github/workflows/test-only.yml +75 -75
- package/LICENSE +21 -21
- package/README.md +157 -145
- package/admin/index_m.html +251 -251
- package/admin/ring.png +0 -0
- package/admin/words.js +213 -213
- package/io-package.json +318 -281
- package/lib/datapoints.js +344 -344
- package/lib/ringapiclient.js +436 -436
- package/package.json +18 -16
- package/ring.js +899 -863
- package/.commitmessage +0 -4
package/.eslintignore
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
# Files doesn't need to be checked
|
|
2
|
-
gulpfile.js
|
|
3
|
-
/lib/utils.js
|
|
4
|
-
/admin/
|
|
1
|
+
# Files doesn't need to be checked
|
|
2
|
+
gulpfile.js
|
|
3
|
+
/lib/utils.js
|
|
4
|
+
/admin/
|
|
5
5
|
/test/
|
package/.eslintrc.js
CHANGED
|
@@ -1,39 +1,39 @@
|
|
|
1
|
-
'use strict';
|
|
2
|
-
|
|
3
|
-
module.exports = {
|
|
4
|
-
'extends': ['eslint:recommended', 'plugin:react/recommended'],
|
|
5
|
-
'parserOptions': {
|
|
6
|
-
'ecmaVersion': 8,
|
|
7
|
-
'ecmaFeatures': {
|
|
8
|
-
'experimentalObjectRestSpread': true,
|
|
9
|
-
'jsx': true
|
|
10
|
-
},
|
|
11
|
-
'sourceType': 'module'
|
|
12
|
-
},
|
|
13
|
-
'env': {
|
|
14
|
-
'node': true,
|
|
15
|
-
'es6': true
|
|
16
|
-
},
|
|
17
|
-
'rules': {
|
|
18
|
-
'no-console': ['warn'],
|
|
19
|
-
'no-undef': ['error'],
|
|
20
|
-
'no-unused-vars': ['warn'],
|
|
21
|
-
'one-var': 'off',
|
|
22
|
-
'arrow-parens': ['error', 'always'],
|
|
23
|
-
'semi': ['error', 'always'],
|
|
24
|
-
'indent': ['error', 2, {
|
|
25
|
-
'SwitchCase': 1
|
|
26
|
-
}],
|
|
27
|
-
'max-len': [
|
|
28
|
-
'warn',
|
|
29
|
-
{
|
|
30
|
-
'code': 200,
|
|
31
|
-
'ignoreTemplateLiterals': true,
|
|
32
|
-
'ignoreStrings': true
|
|
33
|
-
}
|
|
34
|
-
],
|
|
35
|
-
'generator-star-spacing': 'off',
|
|
36
|
-
'func-names': ['error', 'never'],
|
|
37
|
-
'quotes': ['error', 'single']
|
|
38
|
-
}
|
|
39
|
-
}
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
module.exports = {
|
|
4
|
+
'extends': ['eslint:recommended', 'plugin:react/recommended'],
|
|
5
|
+
'parserOptions': {
|
|
6
|
+
'ecmaVersion': 8,
|
|
7
|
+
'ecmaFeatures': {
|
|
8
|
+
'experimentalObjectRestSpread': true,
|
|
9
|
+
'jsx': true
|
|
10
|
+
},
|
|
11
|
+
'sourceType': 'module'
|
|
12
|
+
},
|
|
13
|
+
'env': {
|
|
14
|
+
'node': true,
|
|
15
|
+
'es6': true
|
|
16
|
+
},
|
|
17
|
+
'rules': {
|
|
18
|
+
'no-console': ['warn'],
|
|
19
|
+
'no-undef': ['error'],
|
|
20
|
+
'no-unused-vars': ['warn'],
|
|
21
|
+
'one-var': 'off',
|
|
22
|
+
'arrow-parens': ['error', 'always'],
|
|
23
|
+
'semi': ['error', 'always'],
|
|
24
|
+
'indent': ['error', 2, {
|
|
25
|
+
'SwitchCase': 1
|
|
26
|
+
}],
|
|
27
|
+
'max-len': [
|
|
28
|
+
'warn',
|
|
29
|
+
{
|
|
30
|
+
'code': 200,
|
|
31
|
+
'ignoreTemplateLiterals': true,
|
|
32
|
+
'ignoreStrings': true
|
|
33
|
+
}
|
|
34
|
+
],
|
|
35
|
+
'generator-star-spacing': 'off',
|
|
36
|
+
'func-names': ['error', 'never'],
|
|
37
|
+
'quotes': ['error', 'single']
|
|
38
|
+
}
|
|
39
|
+
}
|
|
@@ -1,33 +1,33 @@
|
|
|
1
|
-
---
|
|
2
|
-
name: Bug report
|
|
3
|
-
about: Create a report to help us improve
|
|
4
|
-
title: ''
|
|
5
|
-
labels: ''
|
|
6
|
-
assignees: ''
|
|
7
|
-
|
|
8
|
-
---
|
|
9
|
-
|
|
10
|
-
**Describe the bug**
|
|
11
|
-
A clear and concise description of what the bug is.
|
|
12
|
-
|
|
13
|
-
**To Reproduce**
|
|
14
|
-
Steps to reproduce the behavior:
|
|
15
|
-
1. Go to '...'
|
|
16
|
-
2. Click on '...'
|
|
17
|
-
3. Scroll down to '....'
|
|
18
|
-
4. See error
|
|
19
|
-
|
|
20
|
-
**Expected behavior**
|
|
21
|
-
A clear and concise description of what you expected to happen.
|
|
22
|
-
|
|
23
|
-
**Screenshots & Logfiles**
|
|
24
|
-
If applicable, add screenshots and logfiles to help explain your problem.
|
|
25
|
-
|
|
26
|
-
**Versions:**
|
|
27
|
-
- Adapter version: <adapter-version>
|
|
28
|
-
- JS-Controller version: <js-controller-version> <!-- determine this with `iobroker -v` on the console -->
|
|
29
|
-
- Node version: <node-version> <!-- determine this with `node -v` on the console -->
|
|
30
|
-
- Operating system: <os-name>
|
|
31
|
-
|
|
32
|
-
**Additional context**
|
|
33
|
-
Add any other context about the problem here.
|
|
1
|
+
---
|
|
2
|
+
name: Bug report
|
|
3
|
+
about: Create a report to help us improve
|
|
4
|
+
title: ''
|
|
5
|
+
labels: ''
|
|
6
|
+
assignees: ''
|
|
7
|
+
|
|
8
|
+
---
|
|
9
|
+
|
|
10
|
+
**Describe the bug**
|
|
11
|
+
A clear and concise description of what the bug is.
|
|
12
|
+
|
|
13
|
+
**To Reproduce**
|
|
14
|
+
Steps to reproduce the behavior:
|
|
15
|
+
1. Go to '...'
|
|
16
|
+
2. Click on '...'
|
|
17
|
+
3. Scroll down to '....'
|
|
18
|
+
4. See error
|
|
19
|
+
|
|
20
|
+
**Expected behavior**
|
|
21
|
+
A clear and concise description of what you expected to happen.
|
|
22
|
+
|
|
23
|
+
**Screenshots & Logfiles**
|
|
24
|
+
If applicable, add screenshots and logfiles to help explain your problem.
|
|
25
|
+
|
|
26
|
+
**Versions:**
|
|
27
|
+
- Adapter version: <adapter-version>
|
|
28
|
+
- JS-Controller version: <js-controller-version> <!-- determine this with `iobroker -v` on the console -->
|
|
29
|
+
- Node version: <node-version> <!-- determine this with `node -v` on the console -->
|
|
30
|
+
- Operating system: <os-name>
|
|
31
|
+
|
|
32
|
+
**Additional context**
|
|
33
|
+
Add any other context about the problem here.
|
package/.github/dependabot.yml
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
version: 2
|
|
2
|
-
updates:
|
|
3
|
-
- package-ecosystem: "npm"
|
|
4
|
-
directory: "/"
|
|
5
|
-
schedule:
|
|
6
|
-
interval: "weekly"
|
|
7
|
-
target-branch: "master"
|
|
8
|
-
open-pull-requests-limit: 30
|
|
1
|
+
version: 2
|
|
2
|
+
updates:
|
|
3
|
+
- package-ecosystem: "npm"
|
|
4
|
+
directory: "/"
|
|
5
|
+
schedule:
|
|
6
|
+
interval: "weekly"
|
|
7
|
+
target-branch: "master"
|
|
8
|
+
open-pull-requests-limit: 30
|
|
@@ -1,15 +1,15 @@
|
|
|
1
|
-
// Specialized tsconfig for type-checking js files
|
|
2
|
-
{
|
|
3
|
-
"extends": "./tsconfig.json",
|
|
4
|
-
"compilerOptions": {},
|
|
5
|
-
"include": [
|
|
6
|
-
"**/*.js",
|
|
7
|
-
"**/*.d.ts"
|
|
8
|
-
],
|
|
9
|
-
"exclude": [
|
|
10
|
-
"**/build",
|
|
11
|
-
"node_modules/",
|
|
12
|
-
"widgets/",
|
|
13
|
-
"gulpfile.js"
|
|
14
|
-
]
|
|
15
|
-
}
|
|
1
|
+
// Specialized tsconfig for type-checking js files
|
|
2
|
+
{
|
|
3
|
+
"extends": "./tsconfig.json",
|
|
4
|
+
"compilerOptions": {},
|
|
5
|
+
"include": [
|
|
6
|
+
"**/*.js",
|
|
7
|
+
"**/*.d.ts"
|
|
8
|
+
],
|
|
9
|
+
"exclude": [
|
|
10
|
+
"**/build",
|
|
11
|
+
"node_modules/",
|
|
12
|
+
"widgets/",
|
|
13
|
+
"gulpfile.js"
|
|
14
|
+
]
|
|
15
|
+
}
|
package/.github/tsconfig.json
CHANGED
|
@@ -1,39 +1,39 @@
|
|
|
1
|
-
{
|
|
2
|
-
"compileOnSave": true,
|
|
3
|
-
"compilerOptions": {
|
|
4
|
-
|
|
5
|
-
"allowJs": true,
|
|
6
|
-
"checkJs": true,
|
|
7
|
-
|
|
8
|
-
// do not compile anything, this file is just to configure type checking
|
|
9
|
-
"noEmit": true,
|
|
10
|
-
|
|
11
|
-
"module": "commonjs",
|
|
12
|
-
"moduleResolution": "node",
|
|
13
|
-
"esModuleInterop": true,
|
|
14
|
-
// this is necessary for the automatic typing of the adapter config
|
|
15
|
-
"resolveJsonModule": true,
|
|
16
|
-
|
|
17
|
-
// Set this to false if you want to disable the very strict rules (not recommended)
|
|
18
|
-
"strict": true,
|
|
19
|
-
"noImplicitAny": false,
|
|
20
|
-
// Or enable some of those features for more fine-grained control
|
|
21
|
-
// "strictNullChecks": true,
|
|
22
|
-
// "strictPropertyInitialization": true,
|
|
23
|
-
// "strictBindCallApply": true,
|
|
24
|
-
// "noImplicitAny": false,
|
|
25
|
-
// "noUnusedLocals": true,
|
|
26
|
-
// "noUnusedParameters": true,
|
|
27
|
-
|
|
28
|
-
// Consider targetting es2019 or higher if you only support Node.js 12+
|
|
29
|
-
"target": "es2018",
|
|
30
|
-
|
|
31
|
-
},
|
|
32
|
-
"include": [
|
|
33
|
-
"**/*.js",
|
|
34
|
-
"**/*.d.ts"
|
|
35
|
-
],
|
|
36
|
-
"exclude": [
|
|
37
|
-
"node_modules/**"
|
|
38
|
-
]
|
|
1
|
+
{
|
|
2
|
+
"compileOnSave": true,
|
|
3
|
+
"compilerOptions": {
|
|
4
|
+
|
|
5
|
+
"allowJs": true,
|
|
6
|
+
"checkJs": true,
|
|
7
|
+
|
|
8
|
+
// do not compile anything, this file is just to configure type checking
|
|
9
|
+
"noEmit": true,
|
|
10
|
+
|
|
11
|
+
"module": "commonjs",
|
|
12
|
+
"moduleResolution": "node",
|
|
13
|
+
"esModuleInterop": true,
|
|
14
|
+
// this is necessary for the automatic typing of the adapter config
|
|
15
|
+
"resolveJsonModule": true,
|
|
16
|
+
|
|
17
|
+
// Set this to false if you want to disable the very strict rules (not recommended)
|
|
18
|
+
"strict": true,
|
|
19
|
+
"noImplicitAny": false,
|
|
20
|
+
// Or enable some of those features for more fine-grained control
|
|
21
|
+
// "strictNullChecks": true,
|
|
22
|
+
// "strictPropertyInitialization": true,
|
|
23
|
+
// "strictBindCallApply": true,
|
|
24
|
+
// "noImplicitAny": false,
|
|
25
|
+
// "noUnusedLocals": true,
|
|
26
|
+
// "noUnusedParameters": true,
|
|
27
|
+
|
|
28
|
+
// Consider targetting es2019 or higher if you only support Node.js 12+
|
|
29
|
+
"target": "es2018",
|
|
30
|
+
|
|
31
|
+
},
|
|
32
|
+
"include": [
|
|
33
|
+
"**/*.js",
|
|
34
|
+
"**/*.d.ts"
|
|
35
|
+
],
|
|
36
|
+
"exclude": [
|
|
37
|
+
"node_modules/**"
|
|
38
|
+
]
|
|
39
39
|
}
|
|
@@ -1,143 +1,143 @@
|
|
|
1
|
-
name: Test and Release
|
|
2
|
-
|
|
3
|
-
# Run this job on all pushes and pull requests
|
|
4
|
-
# as well as tags with a semantic version
|
|
5
|
-
on:
|
|
6
|
-
push:
|
|
7
|
-
branches:
|
|
8
|
-
- 'master'
|
|
9
|
-
tags:
|
|
10
|
-
# normal versions
|
|
11
|
-
- "v[0-9]+.[0-9]+.[0-9]+"
|
|
12
|
-
# pre-releases
|
|
13
|
-
- "v[0-9]+.[0-9]+.[0-9]+-**"
|
|
14
|
-
pull_request: { }
|
|
15
|
-
|
|
16
|
-
jobs:
|
|
17
|
-
# Performs quick checks before the expensive test runs
|
|
18
|
-
check-and-lint:
|
|
19
|
-
if: contains(github.event.head_commit.message, '[skip ci]') == false
|
|
20
|
-
|
|
21
|
-
runs-on: ubuntu-latest
|
|
22
|
-
|
|
23
|
-
strategy:
|
|
24
|
-
matrix:
|
|
25
|
-
node-version: [14.x]
|
|
26
|
-
|
|
27
|
-
steps:
|
|
28
|
-
- name: Checkout code
|
|
29
|
-
uses: actions/checkout@v2
|
|
30
|
-
|
|
31
|
-
- name: Use Node.js ${{ matrix.node-version }}
|
|
32
|
-
uses: actions/setup-node@v1
|
|
33
|
-
with:
|
|
34
|
-
node-version: ${{ matrix.node-version }}
|
|
35
|
-
|
|
36
|
-
- name: Install Dependencies
|
|
37
|
-
run: npm ci
|
|
38
|
-
|
|
39
|
-
- name: Lint source code
|
|
40
|
-
run: npm run lint
|
|
41
|
-
- name: Test package files
|
|
42
|
-
run: npm run test:package
|
|
43
|
-
|
|
44
|
-
# Runs adapter tests on all supported node versions and OSes
|
|
45
|
-
adapter-tests:
|
|
46
|
-
if: contains(github.event.head_commit.message, '[skip ci]') == false
|
|
47
|
-
|
|
48
|
-
needs: [check-and-lint]
|
|
49
|
-
|
|
50
|
-
runs-on: ${{ matrix.os }}
|
|
51
|
-
strategy:
|
|
52
|
-
matrix:
|
|
53
|
-
node-version: [12.x, 14.x]
|
|
54
|
-
os: [ubuntu-latest, windows-latest, macos-latest]
|
|
55
|
-
|
|
56
|
-
steps:
|
|
57
|
-
- name: Checkout code
|
|
58
|
-
uses: actions/checkout@v2
|
|
59
|
-
|
|
60
|
-
- name: Use Node.js ${{ matrix.node-version }}
|
|
61
|
-
uses: actions/setup-node@v1
|
|
62
|
-
with:
|
|
63
|
-
node-version: ${{ matrix.node-version }}
|
|
64
|
-
|
|
65
|
-
- name: Install Dependencies
|
|
66
|
-
run: npm ci
|
|
67
|
-
|
|
68
|
-
- name: Run unit tests
|
|
69
|
-
run: npm run test:unit
|
|
70
|
-
- name: Run integration tests # (linux/osx)
|
|
71
|
-
if: startsWith(runner.OS, 'windows') == false
|
|
72
|
-
run: DEBUG=testing:* npm run test:integration
|
|
73
|
-
- name: Run integration tests # (windows)
|
|
74
|
-
if: startsWith(runner.OS, 'windows')
|
|
75
|
-
run: set DEBUG=testing:* & npm run test:integration
|
|
76
|
-
|
|
77
|
-
# Deploys the final package to NPM
|
|
78
|
-
deploy:
|
|
79
|
-
needs: [adapter-tests]
|
|
80
|
-
|
|
81
|
-
# Trigger this step only when a commit on any branch is tagged with a version number
|
|
82
|
-
if: |
|
|
83
|
-
contains(github.event.head_commit.message, '[skip ci]') == false &&
|
|
84
|
-
github.event_name == 'push' &&
|
|
85
|
-
startsWith(github.ref, 'refs/tags/v')
|
|
86
|
-
|
|
87
|
-
runs-on: ubuntu-latest
|
|
88
|
-
strategy:
|
|
89
|
-
matrix:
|
|
90
|
-
node-version: [14.x]
|
|
91
|
-
|
|
92
|
-
steps:
|
|
93
|
-
- name: Checkout code
|
|
94
|
-
uses: actions/checkout@v2
|
|
95
|
-
|
|
96
|
-
- name: Use Node.js ${{ matrix.node-version }}
|
|
97
|
-
uses: actions/setup-node@v1
|
|
98
|
-
with:
|
|
99
|
-
node-version: ${{ matrix.node-version }}
|
|
100
|
-
|
|
101
|
-
- name: Extract the version and commit body from the tag
|
|
102
|
-
id: extract_release
|
|
103
|
-
# The body may be multiline, therefore newlines and % need to be escaped
|
|
104
|
-
run: |
|
|
105
|
-
VERSION="${{ github.ref }}"
|
|
106
|
-
VERSION=${VERSION##*/v}
|
|
107
|
-
echo "::set-output name=VERSION::$VERSION"
|
|
108
|
-
BODY=$(git show -s --format=%b)
|
|
109
|
-
BODY="${BODY//'%'/'%25'}"
|
|
110
|
-
BODY="${BODY//$'\n'/'%0A'}"
|
|
111
|
-
BODY="${BODY//$'\r'/'%0D'}"
|
|
112
|
-
echo "::set-output name=BODY::$BODY"
|
|
113
|
-
|
|
114
|
-
- name: Publish package to npm
|
|
115
|
-
run: |
|
|
116
|
-
npm config set //registry.npmjs.org/:_authToken=${{ secrets.NPM_TOKEN }}
|
|
117
|
-
npm whoami
|
|
118
|
-
npm publish
|
|
119
|
-
|
|
120
|
-
- name: Create Github Release
|
|
121
|
-
uses: actions/create-release@v1
|
|
122
|
-
env:
|
|
123
|
-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
124
|
-
with:
|
|
125
|
-
tag_name: ${{ github.ref }}
|
|
126
|
-
release_name: Release v${{ steps.extract_release.outputs.VERSION }}
|
|
127
|
-
draft: false
|
|
128
|
-
# Prerelease versions create prereleases on Github
|
|
129
|
-
prerelease: ${{ contains(steps.extract_release.outputs.VERSION, '-') }}
|
|
130
|
-
body:
|
|
131
|
-
|
|
132
|
-
# - name: Notify Sentry.io about the release
|
|
133
|
-
# run: |
|
|
134
|
-
# npm i -g @sentry/cli
|
|
135
|
-
# export SENTRY_AUTH_TOKEN=${{ secrets.SENTRY_AUTH_TOKEN }}
|
|
136
|
-
# export SENTRY_URL=https://sentry.iobroker.net
|
|
137
|
-
# export SENTRY_ORG=iobroker
|
|
138
|
-
# export SENTRY_PROJECT=iobroker-ring
|
|
139
|
-
# export SENTRY_VERSION=iobroker.ring@${{ steps.extract_release.outputs.VERSION }}
|
|
140
|
-
# sentry-cli releases new $SENTRY_VERSION
|
|
141
|
-
# sentry-cli releases finalize $SENTRY_VERSION
|
|
142
|
-
# # Add the following line BEFORE finalize if repositories are connected in Sentry
|
|
143
|
-
# # sentry-cli releases set-commits $SENTRY_VERSION --auto
|
|
1
|
+
name: Test and Release
|
|
2
|
+
|
|
3
|
+
# Run this job on all pushes and pull requests
|
|
4
|
+
# as well as tags with a semantic version
|
|
5
|
+
on:
|
|
6
|
+
push:
|
|
7
|
+
branches:
|
|
8
|
+
- 'master'
|
|
9
|
+
tags:
|
|
10
|
+
# normal versions
|
|
11
|
+
- "v[0-9]+.[0-9]+.[0-9]+"
|
|
12
|
+
# pre-releases
|
|
13
|
+
- "v[0-9]+.[0-9]+.[0-9]+-**"
|
|
14
|
+
pull_request: { }
|
|
15
|
+
|
|
16
|
+
jobs:
|
|
17
|
+
# Performs quick checks before the expensive test runs
|
|
18
|
+
check-and-lint:
|
|
19
|
+
if: contains(github.event.head_commit.message, '[skip ci]') == false
|
|
20
|
+
|
|
21
|
+
runs-on: ubuntu-latest
|
|
22
|
+
|
|
23
|
+
strategy:
|
|
24
|
+
matrix:
|
|
25
|
+
node-version: [14.x]
|
|
26
|
+
|
|
27
|
+
steps:
|
|
28
|
+
- name: Checkout code
|
|
29
|
+
uses: actions/checkout@v2
|
|
30
|
+
|
|
31
|
+
- name: Use Node.js ${{ matrix.node-version }}
|
|
32
|
+
uses: actions/setup-node@v1
|
|
33
|
+
with:
|
|
34
|
+
node-version: ${{ matrix.node-version }}
|
|
35
|
+
|
|
36
|
+
- name: Install Dependencies
|
|
37
|
+
run: npm ci
|
|
38
|
+
|
|
39
|
+
- name: Lint source code
|
|
40
|
+
run: npm run lint
|
|
41
|
+
- name: Test package files
|
|
42
|
+
run: npm run test:package
|
|
43
|
+
|
|
44
|
+
# Runs adapter tests on all supported node versions and OSes
|
|
45
|
+
adapter-tests:
|
|
46
|
+
if: contains(github.event.head_commit.message, '[skip ci]') == false
|
|
47
|
+
|
|
48
|
+
needs: [check-and-lint]
|
|
49
|
+
|
|
50
|
+
runs-on: ${{ matrix.os }}
|
|
51
|
+
strategy:
|
|
52
|
+
matrix:
|
|
53
|
+
node-version: [12.x, 14.x, 16.x]
|
|
54
|
+
os: [ubuntu-latest, windows-latest, macos-latest]
|
|
55
|
+
|
|
56
|
+
steps:
|
|
57
|
+
- name: Checkout code
|
|
58
|
+
uses: actions/checkout@v2
|
|
59
|
+
|
|
60
|
+
- name: Use Node.js ${{ matrix.node-version }}
|
|
61
|
+
uses: actions/setup-node@v1
|
|
62
|
+
with:
|
|
63
|
+
node-version: ${{ matrix.node-version }}
|
|
64
|
+
|
|
65
|
+
- name: Install Dependencies
|
|
66
|
+
run: npm ci
|
|
67
|
+
|
|
68
|
+
- name: Run unit tests
|
|
69
|
+
run: npm run test:unit
|
|
70
|
+
- name: Run integration tests # (linux/osx)
|
|
71
|
+
if: startsWith(runner.OS, 'windows') == false
|
|
72
|
+
run: DEBUG=testing:* npm run test:integration
|
|
73
|
+
- name: Run integration tests # (windows)
|
|
74
|
+
if: startsWith(runner.OS, 'windows')
|
|
75
|
+
run: set DEBUG=testing:* & npm run test:integration
|
|
76
|
+
|
|
77
|
+
# Deploys the final package to NPM
|
|
78
|
+
deploy:
|
|
79
|
+
needs: [adapter-tests]
|
|
80
|
+
|
|
81
|
+
# Trigger this step only when a commit on any branch is tagged with a version number
|
|
82
|
+
if: |
|
|
83
|
+
contains(github.event.head_commit.message, '[skip ci]') == false &&
|
|
84
|
+
github.event_name == 'push' &&
|
|
85
|
+
startsWith(github.ref, 'refs/tags/v')
|
|
86
|
+
|
|
87
|
+
runs-on: ubuntu-latest
|
|
88
|
+
strategy:
|
|
89
|
+
matrix:
|
|
90
|
+
node-version: [14.x]
|
|
91
|
+
|
|
92
|
+
steps:
|
|
93
|
+
- name: Checkout code
|
|
94
|
+
uses: actions/checkout@v2
|
|
95
|
+
|
|
96
|
+
- name: Use Node.js ${{ matrix.node-version }}
|
|
97
|
+
uses: actions/setup-node@v1
|
|
98
|
+
with:
|
|
99
|
+
node-version: ${{ matrix.node-version }}
|
|
100
|
+
|
|
101
|
+
- name: Extract the version and commit body from the tag
|
|
102
|
+
id: extract_release
|
|
103
|
+
# The body may be multiline, therefore newlines and % need to be escaped
|
|
104
|
+
run: |
|
|
105
|
+
VERSION="${{ github.ref }}"
|
|
106
|
+
VERSION=${VERSION##*/v}
|
|
107
|
+
echo "::set-output name=VERSION::$VERSION"
|
|
108
|
+
BODY=$(git show -s --format=%b)
|
|
109
|
+
BODY="${BODY//'%'/'%25'}"
|
|
110
|
+
BODY="${BODY//$'\n'/'%0A'}"
|
|
111
|
+
BODY="${BODY//$'\r'/'%0D'}"
|
|
112
|
+
echo "::set-output name=BODY::$BODY"
|
|
113
|
+
|
|
114
|
+
- name: Publish package to npm
|
|
115
|
+
run: |
|
|
116
|
+
npm config set //registry.npmjs.org/:_authToken=${{ secrets.NPM_TOKEN }}
|
|
117
|
+
npm whoami
|
|
118
|
+
npm publish
|
|
119
|
+
|
|
120
|
+
- name: Create Github Release
|
|
121
|
+
uses: actions/create-release@v1
|
|
122
|
+
env:
|
|
123
|
+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
124
|
+
with:
|
|
125
|
+
tag_name: ${{ github.ref }}
|
|
126
|
+
release_name: Release v${{ steps.extract_release.outputs.VERSION }}
|
|
127
|
+
draft: false
|
|
128
|
+
# Prerelease versions create prereleases on Github
|
|
129
|
+
prerelease: ${{ contains(steps.extract_release.outputs.VERSION, '-') }}
|
|
130
|
+
body:
|
|
131
|
+
|
|
132
|
+
# - name: Notify Sentry.io about the release
|
|
133
|
+
# run: |
|
|
134
|
+
# npm i -g @sentry/cli
|
|
135
|
+
# export SENTRY_AUTH_TOKEN=${{ secrets.SENTRY_AUTH_TOKEN }}
|
|
136
|
+
# export SENTRY_URL=https://sentry.iobroker.net
|
|
137
|
+
# export SENTRY_ORG=iobroker
|
|
138
|
+
# export SENTRY_PROJECT=iobroker-ring
|
|
139
|
+
# export SENTRY_VERSION=iobroker.ring@${{ steps.extract_release.outputs.VERSION }}
|
|
140
|
+
# sentry-cli releases new $SENTRY_VERSION
|
|
141
|
+
# sentry-cli releases finalize $SENTRY_VERSION
|
|
142
|
+
# # Add the following line BEFORE finalize if repositories are connected in Sentry
|
|
143
|
+
# # sentry-cli releases set-commits $SENTRY_VERSION --auto
|