Browse Source

Updates to build-zip.sh and build-release.sh

There were necessary for these scripts to function in my build environment (Mac OSX). This may give errors when running in other environments, but we can deal with that in future, when others need to use these scripts.
sync-multiple-blocks^2
CalDescent 3 years ago
parent
commit
853f80b928
  1. 17
      tools/build-release.sh
  2. 16
      tools/build-zip.sh

17
tools/build-release.sh

@ -1,7 +1,8 @@
#!/usr/bin/env bash #!/usr/bin/env bash
# Change this to where AdvancedInstaller outputs built EXE installers # Change this to where AdvancedInstaller outputs built EXE installers
WINDOWS_INSTALLER_DIR=/home/transfer/Qortal/Qortal-SetupFiles SCRIPT_DIR=$(dirname $(realpath "$0"))
WINDOWS_INSTALLER_DIR="${SCRIPT_DIR}/../WindowsInstaller/Qortal-SetupFiles"
set -e set -e
shopt -s expand_aliases shopt -s expand_aliases
@ -16,6 +17,16 @@ saved_pwd=$PWD
alias SHA256='(sha256 -q || sha256sum | cut -d" " -f1) 2>/dev/null' alias SHA256='(sha256 -q || sha256sum | cut -d" " -f1) 2>/dev/null'
function 3hash {
local zip_src=$1
local md5hash=$(md5 ${zip_src} | awk '{ print $NF }')
local sha1hash=$(shasum ${zip_src} | awk '{ print $1 }')
local sha256hash=$(sha256sum ${zip_src} | awk '{ print $1 }')
echo "\`MD5: ${md5hash}\`"
echo "\`SHA1: ${sha1hash}\`"
echo "\`SHA256: ${sha256hash}\`"
}
# Check we are within a git repo # Check we are within a git repo
git_dir=$( git rev-parse --show-toplevel ) git_dir=$( git rev-parse --show-toplevel )
if [ -z "${git_dir}" ]; then if [ -z "${git_dir}" ]; then
@ -27,7 +38,7 @@ fi
cd ${git_dir} cd ${git_dir}
# Check we are in 'master' branch # Check we are in 'master' branch
# branch_name=$( git symbolic-ref -q HEAD ) # branch_name=$( git symbolic-ref -q HEAD ) || echo "Cannot determine branch name" && exit 1
# branch_name=${branch_name##refs/heads/} # branch_name=${branch_name##refs/heads/}
# if [ "${branch_name}" != "master" ]; then # if [ "${branch_name}" != "master" ]; then
# echo "Unexpected current branch '${branch_name}' - expecting 'master'" # echo "Unexpected current branch '${branch_name}' - expecting 'master'"
@ -56,7 +67,7 @@ git_url=https://github.com/${git_url##*:}
git_url=${git_url%%.git} git_url=${git_url%%.git}
# Check for EXE # Check for EXE
exe=${project^}-${git_tag#v}.exe exe=${project}-${git_tag#v}.exe
exe_src="${WINDOWS_INSTALLER_DIR}/${exe}" exe_src="${WINDOWS_INSTALLER_DIR}/${exe}"
if [ ! -r "${exe_src}" ]; then if [ ! -r "${exe_src}" ]; then
echo "Cannot find EXE installer at ${exe_src}" echo "Cannot find EXE installer at ${exe_src}"

16
tools/build-zip.sh

@ -21,13 +21,13 @@ fi
cd ${git_dir} cd ${git_dir}
# Check we are in 'master' branch # Check we are in 'master' branch
branch_name=$( git symbolic-ref -q HEAD ) # branch_name=$( git symbolic-ref -q HEAD ) || echo "Cannot determine branch name" && exit 1
branch_name=${branch_name##refs/heads/} # branch_name=${branch_name##refs/heads/}
echo "Current git branch: ${branch_name}" # echo "Current git branch: ${branch_name}"
if [ "${branch_name}" != "master" ]; then # if [ "${branch_name}" != "master" ]; then
echo "Unexpected current branch '${branch_name}' - expecting 'master'" # echo "Unexpected current branch '${branch_name}' - expecting 'master'"
exit 1 # exit 1
fi # fi
# Determine project name # Determine project name
project=$( perl -n -e 'if (m/<artifactId>(\w+)<.artifactId>/) { print $1; exit }' pom.xml $) project=$( perl -n -e 'if (m/<artifactId>(\w+)<.artifactId>/) { print $1; exit }' pom.xml $)
@ -60,7 +60,7 @@ git show HEAD:stop.sh > ${build_dir}/stop.sh
printf "{\n}\n" > ${build_dir}/settings.json printf "{\n}\n" > ${build_dir}/settings.json
touch -d ${commit_ts%%+??:??} ${build_dir} ${build_dir}/* gtouch -d ${commit_ts%%+??:??} ${build_dir} ${build_dir}/*
rm -f ${saved_pwd}/${project}.zip rm -f ${saved_pwd}/${project}.zip
(cd ${build_dir}/..; 7z a -r -tzip ${saved_pwd}/${project}-${git_tag#v}.zip ${project}/) (cd ${build_dir}/..; 7z a -r -tzip ${saved_pwd}/${project}-${git_tag#v}.zip ${project}/)

Loading…
Cancel
Save