diff --git a/.github/workflows/test-and-release.yml b/.github/workflows/test-and-release.yml index 0f64a36d..865c51a3 100644 --- a/.github/workflows/test-and-release.yml +++ b/.github/workflows/test-and-release.yml @@ -1,6 +1,3 @@ -# 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 @@ -10,7 +7,10 @@ on: branches: - '*' tags: - - 'v[0-9]+.[0-9]+.[0-9]+' + # normal versions + - "v[0-9]+.[0-9]+.[0-9]+" + # pre-releases + - "v[0-9]+.[0-9]+.[0-9]+-**" pull_request: {} jobs: @@ -22,10 +22,12 @@ jobs: strategy: matrix: - node-version: [12.x] + node-version: [14.x] steps: - - uses: actions/checkout@v1 + - name: Checkout code + uses: actions/checkout@v2 + - name: Use Node.js ${{ matrix.node-version }} uses: actions/setup-node@v1 with: @@ -53,11 +55,13 @@ jobs: runs-on: ${{ matrix.os }} strategy: matrix: - node-version: [10.x, 12.x] + node-version: [10.x, 12.x, 14.x] os: [ubuntu-latest, windows-latest, macos-latest] steps: - - uses: actions/checkout@v1 + - name: Checkout code + uses: actions/checkout@v2 + - name: Use Node.js ${{ matrix.node-version }} uses: actions/setup-node@v1 with: @@ -91,30 +95,49 @@ jobs: runs-on: ubuntu-latest strategy: matrix: - node-version: [12.x] + node-version: [14.x] steps: - - uses: actions/checkout@v1 + - name: Checkout code + uses: actions/checkout@v2 + - name: Use Node.js ${{ matrix.node-version }} uses: actions/setup-node@v1 with: node-version: ${{ matrix.node-version }} + - name: Extract the version and commit body from the tag + # The body may be multiline, therefore we need to escape some characters + run: | + VERSION="${{ github.ref }}" + VERSION=${VERSION##*/v} + echo "::set-env name=VERSION::$VERSION" + BODY=$(git show -s --format=%b) + BODY="${BODY//'%'/'%25'}" + BODY="${BODY//$'\n'/'%0A'}" + BODY="${BODY//$'\r'/'%0D'}" + echo "::set-env name=BODY::$BODY" + - name: Install Dependencies run: npm ci - name: Create a clean build run: npm run build + - 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!" + - name: Create Github Release + uses: actions/create-release@v1 + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + with: + tag_name: ${{ github.ref }} + release_name: Release v${{ env.VERSION }} + draft: false + # Prerelease versions create prereleases on Github + prerelease: ${{ contains(env.VERSION, '-') }} + body: ${{ env.BODY }} diff --git a/README.md b/README.md index 8f3bed87..f392892e 100644 --- a/README.md +++ b/README.md @@ -71,6 +71,9 @@ The result object `ret` looks as follows: ### __WORK IN PROGRESS__ --> +### __WORK IN PROGRESS__ +* Bugfix: Changed the role of RGB states to `level.color.rgb` + ### 2.6.2 (2020-04-29) * Bugfix: The unhandled error handler should now correctly log the error even if `adapter` is not defined diff --git a/package-lock.json b/package-lock.json index 00192b86..ce86d7d1 100644 --- a/package-lock.json +++ b/package-lock.json @@ -5,9 +5,9 @@ "requires": true, "dependencies": { "@alcalzone/release-script": { - "version": "1.3.1", - "resolved": "https://registry.npmjs.org/@alcalzone/release-script/-/release-script-1.3.1.tgz", - "integrity": "sha512-w3JSoSM3+xsKpJx8Z3GCDosk6RAHpldyZGgD3mhLy/0GM28Pk+hcsXjdQmEEBPuJpl+0ID7FF7NDn4jdqq0DwA==", + "version": "1.4.1", + "resolved": "https://registry.npmjs.org/@alcalzone/release-script/-/release-script-1.4.1.tgz", + "integrity": "sha512-JH+/FeXx/uX5I2dQndg3uMJrjI3R+5HWHWmxFCZPWd5T6pjNq2KSAeB8sMgzw2qtCUY0U+R0XdEHL8AFerktuw==", "dev": true, "requires": { "alcalzone-shared": "^2.0.0", diff --git a/package.json b/package.json index b8147492..79d60542 100644 --- a/package.json +++ b/package.json @@ -1,135 +1,135 @@ -{ - "name": "iobroker.tradfri", - "version": "2.6.2", - "description": "ioBroker tradfri Adapter", - "author": { - "name": "AlCalzone", - "email": "d.griesel@gmx.net" - }, - "bugs": { - "url": "https://github.com/AlCalzone/ioBroker.tradfri/issues" - }, - "contributors": [ - { - "name": "AlCalzone", - "email": "d.griesel@gmx.net" - } - ], - "files": [ - "build/", - "admin/build/", - "admin/icons/", - "admin/*.{html,css,js,png}", - "LICENSE", - "io-package.json" - ], - "dependencies": { - "@iobroker/adapter-core": "^2.1.0", - "alcalzone-shared": "^2.0.0", - "node-tradfri-client": "^2.1.6" - }, - "devDependencies": { - "@alcalzone/release-script": "^1.3.1", - "@babel/core": "^7.2.2", - "@iobroker/testing": "^2.0.0", - "@types/chai": "^4.1.3", - "@types/chai-as-promised": "^7.1.0", - "@types/enzyme": "^3.1.15", - "@types/enzyme-adapter-react-16": "^1.0.3", - "@types/jquery": "^3.3.22", - "@types/materialize-css": "^1.0.3", - "@types/mocha": "^7.0.1", - "@types/node": "^13.1.1", - "@types/react": "^16.9.35", - "@types/react-dom": "^16.0.5", - "@types/sinon": "^7.0.11", - "axios": "^0.19.0", - "chai": "^4.1.2", - "chai-as-promised": "^7.1.1", - "cpx": "^1.5.0", - "enzyme": "^3.3.0", - "enzyme-adapter-react-16": "^1.15.2", - "gulp": "^4.0.0", - "iobroker-react-components": "^1.0.0", - "jquery": "^3.5.0", - "jsdom": "^16.2.2", - "mocha": "^7.0.0", - "node-ssh": "^8.0.0", - "nyc": "^15.0.1", - "parcel-bundler": "^1.12.3", - "react": "^16.3.2", - "react-dom": "^16.3.2", - "react-test-renderer": "^16.3.2", - "rexreplace": "^5.1.5", - "rimraf": "^3.0.0", - "semver": "^7.3.2", - "sinon": "^9.0.2", - "source-map-support": "^0.5.19", - "ts-loader": "^6.0.0", - "ts-node": "^8.0.3", - "tslint": "^5.11.0", - "tslint-react": "^4.0.0", - "typescript": "^3.1.6" - }, - "homepage": "https://github.com/AlCalzone/ioBroker.tradfri", - "keywords": [ - "ioBroker", - "tradfri", - "Smart Home", - "home automation" - ], - "license": "MIT", - "main": "build/main.js", - "readmeFilename": "README.md", - "repository": { - "type": "git", - "url": "https://github.com/AlCalzone/ioBroker.tradfri" - }, - "scripts": { - "restoreBuildDirectoryStructure": "cpx \"build/src/**/*.*\" build && rimraf build/src && rimraf build/{io-,}package.{json,d.ts}", - "fixSourceMaps": "rexreplace \"\\\"sources\\\"\\:\\[\\\"../../\" \"\\\"sources\\\"\\:\\[\\\"../\" \"{build/**,build}/*.map\"", - "prebuild:ts": "rimraf ./build", - "build:ts": "tsc -p src/tsconfig.json", - "check:ts": "tsc -p src/tsconfig.json --noEmit", - "postbuild:ts": "npm run restoreBuildDirectoryStructure && npm run fixSourceMaps", - "build:parcel": "parcel build admin/src/index.tsx -d admin/build", - "build": "npm run build:ts && npm run build:parcel", - "watch:parcel": "parcel admin/src/index.tsx -d admin/build", - "watch": "tsc -p src/tsconfig.json --watch", - "test:unit": "mocha test/unit --exit", - "test:package": "mocha test/package --exit", - "test:integration": "mocha test/integration --exit", - "test:ts": "node node_modules/mocha/bin/mocha --require ts-node/register --require source-map-support/register src/**/*.test.ts", - "test:tsx": "node node_modules/mocha/bin/mocha --require test/setupJSDom.js --require ts-node/register --require source-map-support/register **/src/**/*.test.tsx", - "test": "npm run test:ts && npm run test:tsx", - "prepublishOnly": "npm run test:package", - "coverage": "node node_modules/nyc/bin/nyc npm run test", - "lint:ts": "tslint", - "lint": "npm run lint:ts \"src/**/*.ts\"", - "deploy_local": "node --require ts-node/register maintenance/deploy_local.ts", - "release": "release-script" - }, - "nyc": { - "include": [ - "src/**/*.ts", - "admin/src/**/*.ts*" - ], - "exclude": [ - "src/**/*.test.ts*", - "admin/src/**/*.test.ts*" - ], - "extension": [ - ".ts", - ".tsx" - ], - "require": [ - "ts-node/register" - ], - "reporter": [ - "text-summary", - "html" - ], - "sourceMap": true, - "instrument": true - } -} +{ + "name": "iobroker.tradfri", + "version": "2.6.2", + "description": "ioBroker tradfri Adapter", + "author": { + "name": "AlCalzone", + "email": "d.griesel@gmx.net" + }, + "bugs": { + "url": "https://github.com/AlCalzone/ioBroker.tradfri/issues" + }, + "contributors": [ + { + "name": "AlCalzone", + "email": "d.griesel@gmx.net" + } + ], + "files": [ + "build/", + "admin/build/", + "admin/icons/", + "admin/*.{html,css,js,png}", + "LICENSE", + "io-package.json" + ], + "dependencies": { + "@iobroker/adapter-core": "^2.1.0", + "alcalzone-shared": "^2.0.0", + "node-tradfri-client": "^2.1.6" + }, + "devDependencies": { + "@alcalzone/release-script": "^1.4.1", + "@babel/core": "^7.2.2", + "@iobroker/testing": "^2.0.0", + "@types/chai": "^4.1.3", + "@types/chai-as-promised": "^7.1.0", + "@types/enzyme": "^3.1.15", + "@types/enzyme-adapter-react-16": "^1.0.3", + "@types/jquery": "^3.3.22", + "@types/materialize-css": "^1.0.3", + "@types/mocha": "^7.0.1", + "@types/node": "^13.1.1", + "@types/react": "^16.9.35", + "@types/react-dom": "^16.0.5", + "@types/sinon": "^7.0.11", + "axios": "^0.19.0", + "chai": "^4.1.2", + "chai-as-promised": "^7.1.1", + "cpx": "^1.5.0", + "enzyme": "^3.3.0", + "enzyme-adapter-react-16": "^1.15.2", + "gulp": "^4.0.0", + "iobroker-react-components": "^1.0.0", + "jquery": "^3.5.0", + "jsdom": "^16.2.2", + "mocha": "^7.0.0", + "node-ssh": "^8.0.0", + "nyc": "^15.0.1", + "parcel-bundler": "^1.12.3", + "react": "^16.3.2", + "react-dom": "^16.3.2", + "react-test-renderer": "^16.3.2", + "rexreplace": "^5.1.5", + "rimraf": "^3.0.0", + "semver": "^7.3.2", + "sinon": "^9.0.2", + "source-map-support": "^0.5.19", + "ts-loader": "^6.0.0", + "ts-node": "^8.0.3", + "tslint": "^5.11.0", + "tslint-react": "^4.0.0", + "typescript": "^3.1.6" + }, + "homepage": "https://github.com/AlCalzone/ioBroker.tradfri", + "keywords": [ + "ioBroker", + "tradfri", + "Smart Home", + "home automation" + ], + "license": "MIT", + "main": "build/main.js", + "readmeFilename": "README.md", + "repository": { + "type": "git", + "url": "https://github.com/AlCalzone/ioBroker.tradfri" + }, + "scripts": { + "restoreBuildDirectoryStructure": "cpx \"build/src/**/*.*\" build && rimraf build/src && rimraf build/{io-,}package.{json,d.ts}", + "fixSourceMaps": "rexreplace \"\\\"sources\\\"\\:\\[\\\"../../\" \"\\\"sources\\\"\\:\\[\\\"../\" \"{build/**,build}/*.map\"", + "prebuild:ts": "rimraf ./build", + "build:ts": "tsc -p src/tsconfig.json", + "check:ts": "tsc -p src/tsconfig.json --noEmit", + "postbuild:ts": "npm run restoreBuildDirectoryStructure && npm run fixSourceMaps", + "build:parcel": "parcel build admin/src/index.tsx -d admin/build", + "build": "npm run build:ts && npm run build:parcel", + "watch:parcel": "parcel admin/src/index.tsx -d admin/build", + "watch": "tsc -p src/tsconfig.json --watch", + "test:unit": "mocha test/unit --exit", + "test:package": "mocha test/package --exit", + "test:integration": "mocha test/integration --exit", + "test:ts": "node node_modules/mocha/bin/mocha --require ts-node/register --require source-map-support/register src/**/*.test.ts", + "test:tsx": "node node_modules/mocha/bin/mocha --require test/setupJSDom.js --require ts-node/register --require source-map-support/register **/src/**/*.test.tsx", + "test": "npm run test:ts && npm run test:tsx", + "prepublishOnly": "npm run test:package", + "coverage": "node node_modules/nyc/bin/nyc npm run test", + "lint:ts": "tslint", + "lint": "npm run lint:ts \"src/**/*.ts\"", + "deploy_local": "node --require ts-node/register maintenance/deploy_local.ts", + "release": "release-script" + }, + "nyc": { + "include": [ + "src/**/*.ts", + "admin/src/**/*.ts*" + ], + "exclude": [ + "src/**/*.test.ts*", + "admin/src/**/*.test.ts*" + ], + "extension": [ + ".ts", + ".tsx" + ], + "require": [ + "ts-node/register" + ], + "reporter": [ + "text-summary", + "html" + ], + "sourceMap": true, + "instrument": true + } +}