Skip to content

Commit

Permalink
update release.sh to be able to use custom signer gpg key id
Browse files Browse the repository at this point in the history
  • Loading branch information
majestrate committed Feb 18, 2023
1 parent 9e3fda9 commit a2aa572
Showing 1 changed file with 10 additions and 9 deletions.
19 changes: 10 additions & 9 deletions release.sh
Original file line number Diff line number Diff line change
@@ -1,23 +1,24 @@
#!/usr/bin/env bash

set -x
version="$(git describe)"
git clean -xdf

key="${SIGNER:-jeff@lokinet.io}"

_build_release()
{
exe="$1"
builddir="$2"
key="$3"
for os in linux freebsd ; do
for arch in amd64 arm ppc64 ; do
export XD=$builddir/$exe-$os-$arch
GOOS=$os GOARCH=$arch make clean $XD && gpg --sign --detach $XD
GOOS=$os GOARCH=$arch make clean $XD && gpg -u $key --sign --detach $XD
done
done
export XD=$builddir/$exe-darwin
GOOS=darwin GOARCH=amd64 make clean $XD && gpg --sign --detach $XD
GOOS=darwin GOARCH=amd64 make clean $XD && gpg -u $key --sign --detach $XD
export XD=$builddir/$exe-windows.exe
GOOS=windows GOARCH=amd64 make clean $XD && gpg --sign --detach $XD
GOOS=windows GOARCH=amd64 make clean $XD && gpg -u $key --sign --detach $XD
}


Expand All @@ -26,10 +27,10 @@ build=XD-$version
mkdir -p $build
# build i2p version
export LOKINET=0
_build_release XD-i2p-$version $build
_build_release XD-i2p-$version $build $key
# build lokinet version
export LOKINET=1
_build_release XD-lokinet-$version $build
_build_release XD-lokinet-$version $build $key

# verify sigs and makes hashes
for sig in $build/*.sig ; do
Expand All @@ -47,12 +48,12 @@ echo "release hashes:" >> $build/README.txt
echo "" >> $build/README.txt
cat $build/HASHES.txt >> $build/README.txt

gpg --clearsign --detach $build/README.txt
gpg -u $key --clearsign --detach $build/README.txt
mv $build/README.txt.asc $build/README.txt

# make release tarball
tar -cJvf XD-$version.tar.xz $build
gpg --sign --detach XD-$version.tar.xz
gpg -u $key --sign --detach XD-$version.tar.xz

# make preformatted release notes
echo '```' >> notes-$version
Expand Down

0 comments on commit a2aa572

Please sign in to comment.