Skip to content

Commit

Permalink
use nodejs 14, update deps, rework prebuild, bump version (#374)
Browse files Browse the repository at this point in the history
  • Loading branch information
hobbyquaker committed Jul 31, 2020
1 parent 08fa0b8 commit 1fe2577
Show file tree
Hide file tree
Showing 4,884 changed files with 330,998 additions and 30,096 deletions.
The diff you're trying to view is too large. We only load the first 3000 changed files.
3 changes: 2 additions & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
language: node_js
node_js:
- '10'
- '14'
addons:
apt:
packages:
- jq
- libavahi-compat-libdnssd-dev
branches:
only:
- master
Expand Down
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -137,6 +137,8 @@ Es werden keine Spenden angenommen, ich würde mich jedoch darüber freuen wenn
* [Steuerung von Miele Geräten](https://github.com/rdmtc/RedMatic/wiki/Steuerung-Miele)
* [Subflow für Enigma2 Receiver](https://github.com/Matten-Matten/node-red-enigma2-flow)
* [INSTAR Kameras anbinden](https://wiki.instar.de/Erweitert/Homematic_CCU3_und_RedMatic/)
* [Subflow für Home24-Mediaplayer App](https://github.com/Matten-Matten/node-red-home24-mediaplayer-flow)
* [EASY Push Subflow Push Nachrichten an EASY-Smarthome App oder Smartha App](https://github.com/Matten-Matten/Redmatic-EASY-Push-Flow)
* Sonstiges
* [Berichterstattung, Blogbeiträge, Videos über RedMatic](https://github.com/rdmtc/RedMatic/wiki/Berichterstattung)
* [Node-RED Link Sammlung](https://github.com/rdmtc/RedMatic/wiki/Links)
Expand Down
3 changes: 1 addition & 2 deletions addon_files/redmatic/lib/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,14 +12,13 @@
"node-red-contrib-mysensors": "3.3.1",
"node-red-contrib-rfxcom": "2.11.1",
"node-red-contrib-zigbee": "0.19.0",
"node-red-contrib-johnny-five": "1.0.0-beta.1",
"node-red-contrib-johnny-five": "1.0.0-beta.2",
"node-red-contrib-enocean": "0.8.5",
"redmatic-homekit": "3.2.2",
"@node-red-contrib-themes/midnight-red": "1.4.4",
"node-red-contrib-doorbird": "0.2.6",
"node-red-contrib-comfoair": "0.0.5",
"node-red-node-discovery": "0.0.22",
"node-red-contrib-rcswitch2": "0.5.0",
"node-red-contrib-chatbot": "0.19.6"
}
}
1 change: 1 addition & 0 deletions build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ mkdir $BUILD_DIR/dist 2> /dev/null
echo "installing build dependencies..."
npm install --only=dev --global-style --no-package-lock

./build_addon.sh armv7l
./build_addon.sh armv6l
./build_addon.sh i686

Expand Down
37 changes: 29 additions & 8 deletions build_addon.sh
Original file line number Diff line number Diff line change
@@ -1,19 +1,40 @@
#!/bin/bash

ARCH=${1:-armv6l}
ARCH=${1:-armv7l}

BUILD_DIR=`cd ${0%/*} && pwd -P`

VERSION_ADDON=`jq -r '.version' package.json`
NODE_VERSION=`jq -r '.engines.node' package.json`

if [ "$ARCH" == "i686" ]; then
echo ""
echo "Build RedMatic v$VERSION_ADDON ($ARCH)"
echo ""

case $ARCH in
x86_64)
NODE_NAME=node-v${NODE_VERSION}-linux-x64
;;
i686)
NODE_NAME=node-v${NODE_VERSION}-linux-x86
NODE_URL=https://unofficial-builds.nodejs.org/download/release/v${NODE_VERSION}/${NODE_NAME}.tar.xz
else
;;
*)
NODE_NAME=node-v${NODE_VERSION}-linux-${ARCH}
;;
esac

case $ARCH in
armv6l)
NODE_URL=https://unofficial-builds.nodejs.org/download/release/v${NODE_VERSION}/${NODE_NAME}.tar.xz
;;
i686)
# Todo - Node 14 i686 (32bit) build https://github.com/rdmtc/RedMatic/issues/374
NODE_URL=https://unofficial-builds.nodejs.org/download/release/v${NODE_VERSION}/${NODE_NAME}.tar.xz
;;
*)
NODE_URL=https://nodejs.org/dist/v${NODE_VERSION}/${NODE_NAME}.tar.xz
fi
;;
esac

PREBUILT=$BUILD_DIR/prebuilt/$ARCH

Expand All @@ -24,7 +45,7 @@ VERSION_FILE=$ADDON_TMP/redmatic/versions
mkdir $ADDON_TMP 2> /dev/null || rm -r $ADDON_TMP/*

echo "download and extract Node.js $NODE_URL ..."
curl --silent $NODE_URL | tar -xJf - -C $ADDON_TMP
curl --silent $NODE_URL | tar -xJf - -C $ADDON_TMP || exit 1
mv $ADDON_TMP/$NODE_NAME $ADDON_TMP/redmatic
rm $ADDON_TMP/redmatic/README.md
rm $ADDON_TMP/redmatic/CHANGELOG.md
Expand All @@ -40,7 +61,7 @@ cp $BUILD_DIR/assets/favicon/favicon-96x96.png $ADDON_TMP/redmatic/www/

echo "installing node modules..."
if [ "$ARCH" == "i686" ]; then
echo "removing raspberrypi specific modules..."
echo "removing Raspberry Pi specific modules..."
mv $ADDON_TMP/redmatic/lib/package.json $ADDON_TMP/redmatic/lib/package.json.tmp
cat $ADDON_TMP/redmatic/lib/package.json.tmp | jq 'del(.dependencies."node-red-contrib-johnny-five",.dependencies."node-red-contrib-rcswitch2")' > $ADDON_TMP/redmatic/lib/package.json
rm $ADDON_TMP/redmatic/lib/package.json.tmp
Expand Down Expand Up @@ -85,7 +106,7 @@ sed "s/var args = \['remove'/var args = ['remove','--no-package-lock'/" $INSTALL

cd $BUILD_DIR

if [ "$ARCH" == "armv6l" ]; then
if [ "$ARCH" == "armv7l" ]; then
ADDON_FILE=redmatic-$VERSION_ADDON.tar.gz
else
ADDON_FILE=redmatic-$ARCH-$VERSION_ADDON.tar.gz
Expand Down
8 changes: 3 additions & 5 deletions build_packages.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,10 @@ const crypto = require('crypto');
const pkgLib = require(__dirname + '/addon_files/redmatic/lib/package.json');
const redmaticVersion = require(__dirname + '/package.json').version;

let tarch = process.argv[2] || 'armv6l';
let tarch = process.argv[2] || 'armv7l';
let arch = '';

if (tarch !== 'armv6l') {
if (tarch !== 'armv7l') {
arch = '-' + tarch;
}

Expand All @@ -26,9 +26,7 @@ const extraFiles = {
'bin/pig2vcd',
'bin/pigpiod',
'bin/pigs',
'lib/libpigpiod_if2.so',
'lib/libpigpiod_if.so',
'lib/libpigpio.so'
'lib/libpigpio*',
]
};

Expand Down
17 changes: 16 additions & 1 deletion build_release_body.sh
Original file line number Diff line number Diff line change
Expand Up @@ -14,15 +14,30 @@ echo "creating RELEASE_BODY.md"

DOWNLOAD="https://github.com/rdmtc/RedMatic/releases/download/v$VERSION_ADDON/redmatic-$VERSION_ADDON.tar.gz"
DOWNLOAD_I686="https://github.com/rdmtc/RedMatic/releases/download/v$VERSION_ADDON/redmatic-i686-$VERSION_ADDON.tar.gz"
DOWNLOAD_ARMV6L="https://github.com/rdmtc/RedMatic/releases/download/v$VERSION_ADDON/redmatic-armv6l-$VERSION_ADDON.tar.gz"

cat >RELEASE_BODY.md <<EOL
### Downloads
#### CCU3, piVCCU3 und RaspberryMatic Varianten _rpi0_, _rpi3_, _rpi4_ und _tinkerboard_
#### CCU3, piVCCU3 und RaspberryMatic Varianten _rpi3_, _rpi4_ und _tinkerboard_
[![Downloads redmatic-$VERSION_ADDON](https://img.shields.io/github/downloads/rdmtc/RedMatic/v$VERSION_ADDON/redmatic-$VERSION_ADDON.tar.gz.svg)]($DOWNLOAD)
EOL

if [ -f $BUILD_DIR/redmatic-armv6l-$VERSION_ADDON.tar.gz ]; then
cat >>RELEASE_BODY.md <<EOL
#### RaspberryMatic Variante _rpi0_
[![Downloads redmatic-armv6l-$VERSION_ADDON](https://img.shields.io/github/downloads/rdmtc/RedMatic/v$VERSION_ADDON/redmatic-armv6l-$VERSION_ADDON.tar.gz.svg)]($DOWNLOAD_ARMV6L)
EOL
fi

if [ -f $BUILD_DIR/redmatic-i686-$VERSION_ADDON.tar.gz ]; then
cat >>RELEASE_BODY.md <<EOL
#### RaspberryMatic Varianten _ova_ und _intelnuc_
[![Downloads redmatic-i686-$VERSION_ADDON](https://img.shields.io/github/downloads/rdmtc/RedMatic/v$VERSION_ADDON/redmatic-i686-$VERSION_ADDON.tar.gz.svg)]($DOWNLOAD_I686)
EOL
fi

cat >>RELEASE_BODY.md <<EOL
### Changes
Expand Down

0 comments on commit 1fe2577

Please sign in to comment.