run_build: publish sha256 checksums to releases

Fixes #153. It doesn't hurt to have those, though in general clients
probably shouldn't rely too much on getting their binary and their
checksum from the same source.
build-updates
Thomas Orozco 5 years ago
parent 3f3e765c2d
commit 9587d90546
  1. 65
      ci/run_build.sh

@ -211,12 +211,7 @@ if [[ -n "${ARCH_NATIVE-}" ]]; then
# Run tests # Run tests
python3 "${SOURCE_DIR}/test/run_inner_tests.py" python3 "${SOURCE_DIR}/test/run_inner_tests.py"
else else
if [[ ! -n "${ARCH_SUFFIX-}" ]]; then echo "Not a native build, skipping smoke and internal tests"
echo "Built cross package, but $ARCH_SUFFIX is empty!"
exit 1
fi
echo "Built cross package (ARCH_SUFFIX=${ARCH_SUFFIX})"
echo "Skipping smoke and internal tests"
fi fi
# Now, copy over files to DIST_DIR, with appropriate names depending on the # Now, copy over files to DIST_DIR, with appropriate names depending on the
@ -224,42 +219,42 @@ fi
# Handle the DEB / RPM # Handle the DEB / RPM
mkdir -p "${DIST_DIR}" mkdir -p "${DIST_DIR}"
TINIS=() DIST_TINIS=()
for tini in tini tini-static; do SUFFIX=""
if [[ -n "${ARCH_SUFFIX-}" ]]; then if [[ -n "$ARCH_SUFFIX" ]]; then
to="${DIST_DIR}/${tini}-${ARCH_SUFFIX}" SUFFIX="-${ARCH_SUFFIX}"
TINIS+=("$to") elif [[ -z "$ARCH_NATIVE" ]]; then
cp "${BUILD_DIR}/${tini}" "$to" echo "Refusing to publish a non-native build without suffix!"
else exit 1
to="${DIST_DIR}/${tini}" fi
TINIS+=("$to")
cp "${BUILD_DIR}/${tini}" "$to" for build_tini in tini tini-static; do
fi dist_tini="${build_tini}${SUFFIX}"
cp "${BUILD_DIR}/${build_tini}" "${DIST_DIR}/${dist_tini}"
DIST_TINIS+=("$dist_tini")
done done
if [[ -n "${ARCH_NATIVE-}" ]]; then if [[ -n "${ARCH_NATIVE-}" ]]; then
for pkg_format in deb rpm; do for pkg_format in deb rpm; do
src="${BUILD_DIR}/tini_${pkg_version}.${pkg_format}" build_tini="tini_${pkg_version}.${pkg_format}"
dist_tini="tini_${pkg_version}${SUFFIX}.${pkg_format}"
if [[ -n "${ARCH_SUFFIX-}" ]]; then cp "${BUILD_DIR}/${build_tini}" "${DIST_DIR}/${dist_tini}"
to="${DIST_DIR}/tini_${pkg_version}-${ARCH_SUFFIX}.${pkg_format}" DIST_TINIS+=("$dist_tini")
TINIS+=("$to")
cp "$src" "$to"
else
to="${DIST_DIR}/tini_${pkg_version}.${pkg_format}"
TINIS+=("$to")
cp "$src" "$to"
fi
done done
fi fi
echo "Tinis: ${TINIS[*]}" echo "Tinis: ${DIST_TINIS[*]}"
pushd "$DIST_DIR"
for tini in "${TINIS[@]}"; do for tini in "${DIST_TINIS[@]}"; do
echo "${tini}:" echo "${tini}:"
sha1sum "$tini"
sha256sum "$tini" for sum in sha1sum sha256sum; do
"$sum" "$tini" | tee "${tini}.${sum}"
done
file "$tini" file "$tini"
echo "--" echo "--"
done done
@ -279,8 +274,10 @@ if [[ -n "$GPG_PASSPHRASE" ]] && [[ -f "${SOURCE_DIR}/sign.key" ]]; then
gpg --homedir "${GPG_SIGN_HOMEDIR}" --import "${SOURCE_DIR}/sign.key" gpg --homedir "${GPG_SIGN_HOMEDIR}" --import "${SOURCE_DIR}/sign.key"
gpg --homedir "${GPG_VERIFY_HOMEDIR}" --keyserver "$PGP_KEYSERVER" --recv-keys "$PGP_KEY_FINGERPRINT" gpg --homedir "${GPG_VERIFY_HOMEDIR}" --keyserver "$PGP_KEYSERVER" --recv-keys "$PGP_KEY_FINGERPRINT"
for tini in "${TINIS[@]}"; do for tini in "${DIST_TINIS[@]}"; do
echo "${GPG_PASSPHRASE}" | gpg --homedir "${GPG_SIGN_HOMEDIR}" --passphrase-fd 0 --armor --detach-sign "${tini}" echo "${GPG_PASSPHRASE}" | gpg --homedir "${GPG_SIGN_HOMEDIR}" --passphrase-fd 0 --armor --detach-sign "${tini}"
gpg --homedir "${GPG_VERIFY_HOMEDIR}" --verify "${tini}.asc" gpg --homedir "${GPG_VERIFY_HOMEDIR}" --verify "${tini}.asc"
done done
fi fi
popd

Loading…
Cancel
Save