1
0
mirror of https://github.com/pdf2htmlEX/pdf2htmlEX.git synced 2024-12-22 13:00:08 +00:00

updated uploadGitHub scripts

This commit is contained in:
Stephen Gaito 2019-11-29 12:35:49 +00:00
parent af9c57800c
commit 8d4b348688
2 changed files with 34 additions and 19 deletions

View File

@ -11,6 +11,7 @@
# #
source ./buildScripts/reSourceVersionEnvs source ./buildScripts/reSourceVersionEnvs
cp ./buildScripts/reSourceVersionEnvs imageBuild/buildInfo.sh
source ./buildScripts/uploadGitHubReleaseDSL source ./buildScripts/uploadGitHubReleaseDSL
echo "" echo ""
@ -66,16 +67,16 @@ echo "machine uploads.github.com" >> $HOME/.netrc
echo " login $GITHUB_USERNAME" >> $HOME/.netrc echo " login $GITHUB_USERNAME" >> $HOME/.netrc
echo " password $GITHUB_TOKEN" >> $HOME/.netrc echo " password $GITHUB_TOKEN" >> $HOME/.netrc
echo $BUILD_TIME > buildTime echo $APPIMAGE_NAME > appImageName.txt
echo $APPIMAGE_NAME > appImageName echo $DOCKER_NAME > dockerImageName.txt
echo $DOCKER_NAME > dockerImageName
deleteReleaseByTag "$TRAVIS_REPO_SLUG" "continuous" deleteReleaseByTag "$TRAVIS_REPO_SLUG" "continuous"
createNewRelease "$TRAVIS_REPO_SLUG" "continuous" "Latest release" \ createNewRelease "$TRAVIS_REPO_SLUG" "continuous" "Latest release" \
../buildScripts/uploadGitHubReleaseMessage ../buildScripts/uploadGitHubReleaseMessage
uploadAnAsset $upload_url appImageName "text/plain" uploadAnAsset $upload_url "appImageName.txt" "text/plain"
uploadAnAsset $upload_url buildTime "text/plain" uploadAnAsset $upload_url "buildInfo.sh" "text/plain"
uploadAnAsset $upload_url dockerImageName "text/plain" uploadAnAsset $upload_url "dockerImageName.txt" "text/plain"
uploadAnAsset $upload_url $APPIMAGE_NAME "application/zip" uploadAnAsset $upload_url $APPIMAGE_NAME "application/zip"

View File

@ -47,20 +47,29 @@ function deleteReleaseByTag {
"https://api.github.com/repos/${REPO}/releases" "https://api.github.com/repos/${REPO}/releases"
) )
releaseID=$(echo $response | jq '.[] | select(.tag_name == "$releaseTag") | .id') releaseID=$(echo $response | \
jq --arg releaseTag $releaseTag \
'.[] | select(.tag_name == $releaseTag) | .id')
echo ""
echo "releaseID(s): $releaseID"
echo ""
if [ -n "$releaseID" ] ; then if [ -n "$releaseID" ] ; then
echo "deleting an existing '$releaseTag' release in the repo $REPO" for aReleaseID in $releaseID
response=$( do
curl --fail \ echo "deleting an existing '$releaseTag'($aReleaseID) release in the repo $REPO"
--netrc \ response=$(
--silent \ curl --fail \
--location \ --netrc \
--request "DELETE" \ --silent \
"https://api.github.com/repos/${REPO}/releases/$releaseID" --location \
) --request "DELETE" \
"https://api.github.com/repos/${REPO}/releases/$aReleaseID"
)
done
echo ""
fi fi
echo "looking for an existing '$releaseTag' git/tag in the repo $REPO" echo "looking for an existing '$releaseTag' git/tag in the repo $REPO"
@ -131,7 +140,12 @@ function createNewRelease {
"https://api.github.com/repos/${REPO}/releases" "https://api.github.com/repos/${REPO}/releases"
) )
upload_url="$(echo "$response" | jq -r .upload_url | sed -e "s/{?name,label}//")" upload_url="$(echo "$response" | \
jq -r .upload_url | sed -e "s/{?name,label}//")"
echo ""
echo "upload_url:"
echo $upload_url
} }
######################## ########################