summarylogtreecommitdiffstats
diff options
context:
space:
mode:
authorjoneshf2015-03-18 13:31:22 -0700
committerjoneshf2015-06-30 07:01:52 -0700
commit035471fdcc6b24c24363af9644bfb95c39a2df6f (patch)
tree3fe84a9c76e5b29ec62511ec30a85fb53fb58da8
parent21bf6add7b010db22f00b0fc55671ce000b922d1 (diff)
downloadaur-035471fdcc6b24c24363af9644bfb95c39a2df6f.tar.gz
Don't rely on releases always existing.
-rw-r--r--PKGBUILD2
-rwxr-xr-xupdate_version.sh14
2 files changed, 15 insertions, 1 deletions
diff --git a/PKGBUILD b/PKGBUILD
index 12388094c4b3..c6e26d4c7ea8 100644
--- a/PKGBUILD
+++ b/PKGBUILD
@@ -8,7 +8,7 @@ url="http://www.purescript.org/"
license=('MIT')
depends=('glibc' 'gmp' 'gcc-libs' 'libtinfo')
provides=('purescript')
-source=("https://github.com/purescript/purescript/releases/download/v$pkgver/linux64.tar.gz")
+source=("https://github.com/joneshf/purescript/releases/download/v$pkgver/linux64.tar.gz")
sha512sums=('5b1c04cb1767b2b09eab207b2f43ed409f90b5d9cb69315e0ab68e97b20d6596683503d92219f148b4bd5534c5135871fae827adacbcc2d3c50563f28e13f7ff')
package() {
diff --git a/update_version.sh b/update_version.sh
index b516e98bc0f8..e164b0eb6e2b 100755
--- a/update_version.sh
+++ b/update_version.sh
@@ -1,8 +1,19 @@
#!/bin/bash
set -e -v
+API_JSON=$(printf '{"tag_name": "v%s", "target_commitish": "master", "name": "v%s", "body": "v%s", "draft": false, "prerelease": false}' $VERSION $VERSION $VERSION)
+RELEASE_URL=https://api.github.com/repos/joneshf/purescript/releases
VERSION=$1
+# Grab the original tar.
+curl -L "https://github.com/purescript/purescript/releases/download/v$VERSION/linux64.tar.gz"> orig.tar.gz
+# Make a release
+curl --data "$API_JSON" $RELEASE_URL?access_token=$PURESCRIPT_BIN_TOKEN
+# Upload the tar.
+ASSET_URL=$(curl "$RELEASE_URL/tags/v$VERSION?access_token=$PURESCRIPT_BIN_TOKEN" | json upload_url | sed "s/{.*//")
+curl -X POST -H "Content-Type:application/gzip" "$ASSET_URL?access_token=$PURESCRIPT_BIN_TOKEN&name=linux64.tar.gz" -T orig.tar.gz
+
+# Continue with what we normally do.
git clean -fxd
sed -i "s/^pkgver=.*/pkgver="$VERSION"/" PKGBUILD
updpkgsums
@@ -10,3 +21,6 @@ makepkg -s
mkaurball -f
namcap purescript-bin*.pkg.tar.xz
aurploader
+git add .
+git commit -m "Updated version to $VERSION."
+git push