diff --git a/scripts/release-sign-extension.sh b/scripts/release-sign-extension.sh index 7077b40d9d46eacbddb20afadb94c5a0fa1ff4b7..07d4fa575d50ca5547f3c44260b7d1873f6c2aed 100755 --- a/scripts/release-sign-extension.sh +++ b/scripts/release-sign-extension.sh @@ -56,3 +56,13 @@ case "$1" in exit 1 ;; esac + +##Â Rename output file +XPI_BASENAME=${PROJECT_NAME}-$current-an+fx.xpi +XPI_FILE=${PROJECT_DIR}/dist/web/build/${XPI_BASENAME} +if [[ -f "${XPI_FILE}" ]]; then + cd ${PROJECT_DIR}/dist/web/build/ + + # add a 'v' before version + mv ${XPI_BASENAME} ${PROJECT_NAME}-v$current-an+fx.xpi +fi diff --git a/scripts/release-to-github.sh b/scripts/release-to-github.sh index d40c264478a319e07e38307ed89af2e260befce8..4cb47ce1ce6ef348dd4dbf6c71b7910aa33b4660 100755 --- a/scripts/release-to-github.sh +++ b/scripts/release-to-github.sh @@ -110,32 +110,44 @@ WEB_FILE="${DIST_WEB}/${WEB_BASENAME}" if [[ -f "${WEB_FILE}" ]]; then result=$(curl -s -H ''"$GITHUT_AUTH"'' -H 'Content-Type: application/zip' -T "${WEB_FILE}" "${upload_url}?name=${WEB_BASENAME}") browser_download_url=$(echo "$result" | grep -P "\"browser_download_url\":[ ]?\"[^\"]+" | grep -oP "\"browser_download_url\":[ ]?\"[^\"]+" | grep -oP "https://[A-Za-z0-9/.-]+") - WEB_FILE_SHA256=$(cd ${DIST_WEB} && sha256sum "${WEB_BASENAME}") - echo " - ${browser_download_url} | Checksum: ${WEB_FILE_SHA256}" + WEB_SHA256=$(cd ${DIST_WEB} && sha256sum "${WEB_BASENAME}") + echo " - ${browser_download_url} | Checksum: ${WEB_SHA256}" else echo " - ERROR: Web artifact (ZIP) not found! Skipping." fi -# Upload web extension file -WEB_EXT_BASENAME="${PROJECT_NAME}-v$current-extension.zip" -WEB_EXT_FILE="${DIST_WEB}/${WEB_EXT_BASENAME}" +# Upload web extension (ZIP) file +WEB_EXT_ZIP_BASENAME="${PROJECT_NAME}-v$current-extension.zip" +WEB_EXT_ZIP_FILE="${DIST_WEB}/${WEB_EXT_ZIP_BASENAME}" if [[ -f "${WEB_EXT_FILE}" ]]; then - result=$(curl -s -H ''"$GITHUT_AUTH"'' -H 'Content-Type: application/zip' -T "${WEB_EXT_FILE}" "${upload_url}?name=${WEB_EXT_BASENAME}") + result=$(curl -s -H ''"$GITHUT_AUTH"'' -H 'Content-Type: application/zip' -T "${WEB_EXT_ZIP_FILE}" "${upload_url}?name=${WEB_EXT_ZIP_BASENAME}") browser_download_url=$(echo "$result" | grep -P "\"browser_download_url\":[ ]?\"[^\"]+" | grep -oP "\"browser_download_url\":[ ]?\"[^\"]+" | grep -oP "https://[A-Za-z0-9/.-]+") - WEB_EXT_FILE_SHA256=$(cd ${DIST_WEB} && sha256sum "${WEB_EXT_BASENAME}") - echo " - ${browser_download_url} | Checksum: ${WEB_EXT_FILE_SHA256}" + WEB_EXT_ZIP_SHA256=$(cd ${DIST_WEB} && sha256sum "${WEB_EXT_ZIP_BASENAME}") + echo " - ${browser_download_url} | Checksum: ${WEB_EXT_ZIP_SHA256}" else echo " - ERROR: Web extension artifact (ZIP) not found! Skipping." fi +# Upload web extension (XPI) file +WEB_EXT_XPI_BASENAME="${PROJECT_NAME}-v$current-an+fx.xpi" +WEB_EXT_XPI_FILE="${DIST_WEB}/${WEB_EXT_BASENAME}" +if [[ -f "${WEB_EXT_XPI_FILE}" ]]; then + result=$(curl -s -H ''"$GITHUT_AUTH"'' -H 'Content-Type: application/zip' -T "${WEB_EXT_XPI_FILE}" "${upload_url}?name=${WEB_EXT_XPI_BASENAME}") + browser_download_url=$(echo "$result" | grep -P "\"browser_download_url\":[ ]?\"[^\"]+" | grep -oP "\"browser_download_url\":[ ]?\"[^\"]+" | grep -oP "https://[A-Za-z0-9/.-]+") + WEB_EXT_XPI_SHA256=$(cd ${DIST_WEB} && sha256sum "${WEB_EXT_XPI_BASENAME}") + echo " - ${browser_download_url} | Checksum: ${WEB_EXT_XPI_SHA256}" +else + echo " - ERROR: Web signed extension artifact (XPI) not found! Skipping." +fi + # Upload Android APK file APK_BASENAME="${PROJECT_NAME}-v${current}-android.apk" APK_FILE="${DIST_ANDROID}/${APK_BASENAME}" if [[ -f "${APK_FILE}" ]]; then result=$(curl -s -H ''"$GITHUT_AUTH"'' -H 'Content-Type: application/vnd.android.package-archive' -T "${APK_FILE}" "${upload_url}?name=${APK_BASENAME}") browser_download_url=$(echo "$result" | grep -P "\"browser_download_url\":[ ]?\"[^\"]+" | grep -oP "\"browser_download_url\":[ ]?\"[^\"]+" | grep -oP "https://[A-Za-z0-9/.-]+") - APK_FILE_SHA256=$(cd ${DIST_ANDROID} && sha256sum "${APK_BASENAME}") - echo " - ${browser_download_url} | Checksum: ${APK_FILE_SHA256}" + APK_SHA256=$(cd ${DIST_ANDROID} && sha256sum "${APK_BASENAME}") + echo " - ${browser_download_url} | Checksum: ${APK_SHA256}" else echo "- ERROR: Android artifact (APK) not found! Skipping." fi @@ -143,9 +155,10 @@ fi # Upload sha256 file (checksum) SHA_BASENAME=${PROJECT_NAME}-v$current.sha256 SHA_FILE=${PROJECT_DIR}/dist/${SHA_BASENAME} -echo "${WEB_FILE_SHA256}" > ${SHA_FILE} -echo "${WEB_EXT_FILE_SHA256}" >> ${SHA_FILE} -echo "${APK_FILE_SHA256}" >> ${SHA_FILE} +echo "${WEB_SHA256}" > ${SHA_FILE} +echo "${WEB_EXT_ZIP_SHA256}" >> ${SHA_FILE} +echo "${WEB_EXT_XPI_SHA256}" >> ${SHA_FILE} +echo "${APK_SHA256}" >> ${SHA_FILE} result=$(curl -s -H ''"$GITHUT_AUTH"'' -H 'Content-Type: text/plain' -T "${SHA_FILE}" "${upload_url}?name=${SHA_BASENAME}") ### Success message