1
0
mirror of https://github.com/pdf2htmlEX/pdf2htmlEX.git synced 2024-12-22 04:50:09 +00:00
pdf2htmlEX/buildScripts/uploadGitHubRelease

93 lines
2.9 KiB
Plaintext
Raw Permalink Normal View History

#!/bin/sh
2019-11-28 09:07:49 +00:00
# This shell script uploads the pdf2htmlEX release artefacts
2019-11-28 09:07:49 +00:00
#
# We EXPECT the following environment variables to be set:
# GITHUB_TOKEN
# DOCKER_HUB_USERNAME
2019-11-28 09:07:49 +00:00
#
# You can OPTIONALLY set the following environment variables:
# DOCKER_HUB_PASSWORD (if not set you will be asked for your password)
2019-11-28 09:07:49 +00:00
#
# source ./buildScripts/reSourceVersionEnvs
. ./buildScripts/reSourceVersionEnvs
cp ./buildScripts/reSourceVersionEnvs imageBuild/buildInfo.sh
. ./buildScripts/uploadGitHubReleaseDSL
# source ./buildScripts/uploadGitHubReleaseDSL
echo ""
echo "-------------------------------------------------------------------"
echo "UPLOADING pdf2htmlEX AppImage and Container Images"
echo "-------------------------------------------------------------------"
echo ""
2019-11-28 12:04:22 +00:00
2019-11-28 09:07:49 +00:00
##################################
# upload github release artefacts
#
2019-11-29 07:28:23 +00:00
# begin by gathering the required environment variables
#
if [ -z "$GITHUB_USERNAME" ]; then
echo ""
read -p "Enter the GitHub upload username: " GITHUB_USERNAME
echo ""
if [ -z "$GITHUB_USERNAME" ]; then
echo "GITHUB_USERNAME not set... so we can not upload release artefacts."
exit 1
fi
fi
2019-11-28 12:04:22 +00:00
2019-11-29 07:28:23 +00:00
if [ -z "$GITHUB_TOKEN" ]; then
echo ""
read -p "Enter the GitHub upload token/password: " GITHUB_TOKEN
echo ""
if [ -z "$GITHUB_TOKEN" ]; then
echo "GITHUB_TOKEN not set... so we can not upload release artefacts."
exit 1
fi
fi
2019-11-29 07:28:23 +00:00
if [ -z "$TRAVIS_REPO_SLUG" ]; then
echo ""
read -p "Enter the GitHub repository (user/proj): " TRAVIS_REPO_SLUG
echo ""
if [ -z "$TRAVIS_REPO_SLUG" ]; then
echo "TRAVIS_REPO_SLUG (Github repository) not set... so we can not upload release artefacts."
exit 1
fi
fi
2019-11-28 09:07:49 +00:00
2019-11-29 07:28:23 +00:00
cd imageBuild
2019-11-28 09:07:49 +00:00
2020-06-06 10:52:52 +00:00
ls -la
2019-11-29 07:28:23 +00:00
echo "machine api.github.com" > $HOME/.netrc
echo " login $GITHUB_USERNAME" >> $HOME/.netrc
echo " password $GITHUB_TOKEN" >> $HOME/.netrc
echo "machine uploads.github.com" >> $HOME/.netrc
echo " login $GITHUB_USERNAME" >> $HOME/.netrc
echo " password $GITHUB_TOKEN" >> $HOME/.netrc
2019-11-28 09:07:49 +00:00
echo $APPIMAGE_NAME > appImageName.txt
echo $CONTAINER_NAME > containerImageName.txt
echo $DPKG_NAME > debianArchiveName.txt
echo $TEST_RESULTS_NAME > testResultsName.txt
2019-11-28 09:07:49 +00:00
deleteReleaseByTag "$TRAVIS_REPO_SLUG" "continuous-$BUILD_DIST"
2019-11-28 19:13:40 +00:00
2020-06-06 08:59:52 +00:00
createNewRelease "$TRAVIS_REPO_SLUG" "continuous-$BUILD_DIST" "Latest $BUILD_DIST release" \
2019-11-29 09:43:07 +00:00
../buildScripts/uploadGitHubReleaseMessage
2019-11-28 09:07:49 +00:00
uploadAnAsset $upload_url "appImageName.txt" "text/plain"
uploadAnAsset $upload_url "testResultsName.txt" "text/plain"
uploadAnAsset $upload_url "buildInfo.sh" "text/plain"
uploadAnAsset $upload_url "containerImageName.txt" "text/plain"
uploadAnAsset $upload_url "debianArchiveName.txt" "text/plain"
uploadAnAsset $upload_url $APPIMAGE_NAME "application/zip"
uploadAnAsset $upload_url $TEST_RESULTS_NAME "application/zip"
uploadAnAsset $upload_url $DPKG_NAME "application/x-debian-package"
2019-11-29 12:35:49 +00:00