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.

hdist 575B

123456789101112131415161718192021222324
  1. #!/bin/sh
  2. #
  3. # pbrisbin 2014 - smart cabal sdist/upload wrapper. Reads credentials from
  4. # ~/.netrc so they don't have to be in ~/.cabal/config or entered each time.
  5. #
  6. ###
  7. name="$(sed '/^[Nn]ame: *\([^ ]*\)/!d; s//\1/' *.cabal)"
  8. version="$(sed '/^[Vv]ersion: *\([^ ]*\)/!d; s//\1/' *.cabal)"
  9. credentials() {
  10. python <<EOF
  11. import netrc
  12. (u, _, p) = netrc.netrc().authenticators('hackage.haskell.org')
  13. print(u)
  14. print(p)
  15. EOF
  16. }
  17. cabal sdist &&
  18. credentials | cabal upload "dist/$name-$version.tar.gz" &&
  19. git tag -s -m v"$version" v"$version" &&
  20. git push && git push --tags