include config file in build artefacts

This commit is contained in:
mappu 2016-10-08 16:30:42 +13:00
parent 6ff0805b1b
commit a5db3c94c7
3 changed files with 7 additions and 2 deletions

View File

@ -1,6 +1,7 @@
mode:regex
\.exe$
^nmdc-webfrontend\.conf$
^_dist/
^bindata\.go$

View File

@ -20,6 +20,10 @@ set -eu
DIST_DIR=./_dist
EXTRA_FILES=(
nmdc-webfrontend.conf.SAMPLE
)
get_package_name() {
# Binaries are named after the containing folder.
pwd | tr / $'\n' | tail -n1
@ -96,10 +100,10 @@ single_build() {
local archive_name="${DIST_DIR}/$(get_package_name)-${version}-${platform}"
if [[ $GOOS == windows ]] ; then
archive_name="${archive_name}.7z"
7z a -mx9 "$archive_name" "${tmpdir}/${local_bin_name}" >/dev/null
7z a -mx9 "$archive_name" "${tmpdir}/${local_bin_name}" "${EXTRA_FILES[@]}" >/dev/null
else
archive_name="${archive_name}.tar.xz"
XZ_OPT='-9' tar caf "$archive_name" -C "${tmpdir}" "${local_bin_name}" --owner=0 --group=0 >/dev/null
XZ_OPT='-9' tar caf "$archive_name" -C "${tmpdir}" "${local_bin_name}" -C "$(pwd)" "${EXTRA_FILES[@]}" --owner=0 --group=0 >/dev/null
fi
# Cleanup