summarylogtreecommitdiffstats
path: root/update_version.sh
diff options
context:
space:
mode:
Diffstat (limited to 'update_version.sh')
-rwxr-xr-xupdate_version.sh14
1 files changed, 14 insertions, 0 deletions
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