akvirtualcamera/ports/ci/travis/upload.sh

104 lines
3.1 KiB
Bash
Raw Normal View History

2020-06-05 22:09:17 +00:00
#!/bin/bash
# Webcamoid, webcam capture application.
# Copyright (C) 2017 Gonzalo Exequiel Pedone
#
# Webcamoid is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# Webcamoid is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with Webcamoid. If not, see <http://www.gnu.org/licenses/>.
#
# Web-Site: http://webcamoid.github.io/
if [ ! -z "${USE_WGET}" ]; then
export DOWNLOAD_CMD="wget -nv -c"
else
export DOWNLOAD_CMD="curl --retry 10 -sS -kLOC -"
fi
2021-03-20 19:13:44 +00:00
if [ "${TRAVIS_OS_NAME}" = linux ]; then
BUILD_FOLDER=build-x64
else
BUILD_FOLDER=build
fi
2021-02-11 18:52:23 +00:00
if [[ ! -z "$DAILY_BUILD" || ! -z "$RELEASE_BUILD" ]]; then
2020-06-05 22:09:17 +00:00
if [ -z "$DAILY_BUILD" ]; then
2021-03-20 19:13:44 +00:00
version=$(grep -re '^version[[:space:]]*=[[:space:]]*' ${BUILD_FOLDER}/package_info.conf | awk -F= '{print $2}' | tr -d ' ')
2020-06-05 22:09:17 +00:00
publish=false
else
2021-02-13 13:27:51 +00:00
version=daily-$TRAVIS_BRANCH
2020-06-05 22:09:17 +00:00
publish=true
fi
# Upload to Bintray
curl -fL https://getcli.jfrog.io | sh
./jfrog bt config \
--user=hipersayanx \
2021-05-25 19:53:30 +00:00
--key="$BT_KEY" \
2020-06-05 22:09:17 +00:00
--licenses=GPL-3.0-or-later
2021-03-20 19:13:44 +00:00
path=webcamoid-packages
2020-06-05 22:09:17 +00:00
for f in $(find $path -type f); do
packagePath=${f#$path/}
2021-05-25 19:53:30 +00:00
folder=$(dirname "$packagePath")
2020-06-05 22:09:17 +00:00
./jfrog bt upload \
--user=hipersayanx \
2021-05-25 20:26:10 +00:00
--key="$BT_KEY" \
2020-06-05 22:09:17 +00:00
--override=true \
2021-05-25 20:26:10 +00:00
--publish="$publish" \
2021-05-25 19:53:30 +00:00
"$f" \
2021-05-25 20:26:10 +00:00
"webcamoid/webcamoid/akvirtualcamera/$version" \
2021-05-25 19:53:30 +00:00
"$folder/"
2020-06-05 22:09:17 +00:00
done
# Upload to Github Releases
upload=false
2021-02-11 18:52:23 +00:00
if [[ ! -z "$DAILY_BUILD" && "$upload" == true ]]; then
2020-06-05 22:09:17 +00:00
hub=''
if [ "${TRAVIS_OS_NAME}" = linux ]; then
hub=hub-linux-amd64-${GITHUB_HUBVER}
else
hub=hub-darwin-amd64-${GITHUB_HUBVER}
fi
2021-05-25 19:53:30 +00:00
cd "${TRAVIS_BUILD_DIR}"
${DOWNLOAD_CMD} "https://github.com/github/hub/releases/download/v${GITHUB_HUBVER}/${hub}.tgz" || true
2021-05-25 20:26:10 +00:00
tar xzf "${hub}.tgz"
2020-06-05 22:09:17 +00:00
mkdir -p .local
2021-05-25 19:53:30 +00:00
cp -rf "${hub}"/* .local/
2020-06-05 22:09:17 +00:00
export PATH="${PWD}/.local/bin:${PATH}"
hubTag=$(hub release -df '%T %t%n' | grep 'Daily Build' | awk '{print $1}' | sed 's/.*://')
if [ -z "$hubTag" ]; then
hub release create -p -m 'Daily Build' daily
hubTag=$(hub release -df '%T %t%n' | grep 'Daily Build' | awk '{print $1}' | sed 's/.*://')
fi
if [ ! -z "$hubTag" ]; then
2021-03-20 19:13:44 +00:00
path=webcamoid-packages
2020-06-05 22:09:17 +00:00
for f in $(find $path -type f); do
hubTag=$(hub release -df '%T %t%n' | grep 'Daily Build' | awk '{print $1}' | sed 's/.*://')
hub release edit -m 'Daily Build' -a "$f" "$hubTag"
done
fi
fi
fi