Skip to content
Snippets Groups Projects
Commit 3603a225 authored by Benoit Lavenier's avatar Benoit Lavenier
Browse files

[fix] Fix github upload to send sha256 checksum file

parent 8f4a1bee
No related branches found
No related tags found
No related merge requests found
<?xml version='1.0' encoding='utf-8'?>
<widget android-versionCode="104018" id="fr.duniter.cesium" ios-CFBundleIdentifier="org.duniter.cesium" version="1.4.18" xmlns="http://www.w3.org/ns/widgets" xmlns:cdv="http://cordova.apache.org/ns/1.0">
<widget android-versionCode="104019" id="fr.duniter.cesium" ios-CFBundleIdentifier="org.duniter.cesium" version="1.4.19" xmlns="http://www.w3.org/ns/widgets" xmlns:cdv="http://cordova.apache.org/ns/1.0">
<name>Cesium</name>
<description>
An simple App for Duniter wallet
......
......@@ -26,13 +26,13 @@ function addPlatformBodyTag(indexPath, platform) {
if(bodyTag.indexOf(platformClass) > -1) return; // already added
var newBodyTag = bodyTag;
let newBodyTag = bodyTag;
var classAttr = findClassAttr(bodyTag);
let classAttr = findClassAttr(bodyTag);
if(classAttr) {
// body tag has existing class attribute, add the classname
var endingQuote = classAttr.substring(classAttr.length-1);
var newClassAttr = classAttr.substring(0, classAttr.length-1);
let endingQuote = classAttr.substring(classAttr.length-1);
let newClassAttr = classAttr.substring(0, classAttr.length-1);
newClassAttr += ' ' + platformClass + ' ' + cordovaClass + endingQuote;
newBodyTag = bodyTag.replace(classAttr, newClassAttr);
......@@ -68,13 +68,13 @@ function findClassAttr(bodyTag) {
if (rootdir) {
// go through each of the platform directories that have been prepared
var platforms = (process.env.CORDOVA_PLATFORMS ? process.env.CORDOVA_PLATFORMS.split(',') : []);
const platforms = (process.env.CORDOVA_PLATFORMS ? process.env.CORDOVA_PLATFORMS.split(',') : []);
for(var x=0; x<platforms.length; x++) {
for(let x=0; x<platforms.length; x++) {
// open up the index.html file at the www root
try {
var platform = platforms[x].trim().toLowerCase();
var indexPath;
const platform = platforms[x].trim().toLowerCase();
let indexPath;
if(platform == 'android') {
indexPath = path.join('platforms', platform, 'assets', 'www', 'index.html');
......
......@@ -9,7 +9,7 @@ const rootdir = process.argv[2];
let skip = true;
if (cmd.indexOf("--release") > -1 || cmd.indexOf("--useref") > -1) {
skip = false;
skip = false;
}
if (rootdir && !skip) {
......@@ -55,7 +55,7 @@ if (rootdir && !skip) {
// ...and keep Robotodraft fonts directory
'!'+path.join(wwwPath, 'lib', 'robotdraft'),
path.join(wwwPath, 'lib', 'robotdraft', '*'),
'!'+path.join(wwwPath, 'lib', 'robotdraft', 'fonts'),
'!'+path.join(wwwPath, 'lib', 'robotdraft', 'fonts')
]);
}
}
......
......@@ -99,7 +99,7 @@ case "$1" in
if [[ -f "${ZIP_FILE}" ]]; then
result=$(curl -s -H ''"$GITHUT_AUTH"'' -H 'Content-Type: application/zip' -T "${ZIP_FILE}" "${upload_url}?name=${ZIP_BASENAME}")
browser_download_url=$(echo "$result" | grep -P "\"browser_download_url\":[ ]?\"[^\"]+" | grep -oP "\"browser_download_url\":[ ]?\"[^\"]+" | grep -oP "https://[A-Za-z0-9/.-]+")
ZIP_SHA256=$(cd ${WEB_OUTPUT} && sha256sum "${PROJECT_NAME}-v${current}-web.zip")
ZIP_SHA256=$(cd ${DIST_WEB} && sha256sum "${ZIP_BASENAME}")
echo " - ${browser_download_url} | Checksum: ${ZIP_SHA256}"
else
echo " - ERROR: Web release (ZIP) not found! Skipping."
......@@ -116,6 +116,13 @@ case "$1" in
echo "- ERROR: Android release (APK) not found! Skipping."
fi
# Send Checksum file
SHA_BASENAME=${PROJECT_NAME}-v$current.sha
SHA_FILE=${PROJECT_DIR}/dist/${SHA_BASENAME}
echo "${ZIP_SHA256}\n" > ${SHA_FILE}
echo "${APK_SHA256}\n" >> ${SHA_FILE}
result=$(curl -s -H ''"$GITHUT_AUTH"'' -H 'Content-Type: text/plain' -T "${SHA_FILE}" "${upload_url}?name=${SHA_BASENAME}")
echo "-----------------------------------------"
echo "Successfully uploading files !"
echo " -> Release url: ${REPO_PUBLIC_URL}/releases/tag/v${current}"
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment