You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

47 lines
931 B

  1. #!/bin/bash
  2. PREFIX=gcn64usb
  3. HEXFILE=$PREFIX.hex
  4. echo "Release script for $PREFIX"
  5. if [ $# -ne 2 ]; then
  6. echo "Syntax: ./release.sh version releasedir"
  7. echo
  8. echo "ex: './release 1.0' will produce $PREFIX-1.0.tar.gz in releasedir out of git HEAD,"
  9. echo "untar it, build the firmware and create $PREFIX-1.0.hex in releasedir."
  10. exit
  11. fi
  12. VERSION=$1
  13. RELEASEDIR=$2
  14. DIRNAME=$PREFIX-$VERSION
  15. FILENAME=$PREFIX-$VERSION.tar.gz
  16. TAG=v$VERSION
  17. echo "Version: $VERSION"
  18. echo "Filename: $FILENAME"
  19. echo "Release directory: $RELEASEDIR"
  20. echo "--------"
  21. echo "Ready? Press ENTER to go ahead (or CTRL+C to cancel)"
  22. read
  23. if [ -f $RELEASEDIR/$FILENAME ]; then
  24. echo "Release file already exists!"
  25. exit 1
  26. fi
  27. git tag $TAG -f -a
  28. git archive --format=tar --prefix=$DIRNAME/ HEAD | gzip > $RELEASEDIR/$FILENAME
  29. cd $RELEASEDIR
  30. tar zxf $FILENAME
  31. cd $DIRNAME
  32. make
  33. cp $HEXFILE ../$PREFIX-$VERSION.hex
  34. cd ..
  35. echo
  36. echo
  37. echo
  38. ls -l $PREFIX-$VERSION.*