diff --git a/.travis.yml b/.travis.yml
index 7dbe5ea..2bac6e9 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -22,7 +22,11 @@ jobs:
# script:
# - pytest -vv tests/tests.py
- stage: deploy
- language: minimal
+ language: node_js
+ node_js:
+ - node
+ before_script:
+ - npm install netlify-cli
script: bash build.sh
deploy:
provider: releases
@@ -30,7 +34,7 @@ jobs:
prerelease: true
api_key:
secure: lW8+Kb5iTTsS7yZ7WmFE1mluZdUY2sj/FCTCgKQVOpBfOhtoyq5esW/ZXTTk3hBRo8gDjm3Ao3CPqMu1ozFTUXkDcyMNaWFB0cdhwdWn3bgIcj5bXPgXhmAZBAVhLk4logvsTA6u6a2Y1iJdwXfszw3FyIdaGcsAYcRBO3gEF2+zRw/LqktG3RhJ7xwYJAvF9uaWBZ/yuW4zHRgJ7RKd94cUdTv0TpPhsWC97F81do+j8psml6MXZtrzfPgxaWU6IoVk1FJXjSkI9sc5Nr+3A/hhDb8PNA0IUvkJ4yrprTLfWq/IrW5jdY0N8HWXRUrhteSjlggA2xZKvvjodK441ZAZDNcfx24fYYikcc/tSwTyreiJCf/ytPD9xOGloptVBSUJDuEC0EJCF4ah9n9Ge6PjOV1V/Z+ww2LjVqcuet3Llu2luoUnq4jnyGaqJGZYaa/8onFiIBjePvBqHS19Dco9NViDKHJwUk0OMpUkNaAPVb7jR0H9pxX2AcjdC+/hKupVJ6W1LgWqwWa7JfXeN5yDvxmuIkl3bMzggcBR1UKPz0QMPBb2rXwRwUKbwBAf/f3xFZPdxy+8k6sMviMaR3Gam3zpWmBcWSCkUcfaxRn4Nn5uJghz0flEkUmNoDVmqKJXytmyXzwkKxXYnhy9pwuKOTK51pBaAtmTEj8hPbM=
- file: video.kino.pub-$TRAVIS_TAG.zip
+ file: repo/video.kino.pub/video.kino.pub-$TRAVIS_TAG.zip
on:
tags: true
repo: quarckster/kodi.kino.pub
diff --git a/build.sh b/build.sh
index 251fcdc..dcd9b41 100755
--- a/build.sh
+++ b/build.sh
@@ -12,12 +12,29 @@ fi
DIR=video.kino.pub-$VERSION
-mkdir $DIR
-echo "Copying the files to a temporary directory"
-echo "=========================================="
-VERSION=$VERSION envsubst < src/addon.xml > $DIR/addon.xml
-rsync -rv --exclude=*.pyc src/resources src/addon.py LICENSE $DIR
-echo
-echo "Creating the addon archive"
-echo "=========================="
-zip -rv -9 -m $DIR.zip $DIR
+function build_addon() {
+ mkdir $DIR
+ echo "Copying the files to a temporary directory"
+ echo "=========================================="
+ VERSION=$VERSION envsubst < src/addon.xml > $DIR/addon.xml
+ rsync -rv --exclude=*.pyc src/resources src/addon.py LICENSE $DIR
+ echo
+ echo "Creating the addon archive"
+ echo "=========================="
+ zip -rv -9 -m $DIR.zip $DIR
+}
+
+function deploy_netlify() {
+ echo "Deploying files to Netlify"
+ echo "=========================="
+ mkdir -p repo.kino.pub repo/video.kino.pub
+ VERSION=$VERSION envsubst < repo_src/addons.xml > repo/addons.xml
+ md5sum repo/addons.xml | cut -d " " -f 1 > repo/addons.xml.md5
+ cp repo_src/addon.xml repo_src/icon.png repo.kino.pub/
+ zip -rv -9 -m repo/repo.kino.pub.zip repo.kino.pub
+ mv $DIR.zip repo/video.kino.pub
+ node_modules/netlify-cli/bin/run deploy --dir=repo --prod --auth=$NETLIFY_AUTH_TOKEN --site=$NETLIFY_SITE_ID
+}
+
+build_addon
+deploy_netlify
diff --git a/repo_src/addon.xml b/repo_src/addon.xml
new file mode 100644
index 0000000..1785e0b
--- /dev/null
+++ b/repo_src/addon.xml
@@ -0,0 +1,16 @@
+
+
+
+
+ https://kodi-kino-pub.netlify.app/addons.xml
+ https://kodi-kino-pub.netlify.app/addons.xml.md5
+ https://kodi-kino-pub.netlify.app/
+
+
+
+ kino.pub - онлайн-кинотеатр.
+
+
+ all
+
+
diff --git a/repo_src/addons.xml b/repo_src/addons.xml
new file mode 100644
index 0000000..cafd58d
--- /dev/null
+++ b/repo_src/addons.xml
@@ -0,0 +1,34 @@
+
+
+
+
+
+ https://kodi-kino-pub.netlify.app/addons.xml
+ https://kodi-kino-pub.netlify.app/addons.xml.md5
+ https://kodi-kino-pub.netlify.app/
+
+
+
+ kino.pub - онлайн-кинотеатр.
+
+
+ all
+
+
+
+
+
+
+
+
+
+ video
+
+
+ kino.pub - онлайн-кинотеатр.
+ all
+ BSD-3-Clause
+
+
+
+
diff --git a/repo_src/icon.png b/repo_src/icon.png
new file mode 100644
index 0000000..b6b259d
Binary files /dev/null and b/repo_src/icon.png differ