Updated build script
This commit is contained in:
BIN
bin/jq-linux64
Executable file
BIN
bin/jq-linux64
Executable file
Binary file not shown.
BIN
bin/jq-win64.exe
Normal file
BIN
bin/jq-win64.exe
Normal file
Binary file not shown.
@@ -1,16 +1,51 @@
|
|||||||
#!/bin/sh
|
#!/bin/sh
|
||||||
|
|
||||||
|
PATH=$(pwd)/bin:$PATH
|
||||||
|
export PATH
|
||||||
|
|
||||||
|
DISTRO_LIST="arch centos7 debian9 fedora28 fedora29 fedora30 solus ubuntu18.04 ubuntu18.10 ubuntu19.04"
|
||||||
|
|
||||||
PRIVATE_KEY=../../blockstorage_dev_private.pem
|
PRIVATE_KEY=../../blockstorage_dev_private.pem
|
||||||
PUBLIC_KEY=./blockstorage_dev_public.pem
|
PUBLIC_KEY=./blockstorage_dev_public.pem
|
||||||
|
|
||||||
APP_VER=$(grep -m1 -a version package.json|sed -e "s/\"//g" -e "s/version: //g" -e "s/,//g" -e "s/ //g")
|
APP_VER=$(grep -m1 -a version package.json|sed -e "s/\"//g" -e "s/version: //g" -e "s/,//g" -e "s/ //g")
|
||||||
OUT_FILE=repertory-ui_${APP_VER}_linux_x86_64.AppImage
|
OUT_FILE=repertory-ui_${APP_VER}_linux_x86_64.AppImage
|
||||||
|
|
||||||
|
exit_script() {
|
||||||
|
echo $1
|
||||||
|
exit 1
|
||||||
|
}
|
||||||
|
|
||||||
if npm run dist; then
|
if npm run dist; then
|
||||||
cd dist
|
cd dist
|
||||||
echo "Signing Installation [${OUT_FILE}]"
|
sha256sum -b ${OUT_FILE} > ${OUT_FILE}.sha256 || exit_script "Create sha256 failed"
|
||||||
sha256sum -b ${OUT_FILE} > ${OUT_FILE}.sha256
|
openssl dgst -sha256 -sign "${PRIVATE_KEY}" -out "${OUT_FILE}.sig" "${OUT_FILE}" || exit_script "Create signature failed"
|
||||||
openssl dgst -sha256 -sign "${PRIVATE_KEY}" -out "${OUT_FILE}.sig" "${OUT_FILE}"
|
base64 "${OUT_FILE}.sig" > "${OUT_FILE}.sig.b64" || exit_script "Create base64 failed"
|
||||||
base64 "${OUT_FILE}.sig" > "${OUT_FILE}.sig.b64"
|
|
||||||
|
rm -f upload_response.json 1>/dev/null 2>&1
|
||||||
|
curl -F name="${OUT_FILE}" -F anonymous=true -F file="@${OUT_FILE}" https://pixeldrain.com/api/file > upload_response.json || exit_script "Upload to Pixeldrain failed"
|
||||||
|
|
||||||
|
PIXEL_SUCCESS=$(jq-linux64 .success upload_response.json)
|
||||||
|
if [ "${PIXEL_SUCCESS}" = "false" ]; then
|
||||||
|
PIXEL_MESSAGE=$(jq-linux64 .message upload_response.json)
|
||||||
|
exit_script "${PIXEL_MESSAGE}"
|
||||||
|
else
|
||||||
|
PIXEL_ID=$(jq-linux64 .id upload_response.json|sed s/\"//g)
|
||||||
|
PIXEL_LOCATION=https://pixeldrain.com/api/file/${PIXEL_ID}
|
||||||
|
|
||||||
|
APP_SIG=$(cat ${OUT_FILE}.sig.b64)
|
||||||
|
APP_SHA256=$(cat ${OUT_FILE}.sha256 | awk '{print $1;}')
|
||||||
|
|
||||||
|
cp -f ../releases.json ./releases.json
|
||||||
|
for DISTRONAME in ${DISTRO_LIST}; do
|
||||||
|
jq-linux64 ".Versions[\"${DISTRONAME}\"]|=(.+ [\"${APP_VER}\"]|unique)" releases.json > releases_temp.json || exit_script "Update releases.json Versions failed"
|
||||||
|
jq-linux64 ".Locations[\"${DISTRONAME}\"].\"${APP_VER}\".sig=\"${APP_SIG}\"" releases_temp.json > releases.json || exit_script "Update releases.json sig failed"
|
||||||
|
jq-linux64 ".Locations[\"${DISTRONAME}\"].\"${APP_VER}\".sha256=\"${APP_SHA256}\"" releases.json > releases_temp.json || exit_script "Update releases.json sha256 failed"
|
||||||
|
jq-linux64 ".Locations[\"${DISTRONAME}\"].\"${APP_VER}\".urls=[\"${PIXEL_LOCATION}\"]" releases_temp.json > releases.json || exit_script "Update releases.json URL failed"
|
||||||
|
done
|
||||||
|
rm -f releases_temp.json
|
||||||
|
fi
|
||||||
cd -
|
cd -
|
||||||
|
else
|
||||||
|
exit_script "Create dist failed"
|
||||||
fi
|
fi
|
||||||
|
|||||||
Reference in New Issue
Block a user