From 1fbd367abaae221eae05354fc63b3bb01a0f6994 Mon Sep 17 00:00:00 2001 From: tinect Date: Tue, 8 Jan 2019 18:55:21 +0100 Subject: [PATCH] add ravis --- .travis.yml | 31 +++++++++++++++++++++++++++++++ build.sh | 19 +++++++++++++++++++ 2 files changed, 50 insertions(+) create mode 100644 .travis.yml create mode 100755 build.sh diff --git a/.travis.yml b/.travis.yml new file mode 100644 index 0000000..b03aeda --- /dev/null +++ b/.travis.yml @@ -0,0 +1,31 @@ +language: php + +php: + - 7.2 + +sudo: false + +env: + global: + - PLUGIN_NAME=TinectOptimusOptimizer + +cache: + directories: + - "${HOME}/.composer/cache/files" + +install: + - composer install + +script: + - "./build.sh $TRAVIS_TAG" + +deploy: + skip_cleanup: true + provider: releases + api_key: + secure: lEpEgHR4xq9a7fKer7uJIHtqc+va56eeZWCg+CeQjzqO7rM2cIFCMpPgjbvfvuen1ehS64DwAVhLhqVTrFTP/NJhj7VbjXNnsS6mDMkl6F7ojwGAXAPVD6ij1ZTPXLFkimEiAa+OeE6MnOAZ60Rj6uuc3GqvFeRF6CCLO/4zOqLC40EA1LgjwBXI4o1drFCdmuHoR176z5h0fnNjnNbeJxHVQVaLwyyFnM7rP+Piig3nAVLsDTqTiB2d4MguM1zBVdpcg+kKV7+Rn2ML5F3kdKmibqlbZ47fOs1Ru/a3WEudJd7z6x4XlnbcByLxJnyPcMQJgUlSZbBI6AOpZuSVB8XWVPqRU1gz8AHQY1GgSXd0l4KhacG8m992HZuo/wcAJduoKSRJ/vg/xQ9hGuHZhXDUK40qQNo6Bny8jrgRDL5DIkpjTAJN+8/YGdN7rj5QiWFUSTurLkcwIm4sA9KT/jRqG7avLWxAaZNPWRKgU8xhEfK3Pd1AtF1PfQQLYUrpXIoi0Aug4b86mO/qY/3tpxCIOU6UWzpC2/f7f7l00csq4zZw0hbE7IqHzxuRIaKXDb9wJl2VUL6dYhXzd6dtNJoCOll9slP/4Tpyg4+FgmAVyEDcIhdGZq7KR2lwQb2TNqScvPjF7I5aueFpTrYHvDO3Op/Lu4SnNiVm5orQsPI= + file_glob: true + file: TinectOptimusOptimizer*.zip + on: + repo: tinect/TinectOptimusOptimizer + tags: true \ No newline at end of file diff --git a/build.sh b/build.sh new file mode 100755 index 0000000..135b33d --- /dev/null +++ b/build.sh @@ -0,0 +1,19 @@ +#!/usr/bin/env bash + +commit=$1 +if [ -z ${commit} ]; then + commit=$(git tag --sort=-creatordate | head -1) + if [ -z ${commit} ]; then + commit="master"; + fi +fi + +# Remove old release +rm -rf TinectOptimusOptimizer TinectOptimusOptimizer-*.zip + +# Build new release +mkdir -p TinectOptimusOptimizer +git archive ${commit} | tar -x -C TinectOptimusOptimizer +composer install --no-dev -n -o -d TinectOptimusOptimizer +( find ./TinectOptimusOptimizer -type d -name ".git" && find ./TinectOptimusOptimizer -name ".gitignore" && find ./TinectOptimusOptimizer -name ".gitmodules" ) | xargs rm -r +zip -r TinectOptimusOptimizer-${commit}.zip TinectOptimusOptimizer \ No newline at end of file