2019-08-05 00:50:55 -07:00
|
|
|
#! /usr/bin/env nix-shell
|
|
|
|
#! nix-shell -i bash -p git gnupg
|
|
|
|
set -euo pipefail
|
|
|
|
|
|
|
|
TMPDIR="$(mktemp -d -p /tmp)"
|
|
|
|
trap "rm -rf $TMPDIR" EXIT
|
|
|
|
cd $TMPDIR
|
|
|
|
|
|
|
|
echo "Fetching latest release"
|
|
|
|
git clone https://github.com/joinmarket-org/joinmarket-clientserver 2> /dev/null
|
|
|
|
cd joinmarket-clientserver
|
2021-01-17 05:16:42 -08:00
|
|
|
latest=a5e8879d119c8702476da32957d2cfecc3584c89
|
2019-08-05 00:50:55 -07:00
|
|
|
echo "Latest release is ${latest}"
|
|
|
|
|
|
|
|
# GPG verification
|
|
|
|
export GNUPGHOME=$TMPDIR
|
|
|
|
echo "Fetching Adam Gibson's key"
|
|
|
|
gpg --keyserver hkps://keyserver.ubuntu.com --recv-keys 2B6FC204D9BF332D062B461A141001A1AF77F20B 2> /dev/null
|
2020-12-14 08:48:43 -08:00
|
|
|
echo "Fetching Kristaps Kaupe's key"
|
|
|
|
gpg --keyserver hkps://keyserver.ubuntu.com --recv-keys BF60DF964F88DD88174089A2D47B1B4232B55437 2> /dev/null
|
2019-08-05 00:50:55 -07:00
|
|
|
echo "Verifying latest release"
|
2020-12-14 08:48:43 -08:00
|
|
|
git verify-commit ${latest}
|
2019-08-05 00:50:55 -07:00
|
|
|
|
2020-12-14 08:48:43 -08:00
|
|
|
echo "commit: ${latest}"
|
2019-08-05 00:50:55 -07:00
|
|
|
# The prefix option is necessary because GitHub prefixes the archive contents in this format
|
|
|
|
echo "sha256: $(nix-hash --type sha256 --flat --base32 \
|
|
|
|
<(git archive --format tar.gz --prefix=joinmarket-clientserver-"${latest//v}"/ ${latest}))"
|