diff --git a/tools/nightly-release.sh b/tools/nightly-release.sh index 02423ad5..2d60a99a 100755 --- a/tools/nightly-release.sh +++ b/tools/nightly-release.sh @@ -1,5 +1,5 @@ # This script creates the nightly release on Github for micro -# You must have the correct Github access token to run this script +# Must be run from inside the micro git repository commitID=$(git rev-parse HEAD) info=$(github-release info -u zyedidia -r micro -t nightly) @@ -10,152 +10,28 @@ if [[ $info = *$commitID* ]]; then fi echo "Deleting old release" -github-release delete \ - --user zyedidia \ - --repo micro \ - --tag nightly +hub release delete nightly echo "Moving tag" -git tag --force nightly $commitID -git push --force --tags +hub push origin :refs/tags/nightly +git tag -f nightly $commitID +hub push --tags echo "Creating new release" -github-release release \ - --user zyedidia \ - --repo micro \ - --tag nightly \ - --name "Nightly build" \ - --description "Autogenerated nightly build of micro. If you don't see anything here that probably means it's building right now!" \ - --pre-release - -echo "Cross compiling binaries" -./cross-compile.sh $1 -mv ../binaries . - -echo "Uploading OSX binary" -github-release upload \ - --user zyedidia \ - --repo micro \ - --tag nightly \ - --name "micro-$1-osx.tar.gz" \ - --file binaries/micro-$1-osx.tar.gz - -echo "Uploading Linux 64 binary" -github-release upload \ - --user zyedidia \ - --repo micro \ - --tag nightly \ - --name "micro-$1-linux64.tar.gz" \ - --file binaries/micro-$1-linux64.tar.gz - -echo "Uploading Linux 64 static binary" -github-release upload \ - --user zyedidia \ - --repo micro \ - --tag nightly \ - --name "micro-$1-linux64-static.tar.gz" \ - --file binaries/micro-$1-linux64-static.tar.gz - -echo "Uploading Linux 32 binary" -github-release upload \ - --user zyedidia \ - --repo micro \ - --tag nightly \ - --name "micro-$1-linux32.tar.gz" \ - --file binaries/micro-$1-linux32.tar.gz - -echo "Uploading Linux Arm 32 binary" -github-release upload \ - --user zyedidia \ - --repo micro \ - --tag nightly \ - --name "micro-$1-linux-arm.tar.gz" \ - --file binaries/micro-$1-linux-arm.tar.gz - -echo "Uploading Linux Arm 64 binary" -github-release upload \ - --user zyedidia \ - --repo micro \ - --tag nightly \ - --name "micro-$1-linux-arm64.tar.gz" \ - --file binaries/micro-$1-linux-arm64.tar.gz - -echo "Uploading FreeBSD 64 binary" -github-release upload \ - --user zyedidia \ - --repo micro \ - --tag nightly \ - --name "micro-$1-freebsd64.tar.gz" \ - --file binaries/micro-$1-freebsd64.tar.gz - -echo "Uploading FreeBSD 32 binary" -github-release upload \ - --user zyedidia \ - --repo micro \ - --tag nightly \ - --name "micro-$1-freebsd32.tar.gz" \ - --file binaries/micro-$1-freebsd32.tar.gz - -echo "Uploading OpenBSD 64 binary" -github-release upload \ - --user zyedidia \ - --repo micro \ - --tag nightly \ - --name "micro-$1-openbsd64.tar.gz" \ - --file binaries/micro-$1-openbsd64.tar.gz - -echo "Uploading OpenBSD 32 binary" -github-release upload \ - --user zyedidia \ - --repo micro \ - --tag nightly \ - --name "micro-$1-openbsd32.tar.gz" \ - --file binaries/micro-$1-openbsd32.tar.gz - -echo "Uploading NetBSD 64 binary" -github-release upload \ - --user zyedidia \ - --repo micro \ - --tag nightly \ - --name "micro-$1-netbsd64.tar.gz" \ - --file binaries/micro-$1-netbsd64.tar.gz - -echo "Uploading NetBSD 32 binary" -github-release upload \ - --user zyedidia \ - --repo micro \ - --tag nightly \ - --name "micro-$1-netbsd32.tar.gz" \ - --file binaries/micro-$1-netbsd32.tar.gz - -echo "Uploading Windows 64 binary" -github-release upload \ - --user zyedidia \ - --repo micro \ - --tag nightly \ - --name "micro-$1-win64.zip" \ - --file binaries/micro-$1-win64.zip - -echo "Uploading Windows 32 binary" -github-release upload \ - --user zyedidia \ - --repo micro \ - --tag nightly \ - --name "micro-$1-win32.zip" \ - --file binaries/micro-$1-win32.zip - -# echo "Uploading vendored tarball" -# github-release upload \ -# --user zyedidia \ -# --repo micro \ -# --tag nightly \ -# --name "micro-$1-src.tar.gz" \ -# --file binaries/micro-$1-src.tar.gz -# -# echo "Uploading vendored zip" -# github-release upload \ -# --user zyedidia \ -# --repo micro \ -# --tag nightly \ -# --name "micro-$1-src.zip" \ -# --file binaries/micro-$1-src.zip +hub release create nightly \ + --prerelease \ + --message $'Nightly build\n\nAutogenerated nightly build of micro.' \ + --attach "binaries/micro-$1-osx.tar.gz" \ + --attach "binaries/micro-$1-linux64.tar.gz" \ + --attach "binaries/micro-$1-linux64-static.tar.gz" \ + --attach "binaries/micro-$1-linux32.tar.gz" \ + --attach "binaries/micro-$1-linux-arm.tar.gz" \ + --attach "binaries/micro-$1-linux-arm64.tar.gz" \ + --attach "binaries/micro-$1-freebsd64.tar.gz" \ + --attach "binaries/micro-$1-freebsd32.tar.gz" \ + --attach "binaries/micro-$1-openbsd64.tar.gz" \ + --attach "binaries/micro-$1-openbsd32.tar.gz" \ + --attach "binaries/micro-$1-netbsd64.tar.gz" \ + --attach "binaries/micro-$1-netbsd32.tar.gz" \ + --attach "binaries/micro-$1-win64.zip" \ + --attach "binaries/micro-$1-win32.zip" diff --git a/tools/pre-release.sh b/tools/pre-release.sh index 9f42f57c..4b12fb8f 100755 --- a/tools/pre-release.sh +++ b/tools/pre-release.sh @@ -8,145 +8,25 @@ tag="v$1" echo "Creating tag" git tag $tag $commitID -git push --tags +hub push --tags + +NL=$'\n' echo "Creating new release" -github-release release \ - --user zyedidia \ - --repo micro \ - --tag $tag \ - --name "$1" \ - --description "$2" \ - --pre-release - -echo "Cross compiling binaries" -./cross-compile.sh $1 -mv ../binaries . - -echo "Uploading OSX binary" -github-release upload \ - --user zyedidia \ - --repo micro \ - --tag $tag \ - --name "micro-$1-osx.tar.gz" \ - --file binaries/micro-$1-osx.tar.gz - -echo "Uploading Linux 64 binary" -github-release upload \ - --user zyedidia \ - --repo micro \ - --tag $tag \ - --name "micro-$1-linux64.tar.gz" \ - --file binaries/micro-$1-linux64.tar.gz - -echo "Uploading Linux 64 static binary" -github-release upload \ - --user zyedidia \ - --repo micro \ - --tag $tag \ - --name "micro-$1-linux64-static.tar.gz" \ - --file binaries/micro-$1-linux64-static.tar.gz - -echo "Uploading Linux 32 binary" -github-release upload \ - --user zyedidia \ - --repo micro \ - --tag $tag \ - --name "micro-$1-linux32.tar.gz" \ - --file binaries/micro-$1-linux32.tar.gz - -echo "Uploading Linux Arm 32 binary" -github-release upload \ - --user zyedidia \ - --repo micro \ - --tag $tag \ - --name "micro-$1-linux-arm.tar.gz" \ - --file binaries/micro-$1-linux-arm.tar.gz - -echo "Uploading Linux Arm 64 binary" -github-release upload \ - --user zyedidia \ - --repo micro \ - --tag $tag \ - --name "micro-$1-linux-arm64.tar.gz" \ - --file binaries/micro-$1-linux-arm64.tar.gz - -echo "Uploading FreeBSD 64 binary" -github-release upload \ - --user zyedidia \ - --repo micro \ - --tag $tag \ - --name "micro-$1-freebsd64.tar.gz" \ - --file binaries/micro-$1-freebsd64.tar.gz - -echo "Uploading FreeBSD 32 binary" -github-release upload \ - --user zyedidia \ - --repo micro \ - --tag $tag \ - --name "micro-$1-freebsd32.tar.gz" \ - --file binaries/micro-$1-freebsd32.tar.gz - -echo "Uploading OpenBSD 64 binary" -github-release upload \ - --user zyedidia \ - --repo micro \ - --tag $tag \ - --name "micro-$1-openbsd64.tar.gz" \ - --file binaries/micro-$1-openbsd64.tar.gz - -echo "Uploading OpenBSD 32 binary" -github-release upload \ - --user zyedidia \ - --repo micro \ - --tag $tag \ - --name "micro-$1-openbsd32.tar.gz" \ - --file binaries/micro-$1-openbsd32.tar.gz - -echo "Uploading NetBSD 64 binary" -github-release upload \ - --user zyedidia \ - --repo micro \ - --tag $tag \ - --name "micro-$1-netbsd64.tar.gz" \ - --file binaries/micro-$1-netbsd64.tar.gz - -echo "Uploading NetBSD 32 binary" -github-release upload \ - --user zyedidia \ - --repo micro \ - --tag $tag \ - --name "micro-$1-netbsd32.tar.gz" \ - --file binaries/micro-$1-netbsd32.tar.gz - -echo "Uploading Windows 64 binary" -github-release upload \ - --user zyedidia \ - --repo micro \ - --tag $tag \ - --name "micro-$1-win64.zip" \ - --file binaries/micro-$1-win64.zip - -echo "Uploading Windows 32 binary" -github-release upload \ - --user zyedidia \ - --repo micro \ - --tag $tag \ - --name "micro-$1-win32.zip" \ - --file binaries/micro-$1-win32.zip - -# echo "Uploading vendored tarball" -# github-release upload \ -# --user zyedidia \ -# --repo micro \ -# --tag $tag \ -# --name "micro-$1-src.tar.gz" \ -# --file binaries/micro-$1-src.tar.gz -# -# echo "Uploading vendored zip" -# github-release upload \ -# --user zyedidia \ -# --repo micro \ -# --tag $tag \ -# --name "micro-$1-src.zip" \ -# --file binaries/micro-$1-src.zip +hub release create $tag \ + --prerelease \ + --message "$1${NL}${NL}$2" \ + --attach "binaries/micro-$1-osx.tar.gz" \ + --attach "binaries/micro-$1-linux64.tar.gz" \ + --attach "binaries/micro-$1-linux64-static.tar.gz" \ + --attach "binaries/micro-$1-linux32.tar.gz" \ + --attach "binaries/micro-$1-linux-arm.tar.gz" \ + --attach "binaries/micro-$1-linux-arm64.tar.gz" \ + --attach "binaries/micro-$1-freebsd64.tar.gz" \ + --attach "binaries/micro-$1-freebsd32.tar.gz" \ + --attach "binaries/micro-$1-openbsd64.tar.gz" \ + --attach "binaries/micro-$1-openbsd32.tar.gz" \ + --attach "binaries/micro-$1-netbsd64.tar.gz" \ + --attach "binaries/micro-$1-netbsd32.tar.gz" \ + --attach "binaries/micro-$1-win64.zip" \ + --attach "binaries/micro-$1-win32.zip" diff --git a/tools/release.sh b/tools/release.sh index f806c565..18cee9cf 100755 --- a/tools/release.sh +++ b/tools/release.sh @@ -8,144 +8,24 @@ tag="v$1" echo "Creating tag" git tag $tag $commitID -git push --tags +hub push --tags + +NL=$'\n' echo "Creating new release" -github-release release \ - --user zyedidia \ - --repo micro \ - --tag $tag \ - --name "$1" \ - --description "$2" \ - -echo "Cross compiling binaries" -./cross-compile.sh $1 -mv ../binaries . - -echo "Uploading OSX binary" -github-release upload \ - --user zyedidia \ - --repo micro \ - --tag $tag \ - --name "micro-$1-osx.tar.gz" \ - --file binaries/micro-$1-osx.tar.gz - -echo "Uploading Linux 64 binary" -github-release upload \ - --user zyedidia \ - --repo micro \ - --tag $tag \ - --name "micro-$1-linux64.tar.gz" \ - --file binaries/micro-$1-linux64.tar.gz - -echo "Uploading Linux 64 static binary" -github-release upload \ - --user zyedidia \ - --repo micro \ - --tag $tag \ - --name "micro-$1-linux64-static.tar.gz" \ - --file binaries/micro-$1-linux64-static.tar.gz - -echo "Uploading Linux 32 binary" -github-release upload \ - --user zyedidia \ - --repo micro \ - --tag $tag \ - --name "micro-$1-linux32.tar.gz" \ - --file binaries/micro-$1-linux32.tar.gz - -echo "Uploading Linux Arm 32 binary" -github-release upload \ - --user zyedidia \ - --repo micro \ - --tag $tag \ - --name "micro-$1-linux-arm.tar.gz" \ - --file binaries/micro-$1-linux-arm.tar.gz - -echo "Uploading Linux Arm 64 binary" -github-release upload \ - --user zyedidia \ - --repo micro \ - --tag $tag \ - --name "micro-$1-linux-arm64.tar.gz" \ - --file binaries/micro-$1-linux-arm64.tar.gz - -echo "Uploading FreeBSD 64 binary" -github-release upload \ - --user zyedidia \ - --repo micro \ - --tag $tag \ - --name "micro-$1-freebsd64.tar.gz" \ - --file binaries/micro-$1-freebsd64.tar.gz - -echo "Uploading FreeBSD 32 binary" -github-release upload \ - --user zyedidia \ - --repo micro \ - --tag $tag \ - --name "micro-$1-freebsd32.tar.gz" \ - --file binaries/micro-$1-freebsd32.tar.gz - -echo "Uploading OpenBSD 64 binary" -github-release upload \ - --user zyedidia \ - --repo micro \ - --tag $tag \ - --name "micro-$1-openbsd64.tar.gz" \ - --file binaries/micro-$1-openbsd64.tar.gz - -echo "Uploading OpenBSD 32 binary" -github-release upload \ - --user zyedidia \ - --repo micro \ - --tag $tag \ - --name "micro-$1-openbsd32.tar.gz" \ - --file binaries/micro-$1-openbsd32.tar.gz - -echo "Uploading NetBSD 64 binary" -github-release upload \ - --user zyedidia \ - --repo micro \ - --tag $tag \ - --name "micro-$1-netbsd64.tar.gz" \ - --file binaries/micro-$1-netbsd64.tar.gz - -echo "Uploading NetBSD 32 binary" -github-release upload \ - --user zyedidia \ - --repo micro \ - --tag $tag \ - --name "micro-$1-netbsd32.tar.gz" \ - --file binaries/micro-$1-netbsd32.tar.gz - -echo "Uploading Windows 64 binary" -github-release upload \ - --user zyedidia \ - --repo micro \ - --tag $tag \ - --name "micro-$1-win64.zip" \ - --file binaries/micro-$1-win64.zip - -echo "Uploading Windows 32 binary" -github-release upload \ - --user zyedidia \ - --repo micro \ - --tag $tag \ - --name "micro-$1-win32.zip" \ - --file binaries/micro-$1-win32.zip - -# echo "Uploading vendored tarball" -# github-release upload \ -# --user zyedidia \ -# --repo micro \ -# --tag $tag \ -# --name "micro-$1-src.tar.gz" \ -# --file binaries/micro-$1-src.tar.gz -# -# echo "Uploading vendored zip" -# github-release upload \ -# --user zyedidia \ -# --repo micro \ -# --tag $tag \ -# --name "micro-$1-src.zip" \ -# --file binaries/micro-$1-src.zip +hub release create $tag \ + --message "$1${NL}${NL}$2" \ + --attach "binaries/micro-$1-osx.tar.gz" \ + --attach "binaries/micro-$1-linux64.tar.gz" \ + --attach "binaries/micro-$1-linux64-static.tar.gz" \ + --attach "binaries/micro-$1-linux32.tar.gz" \ + --attach "binaries/micro-$1-linux-arm.tar.gz" \ + --attach "binaries/micro-$1-linux-arm64.tar.gz" \ + --attach "binaries/micro-$1-freebsd64.tar.gz" \ + --attach "binaries/micro-$1-freebsd32.tar.gz" \ + --attach "binaries/micro-$1-openbsd64.tar.gz" \ + --attach "binaries/micro-$1-openbsd32.tar.gz" \ + --attach "binaries/micro-$1-netbsd64.tar.gz" \ + --attach "binaries/micro-$1-netbsd32.tar.gz" \ + --attach "binaries/micro-$1-win64.zip" \ + --attach "binaries/micro-$1-win32.zip"