Release 0.9.18

This commit is contained in:
hsaturn
2023-02-23 20:43:27 +01:00
parent 21fb01848d
commit 123c5a8fa5
4 changed files with 36 additions and 13 deletions

View File

@@ -1,16 +1,17 @@
#!/bin/bash #!/bin/bash
current_version=$(git describe --tags --abbrev=0) current_version=$(git describe --tags --abbrev=0)
cp library.json.skeleton library.json if [ "$1" == "-d" ]; then
while ifs= read -r line; do do=0
name=$(echo "$line" | sed "s/=.*//g") shift
value=$(echo "$line" | cut -d= -f 2 | sed 's/"//g') else
sed -i "s/#$name/$value/g" library.json do=1
done < library.properties fi
if [ "$1" == "" ]; then if [ "$1" == "" ]; then
echo echo
echo "Syntax: $0 {new_version}" echo "Syntax: $0 [-d] {new_version}"
echo echo
echo " -d : dry run, generate json and update properties but do not run git commands"
echo ""
echo " Current version: $current_version" echo " Current version: $current_version"
echo echo
else else
@@ -23,15 +24,35 @@ else
grep $current_version library.properties grep $current_version library.properties
if [ "$?" == "0" ]; then if [ "$?" == "0" ]; then
sed -i "s/$current_version/$1/" library.properties sed -i "s/$current_version/$1/" library.properties
if [ 0 == 1 ]; then
cp library.json.skeleton library.json
while ifs= read -r line; do
name=$(echo "$line" | sed "s/=.*//g")
value=$(echo "$line" | cut -d= -f 2 | sed 's/"//g')
echo " Replacing $name in json"
if [ "$name" == "depends" ]; then
depends=$(echo "$value" | sed "s/,/ /g")
echo " Depends=$depends"
fi
echo " " sed -i "s@#$name@$value@g" library.json
sed -i "s@#$name@$value@g" library.json
done < library.properties
deps=""
for depend in $depends; do
if [ "$deps" != "" ]; then
deps="$deps, "
fi
deps="$deps'$depend' : '*'"
done
sed -i "s@#dependencies@$deps@g" library.json
sed -i "s/'/\"/g" library.json
if [ "$do" == "1" ]; then
git tag $1 git tag $1
git add library.properties git add library.properties
git add library.json git add library.json
git commit -m "Release $1" git commit -m "Release $1"
git push git push
git push --tags git push --tags
else
echo "No git operation made"
fi fi
else else
echo "Current version does not match library.property version, aborting" echo "Current version does not match library.property version, aborting"

View File

@@ -8,7 +8,7 @@
}, },
"dependencies": "dependencies":
{ "hsaturn/TinyConsole" : "*" }, { "hsaturn/TinyConsole" : "*" },
"version": "0.9.17", "version": "0.9.18",
"exclude": "", "exclude": "",
"examples": "examples/*/*.ino", "examples": "examples/*/*.ino",
"frameworks": "arduino", "frameworks": "arduino",

View File

@@ -6,6 +6,8 @@
"type": "git", "type": "git",
"url": "https://github.com/hsaturn/TinyMqtt.git" "url": "https://github.com/hsaturn/TinyMqtt.git"
}, },
"dependencies":
{ #dependencies },
"version": "#version", "version": "#version",
"exclude": "", "exclude": "",
"examples": "examples/*/*.ino", "examples": "examples/*/*.ino",

View File

@@ -1,5 +1,5 @@
name=TinyMqtt name=TinyMqtt
version=0.9.17 version=0.9.18
author=Francois BIOT, HSaturn, <hsaturn@gmail.com> author=Francois BIOT, HSaturn, <hsaturn@gmail.com>
maintainer=Francois BIOT <hsaturn@gmail.com> maintainer=Francois BIOT <hsaturn@gmail.com>
sentence=A tiny broker and client library for MQTT messaging. sentence=A tiny broker and client library for MQTT messaging.