Pull request: scripts: fix build-release
Merge in DNS/adguard-home from 2276-fix-release-3 to master Updates #2276. Updates #2507. Squashed commit of the following: commit 1f756975922b403e06dca3e9d44d9ed2edccb97c Author: Ainar Garipov <A.Garipov@AdGuard.COM> Date: Thu Dec 31 13:45:25 2020 +0300 scripts: fix build-release
This commit is contained in:
parent
3706f559c1
commit
cfd492cf7c
@ -157,6 +157,7 @@ build() {
|
|||||||
GOMIPS="${build_mips#0}"\
|
GOMIPS="${build_mips#0}"\
|
||||||
GOOS="$os"\
|
GOOS="$os"\
|
||||||
VERBOSE="$(( verbose - 1 ))"\
|
VERBOSE="$(( verbose - 1 ))"\
|
||||||
|
VERSION="$version"\
|
||||||
OUT="$build_output"\
|
OUT="$build_output"\
|
||||||
sh ./scripts/make/go-build.sh\
|
sh ./scripts/make/go-build.sh\
|
||||||
;
|
;
|
||||||
@ -287,7 +288,7 @@ log "calculating checksums"
|
|||||||
cd "./${dist}"
|
cd "./${dist}"
|
||||||
|
|
||||||
# Don't use quotes to get word splitting.
|
# Don't use quotes to get word splitting.
|
||||||
sha256sum $(ls *.tar.gz *.zip) > ./checksums.txt
|
sha256sum $(ls -1 -A -q *.tar.gz *.zip) > ./checksums.txt
|
||||||
)
|
)
|
||||||
|
|
||||||
log "writing versions"
|
log "writing versions"
|
||||||
@ -295,6 +296,9 @@ log "writing versions"
|
|||||||
echo "$version" > "./${dist}/version.txt"
|
echo "$version" > "./${dist}/version.txt"
|
||||||
|
|
||||||
# Create the verison.json file.
|
# Create the verison.json file.
|
||||||
|
#
|
||||||
|
# TODO(a.garipov): Perhaps rewrite this as a go run program. Dealing
|
||||||
|
# with structured documents is really not a Shell's job.
|
||||||
|
|
||||||
readonly version_download_url="https://static.adguard.com/adguardhome/${channel}"
|
readonly version_download_url="https://static.adguard.com/adguardhome/${channel}"
|
||||||
readonly version_json="./${dist}/version.json"
|
readonly version_json="./${dist}/version.json"
|
||||||
@ -319,8 +323,12 @@ echo "{
|
|||||||
# Use +f here so that ls works and we don't need to use find.
|
# Use +f here so that ls works and we don't need to use find.
|
||||||
set +f
|
set +f
|
||||||
|
|
||||||
|
readonly ar_files="$(ls -1 -A -q "./${dist}/"*.tar.gz "./${dist}/"*.zip)"
|
||||||
|
readonly ar_files_len="$(echo "$ar_files" | wc -l)"
|
||||||
|
|
||||||
|
i='1'
|
||||||
# Don't use quotes to get word splitting.
|
# Don't use quotes to get word splitting.
|
||||||
for f in $(ls "./${dist}/"*.tar.gz "./${dist}/"*.zip)
|
for f in $ar_files
|
||||||
do
|
do
|
||||||
platform="$f"
|
platform="$f"
|
||||||
|
|
||||||
@ -334,7 +342,14 @@ echo "{
|
|||||||
# Use the filename's base path.
|
# Use the filename's base path.
|
||||||
filename="${f#./${dist}/}"
|
filename="${f#./${dist}/}"
|
||||||
|
|
||||||
|
if [ "$i" = "$ar_files_len" ]
|
||||||
|
then
|
||||||
|
echo " \"download_${platform}\": \"${version_download_url}/${filename}\"" >> "$version_json"
|
||||||
|
else
|
||||||
echo " \"download_${platform}\": \"${version_download_url}/${filename}\"," >> "$version_json"
|
echo " \"download_${platform}\": \"${version_download_url}/${filename}\"," >> "$version_json"
|
||||||
|
fi
|
||||||
|
|
||||||
|
: "$(( i++ ))"
|
||||||
done
|
done
|
||||||
)
|
)
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user