make-official-release.sh 1.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  1. #!/bin/bash
  2. #
  3. # This script signs an installer, creates its .NFO file, and
  4. # copies it to a destination directory. This in turn can be
  5. # uploaded to the official ZeroTier Networks update site for
  6. # auto-updating binary distribution users.
  7. #
  8. # It's in attic/ because end-users won't find it particularly
  9. # useful. You must have the ZeroTier One official signing
  10. # identity secret keys to sign binary releases for auto-update,
  11. # and of course you'd also have to upload it to our servers.
  12. #
  13. # Build the app and the installer, then run this from the root
  14. # of the source tree. It'll need the zerotier-idtool symlink
  15. # that will be placed there after a build, too.
  16. export PATH=/bin:/usr/bin:/sbin:/usr/sbin
  17. if [ "$#" -ne 1 ]; then
  18. echo "Usage: $0 <path to secret signing identity>"
  19. exit 1
  20. fi
  21. if [ ! -e zerotier-idtool ]; then
  22. echo "Unable to find zerotier-idtool in current directory."
  23. exit 1
  24. fi
  25. secret="$1"
  26. if [ ! -e "$secret" ]; then
  27. echo "Can't find $secret"
  28. exit 1
  29. fi
  30. rm -f *.nfo
  31. for inst in `ls ZeroTierOneInstaller-*-*-*_*_*`; do
  32. echo "Found installer: $inst"
  33. nfo="$inst.nfo"
  34. rm -f "$nfo"
  35. echo "tss=`date`" >>"$nfo"
  36. echo "vMajor=`echo $inst | cut -d - -f 4 | cut -d _ -f 1`" >>"$nfo"
  37. echo "vMinor=`echo $inst | cut -d - -f 4 | cut -d _ -f 2`" >>"$nfo"
  38. echo "vRevision=`echo $inst | cut -d - -f 4 | cut -d _ -f 3`" >>"$nfo"
  39. echo "signedBy=`cat $secret | cut -d : -f 1`" >>"$nfo"
  40. echo "ed25519=`./zerotier-idtool sign $secret $inst`" >>"$nfo"
  41. echo "url=http://download.zerotier.com/$inst" >>"$nfo"
  42. done