From 90de0e3eec17ab640ee4dc1b56f6b39a1c8ced18 Mon Sep 17 00:00:00 2001 From: Martin Rotter Date: Thu, 4 Apr 2019 08:38:59 +0200 Subject: [PATCH] flathub automation --- resources/scripts/.flathub-release.sh | 27 ++++++++++++++++++++++ resources/scripts/.travis-install-linux.sh | 17 ++++++++++++-- 2 files changed, 42 insertions(+), 2 deletions(-) create mode 100644 resources/scripts/.flathub-release.sh diff --git a/resources/scripts/.flathub-release.sh b/resources/scripts/.flathub-release.sh new file mode 100644 index 000000000..f2acdde47 --- /dev/null +++ b/resources/scripts/.flathub-release.sh @@ -0,0 +1,27 @@ +#!/bin/bash + +# This script will pull Flathub/Textosaurus repo +# and push new appdata/flatpak-json to new branch. +echo "flathub" + +commit_hash=$2 +tag=$1 +json_file="com.github.rssguard.json" +json_file_new="${json_file}.new" + +git clone https://martinrotter:${GH_TOKEN}@github.com/flathub/com.github.rssguard.git ./flathub +cd flathub + +# Remove branch and create new one. +git push -d origin new-version +git branch -D new-version +git checkout -b new-version + +# Replace old commit hash and branch. +cat "$json_file" | sed -e "s@\"branch\": \".*\"@\"branch\": \"$tag\"@g" > "$json_file_new" +cat "$json_file_new" | sed -e "s@\"commit\": \".*\"@\"commit\": \"$commit_hash\"@g" > "$json_file" + +cat "$json_file" + +git commit -a -m "New version for commit $commit_hash." +git push origin new-version -f \ No newline at end of file diff --git a/resources/scripts/.travis-install-linux.sh b/resources/scripts/.travis-install-linux.sh index 7ec9f2ffb..492595b8b 100755 --- a/resources/scripts/.travis-install-linux.sh +++ b/resources/scripts/.travis-install-linux.sh @@ -5,7 +5,7 @@ source /opt/qt512/bin/qt512-env.sh mkdir rssguard-build && cd rssguard-build # Build application. -lrelease -compress ../rssguard.pro +#lrelease -compress ../rssguard.pro qmake .. "USE_WEBENGINE=$USE_WEBENGINE" make make install @@ -60,4 +60,17 @@ mv "$wikifilenew" "$wikifile" cd ./build-wiki git commit -a -m "New files." git pull origin master -git push origin master \ No newline at end of file +git push origin master + +rc=$?; if [[ $rc != 0 ]]; then exit $rc; fi + +echo "Current git commit hash is $(git rev-parse HEAD)." +echo "Travis branch $TRAVIS_BRANCH and Travis tag $TRAVIS_TAG." + +#if [[ $TRAVIS_BRANCH == $TRAVIS_TAG ]]; then +if [[ true ]]; then + # We will trigger stuff for Flathub. + cd ../../.. + chmod +x ../resources/scripts/.flathub-release.sh + ../resources/scripts/.flathub-release.sh $TRAVIS_TAG $(git rev-parse HEAD) +fi \ No newline at end of file