...
 
Commits (2)
......@@ -38,7 +38,7 @@ deploy artifacts to bintray:
only: [tags]
script:
- md5sum borg-${VERSION}-*
- apk add curl
- apk add curl jq
- ci/bintray.sh
dependencies:
- armv5
......
......@@ -12,6 +12,8 @@ PKG_NAME=borg-binaries
API=https://api.bintray.com
CURL="curl -u${BINTRAY_USER}:${BINTRAY_API_KEY} -H Content-Type:application/json -H Accept:application/json"
GH_API=https://api.github.com
GH_CURL="curl -H Content-Type:application/json -H Accept:application/json"
DATA="{
\"name\": \"${PKG_NAME}\",
......@@ -68,3 +70,20 @@ for BIN in $(ls borg-${VERSION}-*); do
rm "${LOG}"
done
printf "%s" "📝 Setting version metadata from GitHub... "
# Get release info from GitHub.
GH_RELEASE_INFO=$(${GH_CURL} -s "${GH_API}/repos/borgbackup/borg/releases/tags/${VERSION}")
GH_RELEASE_URL=$(echo ${GH_RELEASE_INFO} | jq -r '.html_url')
GH_RELEASE_DATE=$(echo ${GH_RELEASE_INFO} | jq -r '.published_at' | sed 's/Z/.000Z/g')
GH_RELEASE_BODY=$(echo ${GH_RELEASE_INFO} | jq '.body' | sed -e "s/^\"//g" -e "s/\"$//g")
# Set version metadata
${CURL} -s -X PATCH -d "{ \"vcs_tag\": \"${VERSION}\", \"released\": \"${GH_RELEASE_DATE}\", \"desc\": \"${GH_RELEASE_URL}\" }" \
"${API}/packages/${BINTRAY_REPO}/${PKG_NAME}/versions/${VERSION}" > /dev/null
# Set version release notes
${CURL} -s -X POST -d "{ \"bintray\": { \"syntax\": \"markdown\", \"content\": \"# Binaries for [BorgBackup ${VERSION}](${GH_RELEASE_URL})\n\n${GH_RELEASE_BODY}\" } }" \
"${API}/packages/${BINTRAY_REPO}/${PKG_NAME}/versions/${VERSION}/release_notes" > /dev/null
echo " ✅ Done!"