Add deploy to github button.

This commit is contained in:
Zack 2015-02-21 20:53:36 -05:00
parent f8a513d9da
commit aa633084e5

18
deploy_release.py Normal file
View file

@ -0,0 +1,18 @@
import requests
import json
import sys
import os
branch = sys.argv[1]
tag_name = sys.argv[2]
name = sys.argv[3]
token = os.environ['GITHUB_TSHOCK_OAUTH']
body = 'This is the newest release for TShock. Please see the release thread for more information @ http://tshock.co/xf'
data = {'tag_name':tag_name, 'target_commitish':branch, 'name':name, 'body':body, 'draft':False, 'prerelease':False}
headers = {'Content-Type': 'application/json', 'Authorization': 'token ' + token}
print json.dumps(data)
req = requests.post('https://api.github.com/repos/NyxStudios/TShock/releases', data = json.dumps(data), headers = headers)
print req.text