forked from runtimeverification/k
-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathnightly-release
More file actions
executable file
·10 lines (10 loc) · 1.73 KB
/
Copy pathnightly-release
File metadata and controls
executable file
·10 lines (10 loc) · 1.73 KB
1
2
3
4
5
6
7
8
9
10
#!/bin/sh -ex
git fetch k '+refs/heads/*:refs/remotes/k/*'
test `git rev-parse HEAD:k` = `git rev-parse refs/remotes/k/master^{tree}`
COMMIT=$(git rev-parse --short k/master)
DESCRIPTION='This is the nightly release of the K framework. To install, download and extract the \"Prebuilt K binary\", and follow the instructions in INSTALL.md within the target directory. On Windows, start by installing [Windows Subsystem for Linux](https://docs.microsoft.com/en-us/windows/wsl/install-win10) with Ubuntu, after which you can download and extract the archive by running:\n```\nsudo apt-get install wget\nwget https://github.com/kframework/k5/releases/download/nightly-'$COMMIT'/nightly.tar.gz\ntar xvf nightly.tar.gz\n```\nfrom the bash terminal. K requires gcc and other Linux libraries to run, and building on native Windows, Cygwin, or MINGW is not supported.'
RESPONSE=`curl --data '{"tag_name": "nightly-'$COMMIT'","name": "Nightly build of K framework at commit '$COMMIT'","body": "'"$DESCRIPTION"'", "draft": true,"prerelease": true}' https://api.github.com/repos/kframework/k5/releases?access_token=$GITHUB_TOKEN`
ID=`echo "$RESPONSE" | grep '"id": [0-9]*,' -o | head -1 | grep '[0-9]*' -o`
curl --data-binary @k/k-distribution/target/k-nightly.tar.gz -H "Authorization: token $GITHUB_TOKEN" -H "Content-Type: application/gzip" https://uploads.github.com/repos/kframework/k5/releases/$ID/assets?'name=nightly.tar.gz&label=Prebuilt+K+binary'
curl -X PATCH --data '{"draft": false}' https://api.github.com/repos/kframework/k5/releases/$ID?access_token=$GITHUB_TOKEN
curl --data '{"state": "success","target_url": "'$BUILD_URL'","description": "Build succeeded."}' https://api.github.com/repos/kframework/k5/statuses/$(git rev-parse k/master)?access_token=$GITHUB_TOKEN